How to write install path to registry after install is complete with Inno sSetup?
Thanks in advance!
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;
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;
[Registry]
Root: HKLM; Subkey: Software\HHSTECH; ValueType: string; ValueName: InstallPath; ValueData: {app}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With