Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write install path to registry after install is complete with Inno Setup

Tags:

inno-setup

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

Thanks in advance!

like image 544
user441222 Avatar asked Nov 24 '12 02:11

user441222


2 Answers

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;
like image 139
RobeN Avatar answered Nov 09 '22 09:11

RobeN


[Registry]
Root: HKLM; Subkey: Software\HHSTECH; ValueType: string; ValueName: InstallPath; ValueData: {app}
like image 44
user441222 Avatar answered Nov 09 '22 09:11

user441222