I currently have two Inno Setup installers working around. I need one of them to report its status as a sub installer to another installer even it running with VERYSILENT
command.
I need this to display a progress bar in my main installer according to sub installer's installation progress because I don't want any infinite (marquee) progress bars for this.
I also read about IPC Mechanism in Delphi. How can I add this communication abilities like pumps to Inno Setup source code? Any tips for starting?
Thanks in advance.
I do not think you need to code fancy IPC stuff for this. Just exchange the information via a temporary file.
Child installer code:
Master installer code:
You can use the
InstallChild
like below, or on any other place of your installer process:Another good solution would be to use the
PrepareToInstall
event function. For an example see my answer to Inno Setup torrent download implementation.Code is using InnoTools InnoCallback library for scheduling timers.
It might be better to use the
TFileStream
instead of theLoadStringFromFile
and theSaveStringToFile
. TheTFileStream
supports read sharing. With theLoadStringFromFile
and theSaveStringToFile
, the progress reporting may occasionally temporarily fail, if both sides happen to try to read and write at the same time.See Inno Setup LoadStringFromFile fails when file is open in another process.
This shows how the child and master installer progresses are linked (if the child installer is not running with the
/verysilent
switch, but with the/silent
only):If you need to use a standalone progress bar, you can use the following master installer code: