Late answer, but here is an example of the code that I made for anyone looking for an answer.
Above the [Setup] section, you will need to define a constant named AppName for later use, you can also use it to set your AppName variable.
#define AppName "Test Installer" [Setup] AppName={#AppName}
Now in the [code] section you need to add the following.
[Code] var InstallWithProgressPage : TOutputProgressWizardPage; //Create custom progress bar for install progress procedure InitializeWizard; var UpdatedPageString: AnsiString; OriginalPageString: String; begin //The string msgWizardPreparing has the macro '[name]' inside that we have to replace. OriginalPageString := SetupMessage(msgPreparingDesc); StringChange(OriginalPageString, '[name]', '{#AppName}'); UpdatedPageString := OriginalPageString; InstallWithProgressPage := CreateOutputProgressPage(SetupMessage(msgWizardPreparing), UpdatedPageString); end; //Enable or Disable the install progress page (also set initial progress/text) procedure DisplayInstallProgress(showPage:Boolean; progressText:String); begin if(showPage = True) then begin InstallWithProgressPage.Show; InstallWithProgressPage.SetText(progressText, ''); InstallWithProgressPage.SetProgress(0,100); end else begin InstallWithProgressPage.Hide; end end; //Update the install progress page procedure UpdateInstallProgress(progressText:String; progressPercent:Integer); begin InstallWithProgressPage.SetProgress(progressPercent,100); InstallWithProgressPage.SetText(progressText, ''); end;
Now you can call the DisplayInstallProgress and UpdateInstallProgress procedures in the [Run] section using the BeforeInstall and AfterInstall parameters, as shown below.
[Run] FileName: "Powershell.exe"; Parameters: "-File {app}\Part1.ps1"; BeforeInstall: DisplayInstallProgress(True, 'Installing part 1.'); FileName: "Powershell.exe"; Parameters: "-File {app}\Part2.ps1"; BeforeInstall: UpdateInstallProgress('Installing part 2.', 30); FileName: "Powershell.exe"; Parameters: "-File {app}\Part3.ps1"; BeforeInstall: UpdateInstallProgress('Installing part 3.', 60); FileName: "Powershell.exe"; Parameters: "-File {app}\Part3.ps1"; BeforeInstall: UpdateInstallProgress('Installing part 4.',90); AfterInstall: DisplayInstallProgress(False, '');
I used this question / answer as a template to create a progress page: How do I show progress during "PrepareToInstall"?
Final note: this implementation goes against jrsoftware advice :
Always place the Hide call inside the final part of the try..finally construct, as shown in CodeDlg.iss. Not invoking Hide will cause the wizard to constantly get stuck on the progress page.
However, I could not understand how to implement progress on the elements in the [Run] section without doing this.