Tereami
Posts: 2
Joined: Thu Jan 08, 2026 11:09 pm

Custom Uninstall Message

Currently, when I uninstall an installed program (that I built with Advance Installer) through the Control Panel, the uninstallation occurs immediately. If I uninstall it using the uninstall shortcut, only the standard message "Are you sure you want to uninstall?" appears. But I need to provide a custom message to the user before uninstalling - for example, asking for feedback, etc.

I tried using VerifyRemoveDlg, but it only appears when "Override Windows Installer - Modify" is enabled, and this dialog doesn't appear when uninstalling via the shortcut. I need a Message Box to appear during uninstallation, regardless of method.

The message box window should have OK and Cancel buttons. OK continues the uninstallation. Cancel cancels the uninstallation. The window displays my custom text.

As far as I understand, I need to use a Custom Action - MessageBox. But I don't understand how to enable it before the uninstallation process begins. Please help.

Also I'll be happy to know how to make the Message text localizable for different languages. Thanks in advance.
Tereami
Posts: 2
Joined: Thu Jan 08, 2026 11:09 pm

Re: Custom Uninstall Message

I managed to found a solution. I used a custom action with inline VBScript.

Go to Custom actions - Add Custom Action - Search Predifined Custom Actions - write "Execute inline script code" - "Add with sequence".
Drag the icon "ExecuteScriptCode" before the point "Searches" in the "Installation Sequence" panel.
Click at the "ExecuteScriptCode" line to show its settings. Set:
- ActionData: your custom title, for example "Uninstall_warning"
- Script type: Visual basic script
- Execution time: Immediately
- Execution stage condition: uncheck "Install" and "Maintenance"
- Condition: REMOVE="ALL"
Script:

Code: Select all

MsgText = "Saved projects will be deleted. Save your files before continuing."
If Language = 1031 Then 
    MsgText = "Gespeicherte Projekte werden gelöscht."
End If

Result = MsgBox(MsgText, vbOKCancel + vbExclamation, "Uninstall")

If Result = 2 Then 
    Session.Property("STOP_INSTALL") = "1"
    Err.Raise 1602
End If
Maybe later I'll try to use Dictionaries instead of "If Language". And also AdvancedInstaller says that VBScript is deprecated, so it would be better to rewrite the script with JavaScript (unfortunately I know only VB).
But I'm already happy. Everything works exactly as I want.
installer1.png
installer1.png (51.35 KiB) Viewed 803 times
installer2.png
installer2.png (10.44 KiB) Viewed 803 times
Catalin
Posts: 7606
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Uninstall Message

Hello and welcome to our forums,

I am glad you managed to find a solution for this.

And thank you for sharing the solution with us - I am sure further users facing a similar scenario will find this useful. :D

The only thing I would like to mention here is the fact that VBScript has been deprecated and therefore it's not really advised to use it as some systems might have it disabled.

VBScript deprecation: Timelines and next steps

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”