Skip to content

Commit f05e803

Browse files
author
Tajudeen
committed
Fix Windows build: Replace Arch constant comparison with runtime functions in Inno Setup [Run] section
- Added IsX64Arch() and IsArm64Arch() helper functions to check architecture at runtime - Updated [Run] section Check parameters to use IsX64Arch()/IsArm64Arch() instead of (Arch = "x64")/(Arch = "arm64") - Fixes parsing error at line 114 during Windows ARM64 build
1 parent 0023c3d commit f05e803

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

build/win32/code.iss

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#NameLong}"; File
108108

109109
[Run]
110110
; Automatically install Visual C++ Redistributables if not already installed (silent, no user interaction)
111-
Filename: "powershell.exe"; Parameters: "-NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -Command ""$url='https://aka.ms/vs/17/release/vc_redist.x64.exe'; $out='{tmp}\vc_redist.x64.exe'; if (-not (Test-Path $out)) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri $url -OutFile $out -UseBasicParsing }; Start-Process -FilePath $out -ArgumentList '/install','/quiet','/norestart' -Wait -NoNewWindow"""; StatusMsg: "Installing Visual C++ Redistributables..."; Check: not IsVCRedistInstalled() and (Arch = "x64"); Flags: runhidden waituntilterminated
112-
Filename: "powershell.exe"; Parameters: "-NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -Command ""$url='https://aka.ms/vs/17/release/vc_redist.arm64.exe'; $out='{tmp}\vc_redist.arm64.exe'; if (-not (Test-Path $out)) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri $url -OutFile $out -UseBasicParsing }; Start-Process -FilePath $out -ArgumentList '/install','/quiet','/norestart' -Wait -NoNewWindow"""; StatusMsg: "Installing Visual C++ Redistributables..."; Check: not IsVCRedistInstalled() and (Arch = "arm64"); Flags: runhidden waituntilterminated
111+
Filename: "powershell.exe"; Parameters: "-NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -Command ""$url='https://aka.ms/vs/17/release/vc_redist.x64.exe'; $out='{tmp}\vc_redist.x64.exe'; if (-not (Test-Path $out)) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri $url -OutFile $out -UseBasicParsing }; Start-Process -FilePath $out -ArgumentList '/install','/quiet','/norestart' -Wait -NoNewWindow"""; StatusMsg: "Installing Visual C++ Redistributables..."; Check: not IsVCRedistInstalled() and IsX64Arch(); Flags: runhidden waituntilterminated
112+
Filename: "powershell.exe"; Parameters: "-NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -Command ""$url='https://aka.ms/vs/17/release/vc_redist.arm64.exe'; $out='{tmp}\vc_redist.arm64.exe'; if (-not (Test-Path $out)) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri $url -OutFile $out -UseBasicParsing }; Start-Process -FilePath $out -ArgumentList '/install','/quiet','/norestart' -Wait -NoNewWindow"""; StatusMsg: "Installing Visual C++ Redistributables..."; Check: not IsVCRedistInstalled() and IsArm64Arch(); Flags: runhidden waituntilterminated
113113
Filename: "{app}\{#ExeBasename}.exe"; Description: "{cm:LaunchProgram,{#NameLong}}"; Tasks: runcode; Flags: nowait postinstall skipifdoesntexist; Check: ShouldRunAfterUpdate() and ExecutableExists()
114114
Filename: "{app}\{#ExeBasename}.exe"; Description: "{cm:LaunchProgram,{#NameLong}}"; Flags: nowait postinstall skipifdoesntexist; Check: (not WizardSilent()) and ExecutableExists()
115115

@@ -1307,6 +1307,25 @@ begin
13071307
Result := not IsBackgroundUpdate();
13081308
end;
13091309
1310+
// Helper functions to check architecture at runtime
1311+
function IsX64Arch(): Boolean;
1312+
begin
1313+
#if "x64" == Arch
1314+
Result := True;
1315+
#else
1316+
Result := False;
1317+
#endif
1318+
end;
1319+
1320+
function IsArm64Arch(): Boolean;
1321+
begin
1322+
#if "arm64" == Arch
1323+
Result := True;
1324+
#else
1325+
Result := False;
1326+
#endif
1327+
end;
1328+
13101329
// Check if Visual C++ Redistributables are installed
13111330
function IsVCRedistInstalled(): Boolean;
13121331
var

0 commit comments

Comments
 (0)