PDA

View Full Version : Prompt UAC after OnFirstUIBefore



sammathew
11-20-2008, 12:23 AM
Hello All,

I am Using InstallScript Project(InstallShield 2008).

Our Product requires Administrative privileges in order to put the registry entries and allso to register the COM dll's.All these have been handled in OnFirstUIAfter.

Is there a way to Prompt the UAC after OnFirstUIBefore because we dont want to prompt UAC to the user in OnFirstUIBefore.

I had tried all the three options in the Required Execution Level but still none as given me the result that i expect.

I know that when we create the build the manifest is embedded as a resource in Setup.exe.Is there a way to change the resource file at the run time if so how to do that.

Or is there any other way that it can be achieved.

My Advance thanks.

Holger_G
11-20-2008, 09:35 AM
Your installation requires administrative privileges during a first time installation (especially during OnFirstUIAfter event). But you want to raise the UAC prompt firstly after OnFirstUIAfter and for a first time installation only?

MichaelU
11-20-2008, 12:34 PM
InstallScript itself doesn't support this kind of elevation natively. However you might be able to simulate it by using a ShellExecute with verb "runas" to launch the setup from a wrapper setup. If you're really tricky, you can probably make these both with the same setup, but in the wrapper non-admin mode it would have to avoid installing things. I forget when we introduced the LaunchApplication API (either IS2008 or IS2009), which supports using ShellExecute; if it's available, use it; if not, there are samples around showing how to get to ShellExecute directly.