【问题标题】:SetProgress of Inno Setup TOutputProgressWizardPage doesn't update the bar immediatellyInno Setup TOutputProgressWizardPage 的 SetProgress 不会立即更新栏
【发布时间】:2021-11-29 13:16:31
【问题描述】:

我正在使用 Inno Setup 并创建了一个进度页面,设置进度条值并提取文件:

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;

但是当我开始安装时,该栏是 0,当文件开始提取时。 bar应该如何设置为50?

【问题讨论】:

    标签: progress-bar inno-setup pascalscript


    【解决方案1】:

    从 Windows Vista 开始,设置进度条位置会启动一个将进度条移动到所需位置的简短动画。但由于应用程序(安装程序)在ExtractTemporaryFile 期间冻结,动画不会发生。

    有一个技巧可以避免动画。只需将位置设置得高一点并将其移回即可。在没有动画的情况下将位置向后移动。
    Disabling .NET progressbar animation when changing value?

    而且你只需要在TOutputProgressWizardPage.Show之后设置位置。

    ProgressPage.Show();
    ProgressPage.SetProgress(51, 100);
    ProgressPage.SetProgress(50, 100);
    

    一个相关问题:
    Inno Setup - Installation progress bar does not reach 100%

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-08
      • 1970-01-01
      • 2012-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-10
      • 1970-01-01
      相关资源
      最近更新 更多