Jump to content


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.
Photo

Prohibiting Uninstall


4 replies to this topic

installme

installme
  • Members
  • 2 posts

Posted 02 January 2006 - 14:27

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,
biggrin.gif

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 January 2006 - 18:30

MessageBox(...);
abort;

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

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;

user posted image

installme

installme
  • Members
  • 2 posts

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!

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.


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

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.
user posted image