Skip to content

Commit b946a33

Browse files
author
Antoine Aflalo
committed
Fix Installer VC Redist
Fixes #84
1 parent d8e0969 commit b946a33

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

Installer/scripts/products/vcredist2015.iss

+3-8
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,13 @@ de.vcredist2015_size_x64=13,9 MB
1616
const
1717
vcredist2015_url = 'http://download.microsoft.com/download/C/E/5/CE514EAE-78A8-4381-86E8-29108D78DBD4/VC_redist.x86.exe';
1818
vcredist2015_url_x64 = 'http://download.microsoft.com/download/C/E/5/CE514EAE-78A8-4381-86E8-29108D78DBD4/VC_redist.x64.exe';
19-
20-
vcredist2015_productcode = '{74D0E5DB-B326-4DAE-A6B2-445B9DE1836E}';
21-
vcredist2015_productcode_x64 = '{0D3E9E15-DE7A-300B-96F1-B4AF12B96488}';
22-
23-
vcredist2015_productcode2 = '{65AD78AD-D23D-3A1E-9305-3AE65CD522C2}';
24-
vcredist2015_productcode2_x64 = '{A1C31BA5-5438-3A07-9EEE-A5FB2D0FDE36}';
19+
vc_redist_version = '14.0';
20+
vc_redist_build = 23506;
2521
2622
procedure vcredist2015();
2723
begin
2824
if (not IsIA64()) then begin
29-
if (not msiproduct(GetString(vcredist2015_productcode, vcredist2015_productcode_x64, '')) and
30-
not msiproduct(GetString(vcredist2015_productcode2, vcredist2015_productcode2_x64, ''))) then
25+
if (not IsVcRedistInstalled(vc_redist_version, vc_redist_build)) then
3126
AddProduct('vcredist2015' + GetArchitectureString() + '.exe',
3227
'/passive /norestart',
3328
CustomMessage('vcredist2015_title' + GetArchitectureString()),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[Code]
2+
3+
4+
function IsVcRedistInstalled(version: String; build: Integer): boolean;
5+
var
6+
regBuildNumber: cardinal;
7+
regKey: String;
8+
regInstalled: cardinal;
9+
begin
10+
if(IsX64()) then begin
11+
regKey := 'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\'+ version +'\VC\Runtimes\x64';
12+
end else begin
13+
regKey := 'SOFTWARE\Microsoft\VisualStudio\'+ version +'\VC\VCRedist\x86';
14+
end;
15+
RegQueryDWordValue(HKLM, regKey, 'Installed', regInstalled);
16+
if(regInstalled <> 1) then begin
17+
Result := false
18+
Exit;
19+
end;
20+
RegQueryDWordValue(HKLM, regKey, 'Bld', regBuildNumber);
21+
Result := (regBuildNumber >= build);
22+
end;

Installer/setup.iss

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ end;
108108
#include "scripts\products\winversion.iss"
109109
#include "scripts\products\fileversion.iss"
110110
#include "scripts\products\dotnetfxversion.iss"
111+
#include "scripts\products\vcredistversion.iss"
111112
112113
// actual products
113114
#ifdef use_iis

0 commit comments

Comments
 (0)