Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > UAC prompt for some app only

Reply
Thread Tools Display Modes

UAC prompt for some app only

 
 
kpg
Guest
Posts: n/a

 
      09-22-2008
Hi all,

Trying to get my vb6 app to run on vista.

The program has an option to get an update. When the user clicks the
update button I shell to antoher program that downloads the update.

Here's the problem:

The main program runs without the UAC prompt for elevation, but the update
program does get the propmt - no big deal, except when I try to shell to
the update program from the main program it does not launch and the
extended error message is: requested operation requires elevation.

So I wrote a samll test program that all it does is shell to the update
program. When I run the test app I get no UAC prompt, and when I shell
from it I get the UAC prompt and the update program runs!

So I have a few questions/issues:

1. Why does vista allow my main and shelltest program run without UAC
prompting but my update program does propmt?

What is is about some programs that vista think don't need to be elevated
but other that it obviously think need to be elevated? How does it
determine that?

2. Why would my testshell app be able to launch the update program but my
main cannot? My main program is much larger than the testsehll, but
functionally for the purpose of shelling to the update they are the same.
shelling to update form main should cause vista to show the UAC prompt and
allow the program to be run - but it does not, it just fails with the error
elevation required.

Normally I use createprocess to shell, but I also tried shellexecute and
the native vb6 shell. All three work fine in my testshell app, but none
work in main.

Here's another twist: If is disable UAC everything works fine, main can
shell to update. So I lnow this is a UAC issue.

In summary - I don't mind UAC prompting when I try to shell to update, but
form main the shell fails but in a samll test program it succeeds. Turning
off UAC allows main to shell, Very strange.



 
Reply With Quote
 
 
 
 
Jon
Guest
Posts: n/a

 
      09-22-2008
Couple of comments ...

1. Certain keywords contained within a filename can trigger a UAC prompt
irrespective of other considerations eg install.exe, setup.exe, or perhaps
in your case update.exe. If your update file is similarly named and there's
no apparent need for elevation you could try renaming it.

2. I can't see any reason why things would work differently in a large main
app to a smaller app, other than a coding difference, but you can usually
force a UAC prompt, if required, by using a "runas" flag with ShellExecute
(one of the arguments to the method).

--
Jon


"kpg" <> wrote in message
news:Xns9B216F261E95ipostthereforeiam@207.46.248.1 6...
> Hi all,
>
> Trying to get my vb6 app to run on vista.
>
> The program has an option to get an update. When the user clicks the
> update button I shell to antoher program that downloads the update.
>
> Here's the problem:
>
> The main program runs without the UAC prompt for elevation, but the update
> program does get the propmt - no big deal, except when I try to shell to
> the update program from the main program it does not launch and the
> extended error message is: requested operation requires elevation.
>
> So I wrote a samll test program that all it does is shell to the update
> program. When I run the test app I get no UAC prompt, and when I shell
> from it I get the UAC prompt and the update program runs!
>
> So I have a few questions/issues:
>
> 1. Why does vista allow my main and shelltest program run without UAC
> prompting but my update program does propmt?
>
> What is is about some programs that vista think don't need to be elevated
> but other that it obviously think need to be elevated? How does it
> determine that?
>
> 2. Why would my testshell app be able to launch the update program but my
> main cannot? My main program is much larger than the testsehll, but
> functionally for the purpose of shelling to the update they are the same.
> shelling to update form main should cause vista to show the UAC prompt and
> allow the program to be run - but it does not, it just fails with the
> error
> elevation required.
>
> Normally I use createprocess to shell, but I also tried shellexecute and
> the native vb6 shell. All three work fine in my testshell app, but none
> work in main.
>
> Here's another twist: If is disable UAC everything works fine, main can
> shell to update. So I lnow this is a UAC issue.
>
> In summary - I don't mind UAC prompting when I try to shell to update, but
> form main the shell fails but in a samll test program it succeeds.
> Turning
> off UAC allows main to shell, Very strange.
>
>
>


 
Reply With Quote
 
kpg
Guest
Posts: n/a

 
      09-22-2008
"Jon" <> wrote in
news::

> Couple of comments ...
>
> 1. Certain keywords contained within a filename can trigger a UAC
> prompt irrespective of other considerations eg install.exe, setup.exe,
> or perhaps in your case update.exe. If your update file is similarly
> named and there's no apparent need for elevation you could try
> renaming it.
>
> 2. I can't see any reason why things would work differently in a large
> main app to a smaller app, other than a coding difference, but you can
> usually force a UAC prompt, if required, by using a "runas" flag with
> ShellExecute (one of the arguments to the method).
>


Yes - I tried shellExecuteEx with the runas verb and it did work, but not
as cleanly as I would like. My main program window normally closes as the
main program exsits - but with runas it pauses (waiting for user action) so
the update program does not show except as a flashing taskbar button.

I tried renaming my update program (which is called update2.exe) but it
still prompted. I will try to recompile it under a different name so the
meta data is changed as well.


....to be continued
 
Reply With Quote
 
Jon
Guest
Posts: n/a

 
      09-22-2008
"kpg" <> wrote in message
news:Xns9B217D7BF410Bipostthereforeiam@207.46.248. 16...
> Yes - I tried shellExecuteEx with the runas verb and it did work, but not
> as cleanly as I would like. My main program window normally closes as the
> main program exsits - but with runas it pauses (waiting for user action)
> so
> the update program does not show except as a flashing taskbar button.
>
> I tried renaming my update program (which is called update2.exe) but it
> still prompted. I will try to recompile it under a different name so the
> meta data is changed as well.
>
>
> ...to be continued




Ok, keep us updated - sorry couldn't resist ....

--
Jon



 
Reply With Quote
 
kpg
Guest
Posts: n/a

 
      09-22-2008
"Jon" <> wrote in
news::

> "kpg" <> wrote in message
> news:Xns9B217D7BF410Bipostthereforeiam@207.46.248. 16...
>> Yes - I tried shellExecuteEx with the runas verb and it did work, but
>> not as cleanly as I would like. My main program window normally
>> closes as the main program exsits - but with runas it pauses (waiting
>> for user action) so
>> the update program does not show except as a flashing taskbar button.
>>
>> I tried renaming my update program (which is called update2.exe) but
>> it still prompted. I will try to recompile it under a different name
>> so the meta data is changed as well.
>>
>>
>> ...to be continued

>
>
>
> Ok, keep us updated - sorry couldn't resist ....
>


Yes - if nothing else Vista is stimulating.

OK - recompiled as not update.exe and indeed no UAC prompt.

I'm sorry, but I find looking at a file name and deciding if it is a threat
somewhat specious.

Thanks for your help.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
DOS Prompt Here Doit2it Windows Vista General Discussion 12 03-10-2008 03:07 AM
DOS Prompt Here Doit2it Windows Vista Talk 0 02-24-2008 12:20 AM
How to get to the Dos prompt JamieSummers Windows Vista Installation 2 02-14-2008 01:21 AM
Run As doesn't prompt Brad Windows Vista General Discussion 11 11-29-2006 05:52 PM
Ah, the DOS Prompt Tom Scales Windows Vista File Management 2 07-06-2006 07:55 PM



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 47 48 49 50 51 52 53 54 55 56 57 58 59