Inno setup 访问注册表键值,获取软件安装路径

[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{C5FE0C14-DFF6-414B-9B11-4BDDE48DA588}
AppName=钢筋切割工具
AppVersion=1.0
AppPublisher=***科技有限公司
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
DisableDirPage=no
DefaultDirName={code:GetInstallString}

[Languages]
Name: “chinesesimp”; MessagesFile: “compiler:Default.isl”

[code]
function GetInstallString(Param:String): String;
var
sInstallPath: String;
begin
sInstallPath := ”;
if RegValueExists(HKLM, ‘SOFTWARE\WOW6432Node\Bentley\Installed_Products\{075603A2-0EEA-42F2-971F-2D675F5555E2}’, ‘ProgramPath’)
then
begin
RegQueryStringValue(HKLM, ‘SOFTWARE\WOW6432Node\Bentley\Installed_Products\{075603A2-0EEA-42F2-971F-2D675F5555E2}’, ‘ProgramPath’, sInstallPath)
Result := sInstallPath;
end else
begin
MsgBox(‘读取注册表键值错误’, mbInformation, MB_OK);
end
end;

[Files]
Source: “C:\Users\70744\Desktop\测试文件\ProStructuresNet.dll”;  DestDir: {app}\mdlapps; Flags: ignoreversion
Source: “C:\Users\70744\Desktop\测试文件\PSX_PlugInBase.dll”;  DestDir: {app}\mdlapps; Flags: ignoreversion
Source: “C:\Users\70744\Desktop\测试文件\RebarAddin.dll”;  DestDir: {app}\mdlapps; Flags: ignoreversion
Source: “C:\Users\70744\Desktop\测试文件\RebarAddin.dll.config”;  DestDir: {app}\mdlapps; Flags: ignoreversion
Source: “C:\Users\70744\Desktop\测试文件\RebarAddin.cfg”;  DestDir: {app}\config\system; Flags: ignoreversion

; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”

------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞1 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容