Replace or customize modal uninstallation windows in Inno Setup

故事扮演 提交于 2020-06-05 05:41:22

问题


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


回答1:


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

What you can do:

  • Change message texts:

    [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?
    
  • 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.

    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;
    
  • 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.

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




回答2:


If you want to create custom pages in Uninstaller then No.

Uninstaller does NOT support creating custom pages.



来源:https://stackoverflow.com/questions/37023764/replace-or-customize-modal-uninstallation-windows-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!