运行部分的Inno Setup简单进度页面 [英] Inno Setup Simple progress page for Run section
问题描述
我的安装程序非常简单,基本上是:
My installer is very simple, it basically is:
- 欢迎页面
- 进度页
- 最终页面
欢迎"页面和最终"页面是标准页面(仅一个按钮). 在进度"页面上,我正在静默安装其他程序.
The Welcome and Final pages are standard (just one button). At the Progress page I'm installing a bunch of other programs silently.
实际脚本是在[[Run]部分中安装每个程序.
问题是,酒吧达到100%,然后停留在那里.
我只能更改消息文本.
The actual script is installing each program inside the `[Run] section.
The problem is that the bar reaches 100% and then stays there.
I'm only able to change the message text.
我想实现的是使用Pascal Script展示进度(因为它可能使我具有更大的灵活性),例如:
What I would like to achieve is to show the progress using Pascal Script (as it may allow me to have more flexibility), something like:
procedure InitializeWizard;
begin
ProgressPage.SetProgress(1, 100);
exec(.......)
ProgressPage.SetProgress(15, 100);
exec(.......)
ProgressPage.SetProgress(40, 100);
...
...
end;
这样,我可以显示更准确的进度条.这就是我所拥有的(模拟安装.取自示例):
That way I can show a more accurate progress bar. This is what I have (simulating installation. Taken from an example):
[Code]
var
ProgressPage: TOutputProgressWizardPage;
procedure InitializeWizard;
begin
ProgressPage := CreateOutputProgressPage('My App','');
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
I: Integer;
begin
if CurPageID = wpWelcome then begin
ProgressPage.SetText('Starting installation...', '');
ProgressPage.SetProgress(0, 0);
ProgressPage.Show;
try
for I := 0 to 10 do begin
ProgressPage.SetProgress(I, 10);
Sleep(100);
end;
finally
ProgressPage.Hide;
end;
end else
Result := True;
end;
问题是,当我构建安装程序时,它没有显示欢迎"页面(安装程序正在运行,但未显示任何内容).
The problem is that when I build the installer it doesn't show the Welcome page (the installer is running, but nothing is shown).
我做错了什么?
提前谢谢!
推荐答案
找到了!
我不见了:
-
Result := True;
-
if CurPageID = wpReady
(而不是wpWelcome
)
ProgressPage.Hide;
之后的Result := True;
afterProgressPage.Hide;
if CurPageID = wpReady
(Instead ofwpWelcome
)
那解决了问题!
这篇关于运行部分的Inno Setup简单进度页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!