使用Inno Setup完成安装后如何将安装路径写入注册表 [英] How to write install path to registry after install is complete with Inno Setup

查看:468
本文介绍了使用Inno Setup完成安装后如何将安装路径写入注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Inno sSetup完成安装后,如何编写注册表的安装路径?

How to write install path to registry after install is complete with Inno sSetup?

提前谢谢!

推荐答案

像TLama所说,如果希望在安装过程完成后添加密钥,则可以通过ssPostInstall来实现.

Like TLama said, you can achieve it via ssPostInstall if you want the key to be added after the installation process is complete.

[Code]
procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep=ssPostInstall then begin
     RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\HHSTECH',
    'InstallPath', ExpandConstant('{app}'));
  end;
end;

或者您可以使用AfterInstall,该文件将在安装(复制)最后一个文件后调用.

Or you can use AfterInstall that will be called after the last files is installed (copied).

[Files]
Source: ".\THEVERYLASTFILE.XXX"; DestDir: "{app}"; AfterInstall: MyAfterInstall

[Code]
procedure MyAfterInstall();
begin
     RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\HHSTECH',
    'InstallPath', ExpandConstant('{app}'));
end;

这篇关于使用Inno Setup完成安装后如何将安装路径写入注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆