如何使用inno Script从注册表中安装MS Office Excel版本?我尝试了下面的代码,它给出了“找不到密钥”,但是它存在
function InitializeSetup(): Boolean;
var
CurVer: Cardinal;
key: string;
if RegQueryDWordValue(HKCR, 'Excel.Application\CurVer\','Default', CurVer) then
begin
// Successfully read the value
MsgBox('Excel Version: ' + IntTOStr(CurVer),mbInformation, MB_OK);
end else begin
MsgBox('Key not found',mbInformation, MB_OK);
end;
end;
将RegQueryDWordValue更改为RegQueryStringValue
function InitializeSetup(): Boolean;
var
CurVer: Cardinal;
key: string;
begin
//if RegQueryDWordValue(HKCR, 'Excel.Application\\CurVer\\','', CurVer) then
if RegQueryStringValue(HKCR, 'Excel.Application\CurVer\','', key) then
begin
// Successfully read the value
MsgBox('Excel Version: ' + key,mbInformation, MB_OK);
end else begin
MsgBox('Excel Not installed',mbInformation, MB_OK);
end;
end;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句