cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
OliverTheFrog
Level 3

Change admin requirements for uninstall (from Control Panel)

I give the user the option to install either as admin or as a non-admin user, since many people installing this application would not have an admin account or password. To allow the install to run as admin or non-admin, I compiled the InstallShield project to not require admin, and then set it at run time (with runas and ShellExecute in Win32). I then added an uninstall application that checks if admin access is required for uninstalling, and then prompts the user if necessary for admin credentials before uninstalling through the regular InstallShield interface. Unfortunately, if a user decides to uninstall from the control panel (rather than the uninstall application I wrote), because the original installer does not require admin privileges, it does not ask the user for admin credentials and runs as a regular user, and so it can't successfully uninstall the whole application if access to an admin location is required.

Is there a way to tell the uninstaller that admin privileges are required, or a way to change the uninstall application launched from the control panel to point to my uninstall application? I'd prefer a solution outside of InstallShield if possible (ie. one where I can change the preferences from my own exe after the install is complete).
Labels (1)
0 Kudos
(1) Reply
OldBean
Level 5

If it is a InstallScript or InstallScript MSI project, when you uninstall your product by clicking "Remove" from Add/Remove Program, it calls OnUninstall() in your project. If you explicitly define the function and put your privilege elevation logic there, you might get yourself around the issue.
0 Kudos