Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the [Run] section processed before the CurStepChanged event for the ssPostInstall step is fired?

Tags:

inno-setup

In my code I'm using the [Run] section as well as the CurStepChanged event handler doing some stuff when the ssPostInstall occurs. In pseudo script something like this:

[Run]
Filename: "{app}\FileToRun.exe"; Parameters: "/x"

[Code]
procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then 
  begin
    // do some stuff
  end;
end;

My question is, which one is processed as first. Is the [Run] section processed before the CurStepChanged event for the ssPostInstall step is fired?

From what I've observed it seems that the [Run] section is processed as first.

like image 608
skr Avatar asked Apr 24 '15 07:04

skr


1 Answers

That is true. The [Run] section entries are processed before the CurStepChanged event for the ssPostInstall step is fired. It can be read in the following piece of code (comments are mine):

ProcessRunEntries; // <- this processes the [Run] section entries

if RmDoRestart and
   (InitRestartApplications or
    ((shRestartApplications in SetupHeader.Options) and not InitNoRestartApplications)) then
  RestartApplications;

SetStep(ssPostInstall, True); // <- and this triggers the CurStepChanged event
like image 113
TLama Avatar answered Dec 01 '22 16:12

TLama