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/inno...Cookbook.d oc
Pages 6 and 7 describe this last option a bit more.
Other folks may have better ideas. Hope this helps a bit,
Andrew