Inno Setup - prevents file extraction from the installation bar up to 100%

On the Inno Setup wpInstalling how can I prevent the initial extraction of files, as defined in the [Files] section, from setting the execution bar to (almost) 100%?

enter image description here

My installation script basically consists of installing several third-party installation files from the [Run] section. Example below:

 [Run] Filename: "{tmp}\vcredist_x86-2010-sp1.exe"; Parameters: "/q /norestart"; Check: InstallVCRedist; BeforeInstall: UpdateProgress(10, 'Installing Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219...'); Filename: "{tmp}\openfire_3_8_1.exe"; Check: InstallOpenFire; BeforeInstall: UpdateProgress(25, 'Installing OpenFire 3.8.1...'); Filename: "{tmp}\postgresql-8.4.16-2-windows.exe"; Parameters: "--mode unattended --unattendedmodeui none --datadir ""{commonappdata}\PostgreSQL\8.4\data"" --install_runtimes 0"; Check: InstallPostgreSQL; BeforeInstall: UpdateProgress(35, 'Installing PostgreSQL 8.4...'); AfterInstall: UpdateProgress(50, 'Setting up database...'); 

Installing these third-party components takes longer than any other part of the installation (of course), but unfortunately the progress bar goes from 0% to 100% the first time you extract these files. Then I can reset the progress bar to select the size by selecting the following procedure:

 procedure UpdateProgress(Position: Integer; StatusMsg: String); begin WizardForm.StatusLabel.Caption := StatusMsg; WizardForm.ProgressGauge.Position := Position * WizardForm.ProgressGauge.Max div 100; end; 

Ideally, however, I would prefer that the initial extraction instead starts at 0-10% (approximate), as this more accurately reflects what is actually happening.

Is there any event to capture the progress of file extraction or, alternatively, a way to prevent or block file extraction from updating the progress bar?

+2
inno-setup
source share
1 answer

You should increase WizardForm.ProgressGauge.Max .

But, unfortunately, there is no event that occurs after the Inno Setup sets its initial maximum.

You can abuse the BeforeInstall parameter of the first installed file.

And then in the [Run] section, use AfterInstall for AfterInstall in the panel.

This extends my answer to Inno Setup: How do I control the progress bar in the Run section?

 [Files] Source: "vcredist_x86-2010-sp1.exe"; DestDir: "{tmp}"; BeforeInstall: SetProgressMax(10) Source: "openfire_3_8_1.exe"; DestDir: "{tmp}"; [Run] Filename: "{tmp}\vcredist_x86-2010-sp1.exe"; AfterInstall: UpdateProgress(55); Filename: "{tmp}\openfire_3_8_1.exe"; AfterInstall: UpdateProgress(100); 
 [Code] procedure SetProgressMax(Ratio: Integer); begin WizardForm.ProgressGauge.Max := WizardForm.ProgressGauge.Max * Ratio; end; procedure UpdateProgress(Position: Integer); begin WizardForm.ProgressGauge.Position := Position * WizardForm.ProgressGauge.Max div 100; end; 
+2
source share

All Articles