canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Vista, CA: Elevation prompt in background

Hello everyone.

At installation I need to run an executable which is configured (via manifest) to run elevated on Vista. Executing the executable via WScript.Shell.Run() leads to the elevation prompt (if run as administrator) to be in the background. (The problem with that is that the user may not notice it there and in the worst case decide that the application installer might be broken and to cancel the installation.)

Is there a way to run this executable with the elevation prompt in the foregound?



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Vista, CA: Elevation prompt in background

Hi Clemens,

There is a similar discussion on the forum, please take a look:
http://www.advancedinstaller.com/forums ... f=2&t=4675

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Vista, CA: Elevation prompt in background

cosmin wrote:There is a similar discussion on the forum, please take a look:
http://www.advancedinstaller.com/forums ... f=2&t=4675
Hi cosmin,

that discussion does not concern itself with elevation prompts. As I understand from reading http://msdn.microsoft.com/en-us/library ... ac_topic6c ("Requirements for Administrator Applications", "Use the HWND Property to be acknowledged as a Foreground Application") elevation prompts always automatically end up in the background (and blinking on the taskbar) if no hwnd is passed to ShellExecute(Ex).

(Here someone suggests to use GetForegroundWindow to get a valid/usable hwnd: http://forums.microsoft.com/MSDN/ShowPo ... 1&SiteID=1)

Maybe the mechanisms in AI (viewer.exe, CreateEXEProcess) could support passing hwnd, that way allowing getting the elevation prompt in the foreground for improved user experience.



With best regards

Clemens Anhuth

Return to “Common Problems”