Question

I wrote a free utility that changes system settings. Some users mistakenly think that they can undo the changes simply by uninstalling the utility. When they try to uninstall, I want to show them a message telling them that they have to use the utility in order to undo the changes, and give them a choice of continuing or canceling the uninstall. How do I do this? I am using InstallShield LE with Visual Studio 2010.

Was it helpful?

Solution

The usual approach is using an uninstall custom action. It can prompt the user and return 0 to continue or 1602 to cancel.

This custom action needs to be a win32 DLL which receives the installation handle. An EXE or .NET custom action can return only 0 for success or any other value for a fatal error (no user exit support).

Unfortunately InstallShield LE doesn't support DLL custom actions (it requires a paid version). So a solution is to use a different setup tool which offers more control over custom actions: http://en.wikipedia.org/wiki/List_of_installation_software

Another solution is to manually add the custom action in your MSI by editing it with Orca.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top