Skip to content

Commit e555e5c

Browse files
committed
Update Windows installer script for Visual C++ Redistributable version check
1 parent 5b31aaf commit e555e5c

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

Resources/Installers/Windows/windows_installer_script.iss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,20 @@ begin
232232
end;
233233
234234
function InitializeSetup: Boolean;
235+
var
236+
Version: String;
237+
PackedVersion: Int64;
235238
begin
236-
237-
// https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist
238-
if not IsMsiProductInstalled('{36F68A90-239C-34DF-B58C-64B30153CE35}', PackVersionComponents(14, 44, 35208, 0)) then begin
239-
Dependency_Add('vcredist2022_x64.exe',
239+
// https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist
240+
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Version', Version) and (Copy(Version, 1, 1) = 'v') then begin
241+
Delete(Version, 1, 1);
242+
end;
243+
if not StrToVersion(Version, PackedVersion) or (ComparePackedVersion(PackedVersion, PackVersionComponents(14, 51, 36247, 0)) < 0) then begin
244+
Dependency_Add('vcredist14_x64.exe',
240245
'/passive /norestart',
241-
'Visual C++ 2015-2022 Redistributable (x64)',
242-
'https://aka.ms/vs/17/release/vc_redist.x64.exe',
246+
'Visual C++ v14 Redistributable (x64)',
247+
'https://aka.ms/vc14/vc_redist.x64.exe',
243248
'');
244-
245249
end;
246250
Result := True;
247251
end;

0 commit comments

Comments
 (0)