How can i display a message box and exit while a user trying to uninstall my software which is installed by admin.
Thanx in advance
Regards,
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Prohibiting Uninstall
Started by
installme
, Jan 02 2006 14:27
4 replies to this topic
Posted 02 January 2006 - 18:30
MessageBox(...);
abort;
abort;
Stefan Krüger
InstallSite.org twitter facebook
Posted 02 January 2006 - 18:38
In the OnMaintUIBefore event, you would add code along the lines of the following:
CODE |
NUMBER nResult; // Require that the user has Administrative privileges nResult = Is(USER_ADMINISTRATOR, ""); if (nResult = FALSE) then MessageBox("The uninstall requires an account with Administrative privileges and cannot continue.", INFORMATION); abort(); endif; |
Posted 03 January 2006 - 06:01
This thing is working.But not in proper way!!!! It is actually displaying message after the uninstallation started(1% completed) and when i clicked yes for the messagebox the progress bar is running to 37% before quitting.
Thanks for your help!
Thanks for your help!
CODE |
function OnMaintUIAfter() STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; NUMBER bOpt1, bOpt2; NUMBER nResult; begin // Require that the user has Administrative privileges nResult = Is(USER_ADMINISTRATOR, ""); if (nResult = FALSE) then MessageBox("The uninstall requires an account with Administrative privileges and cannot continue.", INFORMATION); abort; endif; |
Edited by installme, 03 January 2006 - 06:01.
Posted 03 January 2006 - 14:46
I didn't say the OnMaintUIAfter event, I said the OnMaintUIBefore event. As you can see there's a big difference between the two.