Mere moments ago, quoth I:
> (It would theoretically be possible to compare the original and current
> usernames, but currently the original name is not visible to the
> installer itself -- and the names being the same or different doesn't
> really tell you much by itself. At best, you might have an "are you
> sure you want to run the app as user X" confirmation if they're
> different, but this is an entirely valid thing for them to want to do.)
Actually that wouldn't help anyway, even if the information were
available (which it isn't).
Here's a quick rundown of likely cases:
1. User is an admin, and is not using Run as Admin:
* The usernames are the same.
* The original user is not elevated.
* The current user is elevated.
* "runasoriginaluser" will run the app as the admin user, not elevated.
2. User is an admin, and is using Run as Admin:
* The usernames are the same.
* The original user is elevated.
* The current user is elevated.
* "runasoriginaluser" will run the app as the admin user, elevated.
3. User is an admin, and UAC is disabled:
* The usernames are the same.
* The original user is elevated.
* The current user is elevated.
* "runasoriginaluser" will run the app as the admin user, elevated.
4. User is not an admin and doesn't use Run as Admin:
* The usernames are different.
* The original user is the non-admin, not elevated.
* The current user is the admin, elevated.
* "runasoriginaluser" will run the app as the non-admin user, not
elevated.
5. User is not an admin and does use Run as Admin:
* The usernames are the same.
* The original user is the admin, elevated.
* The current user is the admin, elevated.
* "runasoriginaluser" will run the app as the admin user, elevated.
6. User A uses "run as user B" (where user B is an admin):
* The usernames are the same.
* The original user is user B, not elevated.
* The current user is user B, elevated.
* "runasoriginaluser" will run the app as user B, not elevated.
7. User A uses "run as user B" (where user B is not an admin), then UAC
elevates as user C:
* The usernames are different.
* The original user is user B, not elevated.
* The current user is user C, elevated.
* "runasoriginaluser" will run the app as user B, not elevated.
As you should see, most of these cases are indistinguishable, and none
of them are really incorrect -- it's just doing what the user explicitly
asked for.