【Inno Setup】查看是否安装了VC++ 2015 Redistributeable

可能有必要先测一下注册表的这一项是否存在

if RegValueExists(HKLM, 'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Version')

这些代码都放在下面这个函数里:

function InitializeSetup(): boolean;

查看注册表的一项,看版本号是否以14开头。因为14.0对应2015.

rtn := RegQueryStringValue(HKLM, 'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Version', CurVer);
str := Copy(CurVer,2,2);

if str = '14' then
begin
    Result := true;
end 
else begin
    Result := false;
end;

猜你喜欢

转载自www.cnblogs.com/liujx2019/p/10307520.html