cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Shuttledude
Level 7

OnUninstall not invoked from Add/Remove Programs?

I want to execute some InstallScript code in an InstallScript MSI application when, and only when, the user uninstalls the application from within Add/Remove Programs. I thought the UnInstall() function, found in the Miscellaneous section, would do this. But when I uninstall my application via Add/Remove Programs, function UnInstall() does not seem to be invoked! I put in a messagebox just as a test, and never saw the messagebox.

Is there another function I can use? OnMaintUIAfter is not appropriate, because it might be a MODIFY or REPAIR type install, not an uninstall. OnEnd is not appropriate because that function is always invoked (installing + uninstalling).

Any ideas?
Labels (1)
0 Kudos
(2) Replies
Shuttledude
Level 7

Guess I'm not awake yet today. 😮

Function OnMaintUIAfter( ) can be used for this, by testing REMOVEALLMODE:

   
if REMOVEALLMODE!=0 then
MessageBox("This code runs only when ininstalling.", INFORMATION);
endif;


However, I still maintain it's a little misleading that a built-in function named OnUninstall( ) is not executed when you uninstall! :rolleyes:
0 Kudos
chrishein
Level 2

OnUninstall only gets called when using the -uninst parameter to setup.exe.
0 Kudos