This question already has an answer here:
This is similar to this question: Inno Setup Simple progress page for Run section
If I'm adding some MSI files to my Inno Setup script, I can install these files from the [Run]
section. At that time the progress bar shows 100% and shows the StatusMsg
above the progress bar.
I want manually set the value of the progress bar in the [Run]
section, say a value of 50%.
Similar to something like this:
[Run]
Filename: msiexec.exe; Parameters: "/i ""{#MyRtePath}\runtime.msi"" /qn /norestart"; \
StatusMsg: Installing Runtime Engine; WizardForm.ProgressGauge.progress: 50 ;
You can use similar code to the question you linked to, by calling it from the
BeforeInstall
and/orAfterInstall
handler for each[Run]
entry. Note that Inno itself will run up to 100% in the files section, so you're code will need to start from 0% again, or adjust EVERY entry to use the custom positioning.Late response, but here is some example code I made for anyone else looking for an answer.
Above the
[Setup]
section you will need to define a constant named AppName for use later, you can also use it to set your Setup AppName variable.Now down in your
[code]
section you will need to add the following.Now you can call the DisplayInstallProgress and UpdateInstallProgress procedures in the
[Run]
section using the BeforeInstall and AfterInstall Parameters, like below.I had used this question/answer as a template for creating the progress page: How to show progress during “PrepareToInstall”?
Final note, this implementation goes against jrsoftware's advice:
However I couldn't figure out a way of implementing progress accross items in the
[run]
section without doing this.