2017-01-07 03:13:36 +03:00
|
|
|
|
; This script requires Inno Setup Compiler 5.5.9 or later to compile
|
2015-10-02 19:24:03 +03:00
|
|
|
|
; The Inno Setup Compiler (and IDE) can be found at http://www.jrsoftware.org/isinfo.php
|
|
|
|
|
; The IDP plugin for Inno Setup is also required and can be found at https://mitrichsoftware.wordpress.com/inno-setup-tools/inno-download-plugin/
|
2015-10-01 23:08:06 +03:00
|
|
|
|
|
2017-01-07 03:13:36 +03:00
|
|
|
|
#if VER < EncodeVer(5,5,9)
|
|
|
|
|
#error Update your Inno Setup version (5.5.9 or newer)
|
2016-03-22 10:45:46 +03:00
|
|
|
|
#endif
|
|
|
|
|
|
2018-01-12 17:48:35 +03:00
|
|
|
|
#define binDir "."
|
2016-03-24 00:55:49 +03:00
|
|
|
|
|
2018-01-12 17:48:35 +03:00
|
|
|
|
#ifnexist binDir + "\git-credential-manager.exe"
|
2016-03-24 00:55:49 +03:00
|
|
|
|
#error Compile Git Credential Manager first
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-01-12 17:48:35 +03:00
|
|
|
|
#ifnexist "..\..\packages\Tools.InnoSetup.Download.1.5.1\tools\InnoDownload\idp.iss"
|
|
|
|
|
#error IDP plugin for Inno Setup is also required and can be found at https://mitrichsoftware.wordpress.com/inno-setup-tools/inno-download-plugin/
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <..\..\packages\Tools.InnoSetup.Download.1.5.1\tools\InnoDownload\idp.iss>
|
2015-10-01 23:08:06 +03:00
|
|
|
|
|
2016-03-24 00:55:49 +03:00
|
|
|
|
#define VerMajor
|
|
|
|
|
#define VerMinor
|
|
|
|
|
#define VerBuild
|
|
|
|
|
#define VerRevision
|
|
|
|
|
|
2018-01-12 17:48:35 +03:00
|
|
|
|
#expr ParseVersion(binDir + "\git-credential-manager.exe", VerMajor, VerMinor, VerBuild, VerRevision)
|
2016-03-24 00:55:49 +03:00
|
|
|
|
|
2015-11-20 17:24:33 +03:00
|
|
|
|
#define MyAppName "Microsoft Git Credential Manager for Windows"
|
2016-03-24 00:55:49 +03:00
|
|
|
|
#define MyAppVersion str(VerMajor) + "." + str(VerMinor) + "." + str(VerBuild)
|
2015-10-01 23:08:06 +03:00
|
|
|
|
#define MyAppPublisher "Microsoft Corporation"
|
2016-06-29 23:33:42 +03:00
|
|
|
|
#define MyAppPublisherURL "https://www.microsoft.com"
|
2015-10-01 23:08:06 +03:00
|
|
|
|
#define MyAppURL "https://github.com/Microsoft/Git-Credential-Manager-for-Windows"
|
|
|
|
|
#define MyAppExeName "git-credential-manager.exe"
|
2018-05-03 21:10:53 +03:00
|
|
|
|
#define Git4WinVer "2.17.0"
|
2016-05-04 21:37:08 +03:00
|
|
|
|
#define Git4WinVerLong = "v" + str(Git4WinVer) + ".windows.1"
|
|
|
|
|
#define Git4WinName "Git for Windows " + str(Git4WinVer)
|
|
|
|
|
#define Git4WinFile "Git-" + str(Git4WinVer) + "-64-bit.exe"
|
|
|
|
|
#define Git4WinUrl "https://github.com/git-for-windows/git/releases/download/" + str(Git4WinVerLong) + "/" + str(Git4WinFile)
|
2015-11-20 17:24:33 +03:00
|
|
|
|
#define Git4WinSpace 394309632
|
2017-08-01 20:47:41 +03:00
|
|
|
|
#define NetFxName "The Microsoft .NET Framework 4.7"
|
2015-11-20 17:24:33 +03:00
|
|
|
|
#define NetFxBaseFile "NetFx40Installer.exe"
|
2016-06-29 23:33:42 +03:00
|
|
|
|
#define NetFxBaseUrl "https://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe"
|
2015-11-20 17:24:33 +03:00
|
|
|
|
#define NetFxCoreFile "NetFx46Installer.exe"
|
2017-08-01 20:47:41 +03:00
|
|
|
|
#define NetFxCoreUrl "https://download.microsoft.com/download/A/E/A/AEAE0F3F-96E9-4711-AADA-5E35EF902306/NDP47-KB3186500-Web.exe"
|
2015-11-20 17:24:33 +03:00
|
|
|
|
#define NetFxSpace 381005824
|
2015-10-01 23:08:06 +03:00
|
|
|
|
|
|
|
|
|
[Setup]
|
2016-09-22 19:31:40 +03:00
|
|
|
|
AppId={{9F0CBE43-690B-4C03-8845-6AC2CDB29815}}
|
2015-10-01 23:08:06 +03:00
|
|
|
|
AppName={#MyAppName}
|
|
|
|
|
AppVersion={#MyAppVersion}
|
2016-03-24 00:55:49 +03:00
|
|
|
|
AppVerName={#MyAppName} {#MyAppVersion}
|
2015-10-01 23:08:06 +03:00
|
|
|
|
AppPublisher={#MyAppPublisher}
|
2015-10-02 19:24:03 +03:00
|
|
|
|
AppPublisherURL={#MyAppPublisherURL}
|
2015-10-01 23:08:06 +03:00
|
|
|
|
AppSupportURL={#MyAppURL}
|
|
|
|
|
AppUpdatesURL={#MyAppURL}
|
2016-03-24 00:55:49 +03:00
|
|
|
|
AppContact={#MyAppURL}
|
2017-04-09 10:33:45 +03:00
|
|
|
|
AppCopyright=Copyright <20> Microsoft 2017
|
2016-03-24 00:55:49 +03:00
|
|
|
|
VersionInfoVersion={#MyAppVersion}
|
2015-10-02 19:24:03 +03:00
|
|
|
|
AppReadmeFile=https://github.com/Microsoft/Git-Credential-Manager-for-Windows/blob/master/README.md
|
|
|
|
|
BackColor=clWhite
|
2015-10-01 23:08:06 +03:00
|
|
|
|
BackSolid=yes
|
|
|
|
|
DefaultDirName={userpf}\{#MyAppName}
|
2018-01-12 17:48:35 +03:00
|
|
|
|
LicenseFile={#binDir}\LICENSE.txt
|
2016-03-08 20:27:53 +03:00
|
|
|
|
OutputBaseFilename=GCMW-{#MyAppVersion}
|
2015-10-02 19:24:03 +03:00
|
|
|
|
Compression=lzma2
|
|
|
|
|
InternalCompressLevel=ultra64
|
2015-10-01 23:08:06 +03:00
|
|
|
|
SolidCompression=yes
|
|
|
|
|
MinVersion=6.1.7600
|
|
|
|
|
DisableDirPage=yes
|
|
|
|
|
DisableReadyPage=yes
|
2016-03-22 10:45:46 +03:00
|
|
|
|
UninstallDisplayIcon={app}\git-credential-manager.exe
|
2018-01-12 17:48:35 +03:00
|
|
|
|
SetupIconFile=..\..\Assets\gcmicon.ico
|
2015-10-01 23:08:06 +03:00
|
|
|
|
ArchitecturesInstallIn64BitMode=x64
|
2018-01-12 17:48:35 +03:00
|
|
|
|
WizardImageFile=..\..\Assets\gcmicon128.bmp
|
|
|
|
|
WizardSmallImageFile=..\..\Assets\gcmicon64.bmp
|
2015-10-01 23:08:06 +03:00
|
|
|
|
WizardImageStretch=no
|
|
|
|
|
WindowResizable=no
|
|
|
|
|
|
|
|
|
|
[Languages]
|
2015-10-02 19:24:03 +03:00
|
|
|
|
Name: "english"; MessagesFile: "compiler:Default.isl";
|
|
|
|
|
|
|
|
|
|
[Types]
|
|
|
|
|
Name: "full"; Description: "Full installation"; Flags: iscustom;
|
|
|
|
|
|
|
|
|
|
[Components]
|
2015-11-20 17:24:33 +03:00
|
|
|
|
Name: "NetFx"; Description: {#NetFxName}; ExtraDiskSpaceRequired: {#NetFxSpace}; Types: full; Flags: fixed; Check: DetectNetFxChecked;
|
|
|
|
|
Name: "Git4Win"; Description: {#Git4WinName}; ExtraDiskSpaceRequired: {#Git4WinSpace}; Types: full; Flags: fixed; Check: DetectGitChecked;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
|
|
|
|
|
[Files]
|
2018-01-12 17:48:35 +03:00
|
|
|
|
Source: "{#binDir}\git-credential-manager.exe"; DestDir: "{app}"; Flags: ignoreversion
|
2018-05-01 23:31:56 +03:00
|
|
|
|
Source: "{#binDir}\git-askpass.exe"; DestDir: "{app}"; Flags: ignoreversion
|
2018-01-12 17:48:35 +03:00
|
|
|
|
Source: "{#binDir}\Microsoft.Alm.Authentication.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
|
|
|
Source: "{#binDir}\Microsoft.IdentityModel.Clients.ActiveDirectory.dll"; DestDir: "{app}"; Flags: ignoreversion
|
2018-09-12 21:44:09 +03:00
|
|
|
|
Source: "{#binDir}\AzureDevOps.Authentication.dll"; DestDir: "{app}"; Flags: ignoreversion
|
2018-01-12 17:48:35 +03:00
|
|
|
|
Source: "{#binDir}\GitHub.Authentication.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
|
|
|
Source: "{#binDir}\Bitbucket.Authentication.dll"; DestDir: "{app}"; Flags: ignoreversion
|
|
|
|
|
Source: "{#binDir}\README.md"; DestDir: "{app}"; Flags: ignoreversion
|
|
|
|
|
Source: "{#binDir}\git-credential-manager.html"; DestDir: "{app}"; Flags: ignoreversion
|
|
|
|
|
Source: "{#binDir}\git-askpass.html"; DestDir: "{app}"; Flags: ignoreversion
|
2015-10-07 18:13:36 +03:00
|
|
|
|
|
2015-10-01 23:08:06 +03:00
|
|
|
|
[Code]
|
|
|
|
|
type NetFx_Version = (
|
2016-06-29 23:47:51 +03:00
|
|
|
|
NetFx_v30, // .NET Framework 3.0
|
|
|
|
|
NetFx_v35, // .NET Framework 3.5
|
|
|
|
|
NetFx_v40, // .NET Framework 4.0
|
|
|
|
|
NetFx_v45, // .NET Framework 4.5
|
|
|
|
|
NetFx_v451, // .NET Framework 4.5.1
|
|
|
|
|
NetFx_v452, // .NET Framework 4.5.2
|
|
|
|
|
NetFx_v46, // .NET Framework 4.6
|
2017-04-25 17:49:39 +03:00
|
|
|
|
NetFx_v461, // .NET Framework 4.6.1
|
|
|
|
|
NetFx_v462, // .NET Framework 4.6.2
|
|
|
|
|
NetFx_v47 // .NET Framework 4.7
|
2016-03-22 10:45:46 +03:00
|
|
|
|
);
|
2015-10-01 23:08:06 +03:00
|
|
|
|
|
|
|
|
|
function DetectGit(): Boolean;
|
|
|
|
|
var
|
|
|
|
|
bSuccess: Boolean;
|
|
|
|
|
strValue: String;
|
|
|
|
|
begin
|
2016-06-29 23:47:51 +03:00
|
|
|
|
Result := True;
|
2015-10-02 19:24:03 +03:00
|
|
|
|
|
2016-06-29 23:47:51 +03:00
|
|
|
|
bSuccess := RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1', 'InstallLocation', strValue)
|
|
|
|
|
or RegQueryStringValue(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1', 'InstallLocation', strValue)
|
|
|
|
|
or RegQueryStringValue(HKCU, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1', 'InstallLocation', strValue)
|
|
|
|
|
or RegQueryStringValue(HKCU, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1', 'InstallLocation', strValue);
|
2015-10-01 23:08:06 +03:00
|
|
|
|
|
2016-06-29 23:47:51 +03:00
|
|
|
|
if not bSuccess then
|
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
end;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
end;
|
|
|
|
|
|
2015-10-02 19:24:03 +03:00
|
|
|
|
function DetectGitChecked(): Boolean;
|
|
|
|
|
begin
|
|
|
|
|
Result := not DetectGit();
|
|
|
|
|
end;
|
|
|
|
|
|
2015-10-01 23:08:06 +03:00
|
|
|
|
function DetectNetFx(version: NetFx_Version): Boolean;
|
|
|
|
|
var
|
|
|
|
|
bSuccess: Boolean;
|
|
|
|
|
regVersion: Cardinal;
|
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
|
|
|
|
|
bSuccess := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0', 'Install', regVersion);
|
|
|
|
|
|
|
|
|
|
if (NetFx_v30 = version) and bSuccess then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
bSuccess := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5', 'Install', regVersion);
|
|
|
|
|
|
|
|
|
|
if (NetFx_v35 = version) and bSuccess then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
bSuccess := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4.0\Full', 'Install', regVersion)
|
|
|
|
|
or RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4.0\Client', 'Install', regVersion);
|
|
|
|
|
|
|
|
|
|
if (NetFx_v40 = version) and bSuccess then
|
2016-06-29 23:47:51 +03:00
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
|
|
|
|
|
bSuccess := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', regVersion)
|
|
|
|
|
or RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client', 'Release', regVersion);
|
|
|
|
|
|
|
|
|
|
if bSuccess then
|
|
|
|
|
begin
|
|
|
|
|
if (NetFx_v45 = version) and (regVersion >= 378389)then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if (NetFx_v451 = version) and (regVersion >= 378675)then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if (NetFx_v452 = version) and (regVersion >= 379893)then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if (NetFx_v46 = version) and (regVersion >= 393295) then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
2016-02-25 18:45:15 +03:00
|
|
|
|
|
|
|
|
|
if (NetFx_v461 = version) and (regVersion >= 394254) then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
2017-04-25 17:49:39 +03:00
|
|
|
|
|
|
|
|
|
if (NetFx_v462 = version) and (regVersion >= 394802) then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if (NetFx_V47 = version) and (regVersion >= 460798) then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2015-10-02 19:24:03 +03:00
|
|
|
|
function DetectNetFxChecked(): Boolean;
|
|
|
|
|
begin
|
|
|
|
|
Result := not DetectNetFx(NetFx_v451);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function InstallPrerequisites() : Boolean;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
var
|
2015-10-02 19:24:03 +03:00
|
|
|
|
bInstallFx40: Boolean;
|
2016-02-27 00:01:13 +03:00
|
|
|
|
bInstallFx46: Boolean;
|
2015-10-02 19:24:03 +03:00
|
|
|
|
bInstallGit: Boolean;
|
2016-03-24 00:55:49 +03:00
|
|
|
|
StatusText: String;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
ResultCode: Integer;
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
|
2015-11-20 17:24:33 +03:00
|
|
|
|
bInstallFx40 := FileExists(ExpandConstant('{tmp}\{#NetFxBaseFile}'));
|
2016-02-27 00:01:13 +03:00
|
|
|
|
bInstallFx46 := FileExists(ExpandConstant('{tmp}\{#NetFxCoreFile}'));
|
2015-11-20 17:24:33 +03:00
|
|
|
|
bInstallGit := FileExists(ExpandConstant('{tmp}\{#Git4WinFile}'));
|
2015-10-02 19:24:03 +03:00
|
|
|
|
|
|
|
|
|
if bInstallFx40 or bInstallFx46 then
|
2015-10-01 23:08:06 +03:00
|
|
|
|
begin
|
|
|
|
|
StatusText := WizardForm.StatusLabel.Caption;
|
2015-11-20 17:24:33 +03:00
|
|
|
|
WizardForm.StatusLabel.Caption := 'Installing {#NetFxName}. This might take a few minutes...';
|
2015-10-01 23:08:06 +03:00
|
|
|
|
WizardForm.ProgressGauge.Style := npbstMarquee;
|
2015-10-02 19:24:03 +03:00
|
|
|
|
|
2015-10-01 23:08:06 +03:00
|
|
|
|
try
|
2015-10-02 19:24:03 +03:00
|
|
|
|
if bInstallFx40 then
|
2015-10-01 23:08:06 +03:00
|
|
|
|
begin
|
2015-11-20 17:24:33 +03:00
|
|
|
|
if not Exec(ExpandConstant('{tmp}\{#NetFxBaseFile}'), '/passive /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
|
2015-10-02 19:24:03 +03:00
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.', mbError, MB_OK);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2016-02-27 00:01:13 +03:00
|
|
|
|
if bInstallFx46 then
|
2015-10-02 19:24:03 +03:00
|
|
|
|
begin
|
2015-11-20 17:24:33 +03:00
|
|
|
|
if not Exec(ExpandConstant('{tmp}\{#NetFxCoreFile}'), '/passive /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
|
2015-10-02 19:24:03 +03:00
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.', mbError, MB_OK);
|
|
|
|
|
end;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
WizardForm.StatusLabel.Caption := StatusText;
|
|
|
|
|
WizardForm.ProgressGauge.Style := npbstNormal;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2015-10-02 19:24:03 +03:00
|
|
|
|
if bInstallGit then
|
2015-10-01 23:08:06 +03:00
|
|
|
|
begin
|
|
|
|
|
StatusText := WizardForm.StatusLabel.Caption;
|
2015-11-20 17:24:33 +03:00
|
|
|
|
WizardForm.StatusLabel.Caption := 'Installing {#Git4WinName}. This might take a few minutes...';
|
2015-10-01 23:08:06 +03:00
|
|
|
|
WizardForm.ProgressGauge.Style := npbstMarquee;
|
2015-10-02 19:24:03 +03:00
|
|
|
|
|
2015-10-01 23:08:06 +03:00
|
|
|
|
try
|
2015-11-20 17:24:33 +03:00
|
|
|
|
if not Exec(ExpandConstant('{tmp}\{#Git4WinFile}'), '/NOCANCEL', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
|
2015-10-01 23:08:06 +03:00
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
2015-10-02 19:24:03 +03:00
|
|
|
|
MsgBox('Installing Git for Windows failed with code: ' + IntToStr(ResultCode) + '.', mbError, MB_OK);
|
2015-10-01 23:08:06 +03:00
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
WizardForm.StatusLabel.Caption := StatusText;
|
|
|
|
|
WizardForm.ProgressGauge.Style := npbstNormal;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function InstallManager() : Boolean;
|
|
|
|
|
var
|
2016-03-24 00:55:49 +03:00
|
|
|
|
ResultCode: Integer;
|
|
|
|
|
StatusText: String;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
begin
|
|
|
|
|
Result := False;
|
|
|
|
|
|
|
|
|
|
StatusText := WizardForm.StatusLabel.Caption;
|
2015-11-20 17:24:33 +03:00
|
|
|
|
WizardForm.StatusLabel.Caption := 'Installing {#MyAppName}.';
|
2015-10-01 23:08:06 +03:00
|
|
|
|
WizardForm.ProgressGauge.Style := npbstMarquee;
|
|
|
|
|
|
|
|
|
|
try
|
2015-10-07 18:13:36 +03:00
|
|
|
|
if Exec(ExpandConstant('{app}\git-credential-manager.exe'), 'deploy --passive --nofail', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
|
2015-10-01 23:08:06 +03:00
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
WizardForm.StatusLabel.Caption := StatusText;
|
|
|
|
|
WizardForm.ProgressGauge.Style := npbstNormal;
|
2016-03-22 10:45:46 +03:00
|
|
|
|
end;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
end;
|
|
|
|
|
|
2015-10-07 18:13:36 +03:00
|
|
|
|
function UninstallManager() : Boolean;
|
|
|
|
|
var
|
2016-03-24 00:55:49 +03:00
|
|
|
|
ResultCode: Integer;
|
2015-10-07 18:13:36 +03:00
|
|
|
|
begin
|
|
|
|
|
Result := false;
|
|
|
|
|
|
|
|
|
|
if Exec(ExpandConstant('{app}\git-credential-manager.exe'), 'remove --passive --nofail', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function InitializeUninstall(): Boolean;
|
|
|
|
|
begin
|
|
|
|
|
Result := True;
|
|
|
|
|
end;
|
|
|
|
|
|
2015-10-01 23:08:06 +03:00
|
|
|
|
procedure InitializeWizard;
|
|
|
|
|
begin
|
|
|
|
|
if not DetectNetFx(NetFx_v40) then
|
|
|
|
|
begin
|
2015-11-20 17:24:33 +03:00
|
|
|
|
idpAddFile('{#NetFxBaseUrl}', ExpandConstant('{tmp}\{#NetFxBaseFile}'));
|
2015-10-01 23:08:06 +03:00
|
|
|
|
idpDownloadAfter(wpReady);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if not DetectNetFx(NetFx_v451) then
|
|
|
|
|
begin
|
2015-11-20 17:24:33 +03:00
|
|
|
|
idpAddFile('{#NetFxCoreUrl}', ExpandConstant('{tmp}\{#NetFxCoreFile}'));
|
2015-10-01 23:08:06 +03:00
|
|
|
|
idpDownloadAfter(wpReady);
|
|
|
|
|
end;
|
2015-10-02 19:24:03 +03:00
|
|
|
|
|
|
|
|
|
if not DetectGit() then
|
|
|
|
|
begin
|
2015-11-20 17:24:33 +03:00
|
|
|
|
idpAddFile('{#Git4WinUrl}', ExpandConstant('{tmp}\{#Git4WinFile}'));
|
2015-10-02 19:24:03 +03:00
|
|
|
|
idpDownloadAfter(wpReady);
|
|
|
|
|
end;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
end;
|
|
|
|
|
|
2016-03-22 10:45:46 +03:00
|
|
|
|
procedure CurPageChanged(CurPageID: Integer);
|
|
|
|
|
begin
|
|
|
|
|
if CurPageID = wpLicense then
|
|
|
|
|
begin
|
|
|
|
|
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2015-10-01 23:08:06 +03:00
|
|
|
|
procedure CurStepChanged(CurStep: TSetupStep);
|
|
|
|
|
begin
|
|
|
|
|
case CurStep of
|
|
|
|
|
ssInstall:
|
|
|
|
|
begin
|
2015-10-02 19:24:03 +03:00
|
|
|
|
if not (InstallPrerequisites()) then
|
2015-10-01 23:08:06 +03:00
|
|
|
|
begin
|
|
|
|
|
Abort();
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
ssPostInstall:
|
|
|
|
|
begin
|
|
|
|
|
if not (InstallManager()) then
|
|
|
|
|
begin
|
2015-10-02 19:24:03 +03:00
|
|
|
|
RaiseException('Fatal: An error occured when updating the local system.');
|
2015-10-01 23:08:06 +03:00
|
|
|
|
end;
|
|
|
|
|
end;
|
2016-03-22 10:45:46 +03:00
|
|
|
|
end;
|
2015-10-01 23:08:06 +03:00
|
|
|
|
end;
|
|
|
|
|
|
2015-10-07 18:13:36 +03:00
|
|
|
|
procedure CurUninstallStepChanged(CurStep: TUninstallStep);
|
|
|
|
|
begin
|
|
|
|
|
case CurStep of
|
|
|
|
|
usUninstall:
|
|
|
|
|
if not (UninstallManager()) then
|
|
|
|
|
begin
|
|
|
|
|
Abort();
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|