简体   繁体   中英

Execute a batch file after installation and display its output on a custom page before Finished page in Inno Setup

A cmd output can be shown within Inno Setup UI using this solution:
Embedded CMD in Inno Setup installer (show command output on a custom page)

My problem is that I want to execute a batch file in [Run] section (ie) after installation.

Also, I want its output to be displayed in Inno Setup UI, but from documentation I see that [Run] will be executed after installation and before final dialog is displayed.

So how can I show a custom page after installation, which will display all the output from the batch executed from [Run] section?

I tried to call the CustomPage setup via BeforeInstall flag in Run section, but the custom page is displayed for a second and then it returns back to Installing page.

How should I approach this?

It should be enough to call the code from BotonIniciarOnClick from CurStepChanged(ssInstall) .

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then
  begin
    BotonIniciarOnClick(nil);
  end;
end;

(of course, you better rename the function, as its name now does not make sense – and remove its useless argument)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM