Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Redirect output of exec to outputprogresswizardpage

77 views
Skip to first unread message

Jorge Moraleda

unread,
Apr 29, 2024, 8:01:38 AM4/29/24
to innosetup
Hello,

I have a relative long running "Exec" as part of my installation. Currently I show a MarqueeProgressPage during this process which works ok.

This exec is quite verbose in its stdout output so I think a better UX would be to display a regular ProgressPage and update the progress bar and message every time the exec prints a line to its standard output.

Is it possible to redirect the Exec output in a way that I could capture it as it is being produced and update the progress page?

Thank you

Gavin Lambert

unread,
Apr 29, 2024, 9:32:01 PM4/29/24
to innosetup
On Tuesday, April 30, 2024 at 12:01:38 AM UTC+12 Jorge Moraleda wrote:
Is it possible to redirect the Exec output in a way that I could capture it as it is being produced and update the progress page?

Exec does not support capturing output.  You will need to write your own helper DLL to perform the execution and pass it a callback to update the progress.  Be careful to call it on the correct thread.

Jorge Moraleda

unread,
May 4, 2024, 2:38:59 PM5/4/24
to innosetup
Thank you. In case others arrive here: I was able to achieve what I wanted by adapting the suggestion given here: https://stackoverflow.com/a/56912589/3981273

Martijn Laan

unread,
May 8, 2024, 3:01:53 PM5/8/24
to innosetup
This will be possible in the next version using a new ExecAndLogOutput support function which can log to the regular log or call your own function line by line.

For example with an own function:

[Code]
procedure LogOutput(const S: String; const Error, FirstLine: Boolean);
begin
  Log('Look!: ' + S);
end;

....

ExecAndLogOutput(..., @LogOutput);

This version will also include other output logging: it will have a new flag to instruct Setup and Uninstall to log output of [Run] and [UninstallRun] entries, Sign Tool output will be logged in the IDE's "Compiler Output" and the same for the output of ISPP's Exec.

The output logging requires waituntilterminated and runascurrentuser.

I don't know when this version will be released. I do know it will have many more exciting features!

Greetings,
Martijn

Op maandag 29 april 2024 om 14:01:38 UTC+2 schreef jorge.m...@gmail.com:
Reply all
Reply to author
Forward
0 new messages