Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista security

Vista - Program requesting elevation cannot be launched through a button..

Reply
 
Old 08-23-2007   #1 (permalink)
mchrist152


 
 

Program requesting elevation cannot be launched through a button..

....with UAC on. I have an application that requests elevation through its
manifest. When launched normally, the UAC dialog shows and accepting the
dialog allows the app to run normally. But when I assign this app to a
scanner button using Scanner&Camera in the control panel, the app does not
start when the button is pressed. It doesn't even show the elevation dialog.
If I turn off UAC the button launches the app just as one would expect. If
I create a little launcher app that does not request any elevation, whose
only purpose is to launch the previously mentioned app requesting elevation,
the app launches and runs normally after displaying the UAC dialog. Does
anybody know why a scanner button cannot launch an application that is
requesting elevation if UAC is on? Any help would be greatly appreciated.

My System SpecsSystem Spec
Old 08-24-2007   #2 (permalink)
Adrian Accinelli


 
 

Re: Program requesting elevation cannot be launched through a button..


"mchrist152" <mchrist152@discussions.microsoft.com> wrote in message
news:E31A1392-EA0B-4B3B-83BF-3800F64BE1F2@microsoft.com...
> ...with UAC on. I have an application that requests elevation through its
> manifest. When launched normally, the UAC dialog shows and accepting the
> dialog allows the app to run normally. But when I assign this app to a
> scanner button using Scanner&Camera in the control panel, the app does not
> start when the button is pressed. It doesn't even show the elevation
> dialog.
> If I turn off UAC the button launches the app just as one would expect.
> If
> I create a little launcher app that does not request any elevation, whose
> only purpose is to launch the previously mentioned app requesting
> elevation,
> the app launches and runs normally after displaying the UAC dialog. Does
> anybody know why a scanner button cannot launch an application that is
> requesting elevation if UAC is on? Any help would be greatly appreciated.


The backend code is trying to use CreateProcess instead of ShellExecute to
launch the app. This is described in various places on the net but this
link contains information on it:
http://msdn2.microsoft.com/en-us/library/aa905330.aspx

There's a nice description of how ShellExecute works and you'll see
CreateProcess is called and fails and doing so then calls into the
Application Information Service to perform the launch/prompt. With UAC
turned off CreateProcess will succeed so that's why it works in this
situation.

You should mark your app asInvoker and if you detect you need privileges
restart yourself using ShellExecute/Runas so that you will become elevated.

Sincerely,
Adrian Accinelli


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Can't Install Due to Elevation (Requires Elevation) Vista installation & setup
requesting to be added to my msgr Live Messenger
Elevation of Program Rights under Local User Account Vista installation & setup
Program button on Start Menu Gone Vista General
Requesting 64-bit CD Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46