PC Review


Reply
Thread Tools Rate Thread

Program requesting elevation cannot be launched through a button..

 
 
=?Utf-8?B?bWNocmlzdDE1Mg==?=
Guest
Posts: n/a
 
      23rd Aug 2007
....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.
 
Reply With Quote
 
 
 
 
Adrian Accinelli
Guest
Posts: n/a
 
      24th Aug 2007

"mchrist152" <(E-Mail Removed)> wrote in message
news:E31A1392-EA0B-4B3B-83BF-(E-Mail Removed)...
> ...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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Install Due to Elevation (Requires Elevation) Alx Windows Vista Installation 5 20th May 2008 10:34 PM
Elevation of Program Rights under Local User Account Corey Windows Vista Installation 0 9th Jan 2008 10:41 PM
How to differentiate between a program launched manually and launched by a windows task scheduler ??? mayur_hirpara@hotmail.com Microsoft Dot NET 3 8th Jan 2007 11:20 PM
How to differentiate between a program launched manually and launched by a windows task scheduler ??? mayur_hirpara@hotmail.com Microsoft Dot NET Framework 3 8th Jan 2007 11:17 PM
Program associations/wrong program launched fran Windows XP General 1 25th Jul 2003 12:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:02 PM.