如何在Inno sSetup安装完成后将安装路径写入注册表?
提前感谢!
发布于 2012-11-26 20:52:22
就像TLama说的,如果你想在安装过程完成后添加密钥,你可以通过ssPostInstall来实现。
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssPostInstall then begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\HHSTECH',
'InstallPath', ExpandConstant('{app}'));
end;
end;或者,您可以使用在安装(复制)最后一个文件后调用的AfterInstall。
[Files]
Source: ".\THEVERYLASTFILE.XXX"; DestDir: "{app}"; AfterInstall: MyAfterInstall
[Code]
procedure MyAfterInstall();
begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\HHSTECH',
'InstallPath', ExpandConstant('{app}'));
end;发布于 2012-11-24 11:50:03
[Registry]
Root: HKLM; Subkey: Software\HHSTECH; ValueType: string; ValueName: InstallPath; ValueData: {app}https://stackoverflow.com/questions/13537841
复制相似问题