From 73b4d3ef1fe069d356165b5b77968693bd4bbc28 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Mon, 8 May 2017 06:53:40 -0700 Subject: [PATCH] build: add popup msgs about CreateSymLinkPrivilege Signed-off-by: Ruslan Kuprieiev --- innosetup/addsymlink.iss | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/innosetup/addsymlink.iss b/innosetup/addsymlink.iss index 057d8174a..33fa407af 100644 --- a/innosetup/addsymlink.iss +++ b/innosetup/addsymlink.iss @@ -1,9 +1,14 @@ procedure AddSymLink(); var - ErrorCode: Integer; - SRCdir: String; + ErrorCode: Integer; + SRCdir: String; begin - SRCdir := ExpandConstant('{app}'); - if isUninstaller() = false then - ShellExec('', 'powershell.exe', '-noninteractive -windowstyle hidden -executionpolicy bypass -File "' + SRCdir + '\addSymLinkPermissions.ps1" -mytype ' + SymLinkType, '', SW_HIDE, ewWaitUntilTerminated, ErrorCode); + SRCdir := ExpandConstant('{app}'); + if isUninstaller() = false then begin + if not ShellExec('', 'powershell.exe', '-noninteractive -windowstyle hidden -executionpolicy bypass -File "' + SRCdir + '\addSymLinkPermissions.ps1" -mytype ' + SymLinkType, '', SW_HIDE, ewWaitUntilTerminated, ErrorCode) then begin + MsgBox('Failed to automatically grant SeCreateSymbolicLinkPrivilege. Please download Polsedit(www.southsoftware.com/polsedit.zip). Launch polseditx32.exe or polseeditx64.exe (depending on your Windows version), navigate to "Security Settings" -> "User Rights Assignment", add the account(s) to the list named "Create symbolic links", logoff and login back into your account. More info at https://github.com/git-for-windows/git/wiki/Symbolic-Links.', mbInformation, MB_OK); + end else begin + MsgBox('Automatically added SeCreateSymbolicLinkPrivilege. Please logoff and login back into your account in order for the change to take effect.', mbInformation, MB_OK); + end; + end; end;