Inno Setup卸载进度条更改事件 [英] Inno Setup uninstall progress bar change event

查看:201
本文介绍了Inno Setup卸载进度条更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Inno Setup的卸载"表单中,是否有事件/功能(如CurInstallProgressChanged的进度栏带有CurProgressMaxProgress值)?

Is there any event/function like CurInstallProgressChanged for progressbar with CurProgress and MaxProgress values in Uninstall form in Inno Setup?

推荐答案

对此没有本地支持.

您可以做的是设置一个计时器,并观察UninstallProgressForm.ProgressBar.Position中的变化.

What you can do is to setup a timer and watch for changes in the UninstallProgressForm.ProgressBar.Position.

代码可能像这样:

[Code]

procedure TimerProc(h: LongWord; AMsg: LongWord; IdEvent: LongWord; dwTime: LongWord);
begin
  Log(Format(
    'Uninstall progress: %d/%d',
    [UninstallProgressForm.ProgressBar.Position, UninstallProgressForm.ProgressBar.Max]));
end;

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord;
  lpTimerFunc: LongWord): LongWord;
  external 'SetTimer@user32.dll stdcall';

procedure InitializeUninstallProgressForm();
begin
  SetTimer(0, 0, 100, CreateCallback(@TimerProc)); { every 100 ms }
end;

对于 CreateCallback函数,您需要Inno设置6.

如果您对Inno Setup 5感到困惑,则可以使用在Inno Setup中加载外部DLL进行卸载过程.有关另一种解决方案(更好但更难以实现),请参见如何将卸载文件保留在卸载程序中?

If you are stuck with Inno Setup 5, you can use WrapCallback function from InnoTools InnoCallback library (the code needs Unicode version of Inno Setup 5). But using an external DLL library from an uninstaller is tricky and has its drawbacks. See (yours) Load external DLL for uninstall process in Inno Setup. For another solution (better but more complicate to implement), see How keep uninstall files inside uninstaller?

这篇关于Inno Setup卸载进度条更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆