PDA

View Full Version : How do I detect when admin is installing?



NewsArchive
12-17-2008, 02:25 AM
I'm not referring to a User that has Admin privileges... but in the
corporate lockdown world where users cannot install and the IT Admin has to
install....

We have to put some files in common documents that in turn will be copied
when the user first runs our app....

But do we just set our installer to always put the docs into the common
documents whether user or admin or anyone? Or do we detect the special case
when admin is installing for "all users" and only put the files in common
documents at that time?

Any best practice suggestions or "how to do this" tips?

Right now when admin installs our app does not work right for the user.

Thanks
-Tim

NewsArchive
12-17-2008, 10:24 AM
Hi Tim,

In short, software installations should always be done per-MACHINE and not
per-USER. In times of Vista/2008/Win7, per-USER installations are obsolete.

Installation applications always run elevated. An elevated process is
usually one that has been launched by someone with a Full Administrator
Token and runs with High Integrity Level Privileges (administrator execution
level privileges). If the User Account Control (UAC) feature in
Vista/2008/Win7 determines that the Current User ("Joe User", logged in as
"Standard User") does not have a token of sufficiently high Integrity Level,
the Credentials Prompt asks the user to provide a username and password of
someone who has sufficient rights. Vista/2008/Win7 will then create the
necessary token for that user and uses it to elevate the process so you can
now continue with the installation. But now comes the interesting part.
You are on a completely different profile after the elevation now. You have
switched from the "Joe User" profile to the "Admin" profile! So all
"current user" settings would go to the Admins "current user" profile, and
not to "Joe User"!!!

That's why your ("asInvoker" classified) application has to do all the
"current user" configurations, not the installation application!

When your application starts, it should detect whether the current user
configuration settings are already there. If this is not the case, you
should create the default settings from within the application. For
example, copy files from a common location to the current user location,
copy registry entries from HKEY_LOCAL_MACHINE to a current user key, etc.

If your application does not work correctly if an administrator installed
it, then you do not have a valid "Mixed User Application".

Does this help?

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner