Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
580 views
in Technique[技术] by (71.8m points)

installation - Replace or customize modal uninstallation windows in Inno Setup

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

enter image description here

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

What you can do:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...