I am using Inno Setup and I have created a progress page, set progress bar value and extract file:
ProgressPage := CreateOutputProgressPage('Preparing installations', '');
ProgressPage.SetProgress(50, 100);
ProgressPage.Show();
try
ProgressPage.Msg1Label.Caption := 'preparation ....';
ExtractTemporaryFile(C_Myfile);
ProgressPage.SetProgress(100, 100);
finally
ProgressPage.Hide();
end;
But when I start the installation the bar is on 0, when the file start extraction. How should the bar be set to 50?
Since Windows Vista, setting progress bar position starts a brief animation that moves the bar to the desired position. But as the application (the installer) freezes during the ExtractTemporaryFile
, the animation does not happen.
There's a trick that avoids the animation. Just set the position little higher and move it back. Moving the position back happens without animation.
See Disabling .NET progressbar animation when changing value?
And you need to set the position only after TOutputProgressWizardPage.Show
.
ProgressPage.Show();
ProgressPage.SetProgress(51, 100);
ProgressPage.SetProgress(50, 100);
A related question:
Inno Setup installation progress bar does not reach 100%