From 4887c5b1d5ce89b3f4c129745362ea7bee367396 Mon Sep 17 00:00:00 2001 From: Leo Menzies-Ye Date: Fri, 21 Feb 2025 11:00:31 +1100 Subject: [PATCH] simplifying deps logic as only installing x64 version of the vc++ deps, mirroring what GhostScript installer does --- installer/win/ghost-trap.iss | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/installer/win/ghost-trap.iss b/installer/win/ghost-trap.iss index 3eb8d9d..2e85ad1 100755 --- a/installer/win/ghost-trap.iss +++ b/installer/win/ghost-trap.iss @@ -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])); + VC_Redist := ExpandConstant('{app}\vc_redist.x64.exe'); 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