From dd9c21b301531ebb0071382170c094fa02d5e36b Mon Sep 17 00:00:00 2001 From: atavism Date: Wed, 13 Aug 2025 07:05:06 -0700 Subject: [PATCH] updates to inno setup script --- windows/packaging/exe/inno_setup.iss | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/windows/packaging/exe/inno_setup.iss b/windows/packaging/exe/inno_setup.iss index 2211bb9460..2a7319ff32 100644 --- a/windows/packaging/exe/inno_setup.iss +++ b/windows/packaging/exe/inno_setup.iss @@ -43,8 +43,15 @@ Name: "{app}\{{APP_NAME}}\WebView2"; Permissions: everyone-modify [Downloads] Source: "https://go.microsoft.com/fwlink/p/?LinkId=2124703"; DestFile: "{tmp}\MicrosoftEdgeWebView2Setup.exe"; Flags: external +; Visual C++ 2015–2022 Redistributable (x64) +Source: "https://aka.ms/vs/17/release/vc_redist.x64.exe"; DestFile: "{tmp}\vc_redist.x64.exe"; Flags: external [Run] +; Install VC++ runtime if needed (fixes MSVCP140/VCRUNTIME errors) +Filename: "{tmp}\vc_redist.x64.exe"; Parameters: "/install /quiet /norestart"; \ + StatusMsg: "Installing Microsoft Visual C++ 2015–2022 Runtime (x64)…"; \ + Check: NeedsVCRedist and FileExists(ExpandConstant('{tmp}\vc_redist.x64.exe')); \ + Flags: runhidden Filename: "{tmp}\MicrosoftEdgeWebView2Setup.exe"; Parameters: "/silent /install"; StatusMsg: "Installing WebView2 Runtime..."; Check: NeedsWebView2Runtime and FileExists(ExpandConstant('{tmp}\MicrosoftEdgeWebView2Setup.exe')) ; Launch the app after WebView2 has been installed Filename: "{app}\\{{EXECUTABLE_NAME}}"; Description: "{cm:LaunchProgram,{{DISPLAY_NAME}}}"; Flags: {% if PRIVILEGES_REQUIRED == 'admin' %}runascurrentuser{% endif %} nowait postinstall skipifsilent @@ -63,3 +70,19 @@ begin Result := True; // WebView2 is not installed end; end; + + +function NeedsVCRedist(): Boolean; +var + Installed: Cardinal; +begin + // HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64 Installed = 1 + if RegQueryDWordValue(HKLM64, 'Software\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Installed', Installed) then + begin + Result := (Installed <> 1); + end + else + begin + Result := not FileExists(ExpandConstant('{sys}\MSVCP140.dll')); + end; +end; \ No newline at end of file