cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sammathew
Level 4

Run as Admin only in OnFirstUIAfter

Hi All,

I am using InstallShield 2008 and its a InstallScript Project.Till now are Products get Install only in the Administrator mode.But are Customers requested us to make are product Install in the Standard mode allso.

Is there a way that I can Install my Product with irrespective of what ever mode it may be?.

I am aware that to access the registry,to register the dll's we need Administrator rights,so all the process which requires the Administrator rights I am handling it in the OnFirstUIAfter.

Is there is a way that I can Prompt the user to type the admin Password when the OnFirstUIAfter process Starts?.

I went through the help which told me to change the Settings in Releases under Media you will find a tab called Setup.exe in which Required Execution Level should be "Invoker" .

I tried the above step which resulted like ,it didnt ask me "Allow or Cancel" when you double click the Setup.exe even though ,if the UAC is turned on.That was a good result ,but still at one point I need the Administrator rights.

Perfect example is when u try Installing the "Google Chrome Browser" at one point it will ask for Admin password and proceed with the Installation.

I hope people who work on this will help me out and give there Idea's.

My advance thanks to All !
Labels (1)
0 Kudos
1 Reply
MichaelU
Level 12 Flexeran
Level 12 Flexeran

InstallScript projects do not offer any direct way to elevate in the middle of an installation. If you are trying to emulate the Windows Installer experience of elevating after clicking the Install button, the easiest way to do this (short of moving to MSI) will probably be to create two separate setups. The outer will run as invoker, and provide the UI and feature selection. The inner will run, probably silently or at least skipping the dialogs of OnFirstUIBefore and After, per settings passed in from the outer, and must be launched using shell execute (either with verb "runas" or on an "Require Administrator" setup) e.g. with LaunchApplication.

If you're really sneaky, you can probably combine the two into a single setup and have it change its behavior depending on whether it's currently got the necessary privileges. Be careful to account for the case where someone is running as full administrator when they initially launch the setup, though, otherwise things could get really messy.
0 Kudos