Я изменил свою функцию следующим образом:
function IsVCRedist32BitNeeded(): boolean;
var
Major, Minor, Bld, Rbld: Cardinal;
VCRuntimeInstalled: boolean;
begin
VCRuntimeInstalled := false; { Assume that VC Runtime is not installed }
Result := true;
{ Version number is: Major.Minor.Bld.Rbld }
{ Minimum valid version is: 14.14.26429.03 }
if (RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Major', Major) and
RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Minor', Minor) and
RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Bld', Bld) and
RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Rbld', Rbld)) then
begin
VCRuntimeInstalled := true;
end
else if (RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Major', Major) and
RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Minor', Minor) and
RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Bld', Bld) and
RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86', 'Rbld', Rbld)) then
begin
VCRuntimeInstalled := true;
end;
if(VCRuntimeInstalled) then
begin
{ Is the installed version at least 14.14 ? }
Result := Major < 14 or
(Major = 14 and (Minor < 14 or
(Minor = 14 and (Bld < 26429 or
(Bld = 26429 and Rbld < 3)))));
{ 'true' means we need to run the installer }
if (Result) then
begin
Log('Visual Studio Redist x86 is not already installed');
Result := True;
end
else
Log(FmtMessage('Visual Studio Redist x86 Version : found v%1.%2.%3.%4', [Major, Minor, Bld, Rbld]));
end;
end;
end;
Она не будет компилироваться. Он жалуется на несоответствие типов в строке 978:
Result := Major < 14 or
(Major = 14 and (Minor < 14 or
(Minor = 14 and (Bld < 26429 or
(Bld = 26429 and Rbld < 3)))));
Что не так?