Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Vista » microsoft.public.windows.vista.installation_setup
Thread: App blocked by UAC

HTVi
TV Discussion Newsgroups

App blocked by UAC
Najash 7/4/2007 7:56:02 PM
hi, we developed an application and want it to run on Vista, but crashes
whenever UAC is on.

The error comes only When our App. trys to upgrate from trial to full Version.

When the App. is launched, UAC guesses that there is no need for "full
administrator access token" and that is correct according to the new Vista
architecture, but when our App. presents a form to registy the full version,
the user
doesn't have the administrator token, because the App was already launched
as a Standar User App. (even if it is an Administrator)

We think that providing a manifest file with the "requireAdministrator" is
not the solution because we want standard users to be able to access our App.

Instead we want to present a Message saying "You need to run this App. as an
Administrator" when this error occurs. In order to do this, we want to know
if there is a way to know the User Access token, or if there's a recommended
way to do this.

Thanks, Najash
Re: App blocked by UAC
"Andrew McLaren" <andrew[ at ]fakeaddress.com> 7/4/2007 9:18:48 PM
Hi Najash

To find out if the user is a standard user, you could call:

OpenProcessToken(GetCurrentProcess(), … )

then ...

GetTokenInformation( … TokenElevationType… );

then, if TokenElevationType is TokenElevationTypeDefault or
TokenElevationTypeLimited, you have a standard user.

There are probably other ways to do it, as well :)

Once you know the user is a standard user, you could either:
1) display a message to restart the app as Administrator; or
2) create a separate process which has requireAdministrator in its manifest,
to perform the upgrade (and possibly close the existing, standard user
process).

The other "workaround" would be to use MSI to make the changes, with the
user running as a Standard User.

Have you seen the ISV Vista cookbook, from Microsoft?:
http://sharepoint.microsoft.com/innovateon/vistadeveloper/Developer%20Documents/ISV%20Windows%20Vista%20Compatibility%20Cookbook.doc
Pages 6 and 7 describe this last option a bit more.

Other folks may have better ideas. Hope this helps a bit,

Andrew

Re: App blocked by UAC
Najash 7/4/2007 9:46:01 PM
Excellent!, Thanks again Andrew.

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen