simplifying deps logic as only installing x64 version of the vc++ deps, mirroring what GhostScript installer does

This commit is contained in:
Leo Menzies-Ye 2025-02-21 11:00:31 +11:00
parent 1441d20fe6
commit 4887c5b1d5

View File

@ -61,8 +61,7 @@ Source: *; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
Source: bin\gsc-trapped.exe; DestDir: {app}\bin\; DestName: gswin32c-trapped.exe;
Source: bin\gs.exe; DestDir: {app}\bin\; DestName: gswin32.exe;
Source: bin\gsc.exe; DestDir: {app}\bin\; DestName: gswin32c.exe;
Source: vc_redist.x64.exe; DestDir: {app}; DestName: vc_redist.x64.exe;
Source: vc_redist.x86.exe; DestDir: {app}; DestName: vc_redist.x86.exe; AfterInstall: InstallVCRedist
Source: vc_redist.x64.exe; DestDir: {app}; DestName: vc_redist.x64.exe; AfterInstall: InstallVCRedist
[Registry]
@ -154,35 +153,16 @@ procedure InstallVCRedist();
var
ErrorCode: Integer;
VC_Redist: String;
VC_Redist_Unused: String;
begin
if isWin64 then
begin
VC_Redist := ExpandConstant('{app}\vc_redist.x64.exe');
VC_Redist_Unused := ExpandConstant('{app}\vc_redist.x86.exe');
end
else
begin
VC_Redist := ExpandConstant('{app}\vc_redist.x86.exe');
VC_Redist_Unused := ExpandConstant('{app}\vc_redist.x64.exe');
end;
if DeleteFile(VC_Redist_Unused) then
Log(Format('Deleted unused VC++ deps installer, %s', [VC_Redist_Unused]))
else
Log(Format('Failed to delete unused VC deps installer, %s', [VC_Redist_Unused]));
if not IsDependencyInstallationAlreadyRunning('VC_redist') then
begin
Log(Format('The VC++ dependency to install will be: %s', [VC_Redist]));
if Exec(VC_Redist, '/norestart /install /quiet', ExpandConstant('{app}'), SW_HIDE, ewWaitUntilTerminated, ErrorCode) then
begin
Log('VC dependencies successfully installed.');
end
Log('VC dependencies successfully installed.')
else
begin
Log(Format('Failed to launch VC++ Redistributable installer. Error Code: %d', [ErrorCode]));
end;
if ErrorCode <> 0 then
begin