在Inno Setup中替换或自定义模式卸载窗口 [英] Replace or customize modal uninstallation windows in Inno Setup

查看:526
本文介绍了在Inno Setup中替换或自定义模式卸载窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以用Inno Setup中的自定义模式窗口或页面替换下一个卸载模式窗口:

Is it possible to replace next uninstalling modal windows with custom modal windows or pages in Inno Setup:

推荐答案

除静默(或非常静默)卸载外,这两个消息始终显示.

Both messages are shown always, except for silent (or very silent) uninstallations.

您可以做什么:

  • 更改消息文本:

  • Change message texts:

[Messages]
ConfirmUninstall=Are you sure you want to completely remove %1 and all of its components?
UninstalledAll=%1 was successfully removed from your computer.
UninstalledMost=%1 uninstall complete.%n%nSome elements could not be removed. These can be removed manually.
UninstalledAndNeedsRestart=To complete the uninstallation of %1, your computer must be restarted.%n%nWould you like to restart now?

  • 通过添加 /SILENT命令行开关UninstallString注册表项.另请参见我可以禁用卸载确认消息吗?

  • Get rid of the messages by making the uninstaller run silently always by adding the /SILENT command-line switch to the UninstallString registry key. See also Can I disable uninstall confirmation message?

    尽管这是一个小技巧,但只有在您有充分理由的情况下才最好这样做.

    Though this is bit of a hack, and you better do it only, if you have a good reason.

    ,还可以选择通过实现 InitializeUninstall来实现自定义消息/对话框 CurUninstallStepChanged(usDone) ,例如:

    And optionally implementing your custom messages/dialogs by implementing InitializeUninstall and CurUninstallStepChanged(usDone), like:

    procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
    var
      DoneForm: TSetupForm;
    begin
      if CurUninstallStep = usDone then
      begin
        DoneForm := CreateCustomForm;
        { populate the form here... }
        DoneForm.ShowModal;
      end;
    end;
    

  • 卸载完成后,摆脱该消息的另一种方法是处理usPostUninstall事件并在其中显示您的自定义对话框.然后强行中止安装程序.但是,如果需要完成卸载,则Windows的自动重启将无法正常工作.

  • Another way to get rid of the message, when the uninstallation completes, is to handle usPostUninstall event and display your custom dialog box there. And forcefully abort the installer afterwards. But then the automatic restart of Windows, in case it's needed to complete the uninstallation, won't work.

    您还可以实现一些DLL,以监视新的消息框并在出现时对其进行更新/提交.

    You can also implement some DLL that watches for new message boxes and updates/submits them as they appear.

    这篇关于在Inno Setup中替换或自定义模式卸载窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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