From 1b7b87a643c266c6197c8390d18bbd08d76307bb Mon Sep 17 00:00:00 2001 From: Leo Menzies-Ye Date: Mon, 5 Feb 2024 12:51:12 +1100 Subject: [PATCH] changing some variable and function names, also combining conditions for set up wizard behaviour when installation process is not terminated normally due to the absence of deps --- installer/win/ghost-trap.iss | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/installer/win/ghost-trap.iss b/installer/win/ghost-trap.iss index 3a8361e..1767082 100755 --- a/installer/win/ghost-trap.iss +++ b/installer/win/ghost-trap.iss @@ -96,7 +96,7 @@ const ; Used to store value of whether we have acceptable Visual C++ Runtime components var - HasAcceptableVCRuntime : Boolean; + HasRequiredVCRuntimeVersion : Boolean; VCRuntimeMissingOptionsPage : TInputOptionWizardPage; IsInstallationFinishedNormally : Boolean; @@ -133,7 +133,7 @@ begin end; end; -function IsAcceptableVCRuntimeInstalled() : Boolean; +function IsRequiredVCRuntimeVersionInstalled() : Boolean; var cMajor: Cardinal; cMinor: Cardinal; @@ -177,9 +177,9 @@ end; procedure InitializeWizard(); begin - HasAcceptableVCRuntime := IsAcceptableVCRuntimeInstalled(); + HasRequiredVCRuntimeVersion := IsRequiredVCRuntimeVersionInstalled(); ; If the OS is missing required dependencies, the installation process will not go the full length and will be aborted early - if not HasAcceptableVCRuntime then begin + if not HasRequiredVCRuntimeVersion then begin IsInstallationFinishedNormally := False; VCRuntimeMissingOptionsPage := CreateInputOptionPage(wpWelcome, 'Visual C++ Runtime Required', @@ -201,21 +201,17 @@ procedure CurStepChanged(CurStep : TSetupStep); var ErrorCode : Integer; begin - if curStep = ssPostInstall then begin - if not WizardForm.Canceled then begin - if not IsInstallationFinishedNormally then begin - case VCRuntimeMissingOptionsPage.Values[0] of - 0: begin - { install dependencies now, using Microsoft's perma-link } - ShellExec('', 'https://aka.ms/vs/17/release/vc_redist.x64.exe', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode); - Abort; - end; - 1: begin - { do it later themselves } - MsgBox('Please install required VC++ dependencies first and try again.', mbInformation, MB_OK); - Abort; - end; - end; + if (curStep = ssPostInstall) and not ((WizardForm.Canceled) or (IsInstallationFinishedNormally)) then begin + case VCRuntimeMissingOptionsPage.Values[0] of + 0: begin + { install dependencies now, using Microsoft's perma-link } + ShellExec('', 'https://aka.ms/vs/17/release/vc_redist.x64.exe', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode); + Abort; + end; + 1: begin + { do it later themselves } + MsgBox('Please install required VC++ dependencies first and try again.', mbInformation, MB_OK); + Abort; end; end; end; \ No newline at end of file