替换或自定义Inno Setup中的模态卸载窗口。

问题描述 投票:3回答:2

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

enter image description here

enter image description here

installer inno-setup uninstaller modal-window
2个回答
2
投票

除了无声(或非常无声)卸载外,这两个消息总是显示。

你可以做什么

  • 改变信息文本。

    [Message]
    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 注册表密钥。 另见 我可以禁用卸载确认信息吗?

    虽然这有点像黑客,你最好只在有充分理由的情况下才这么做。

    并且可以选择通过实现你的自定义消息对话框来实现 InitializeUninstallCurUninstallStepChanged(usDone),比如。

    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来完成卸载,就不能用了。

  • 你也可以实现一些DLL,观察新的消息框,并在它们出现时更新提交。


2
投票

如果你想在Uninstaller中创建自定义页面,那么不可以。

Uninstaller不支持创建自定义页面。

© www.soinside.com 2019 - 2024. All rights reserved.