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

只愿长相守 提交于 2021-01-01 04:53:34

问题


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 (i.e.) 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?


回答1:


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)



来源:https://stackoverflow.com/questions/63728900/execute-a-batch-file-after-installation-and-display-its-output-on-a-custom-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!