Archive: current user vs administrator


current user vs administrator
Dear ALL:

I have a script which uses the following to set a environment variable:

WriteRegStr HKCU "Environment" "ART" "$INSTDIR\Art.exe"

but when a user "art" login to WinXP, who does not own the administrator privillege,
so this user click the setup.exe and press the right mouse to select administrator
to run this setup.exe. After it installs, the variable "ART" is set but under the
administraor account, not the current user "art". How can I solve this problem?
(same if for the shortcut problem -- the following statement

CreateShortCut "$DESKTOP\AART.lnk" "$INSTDIR\bin\AART.exe"

create a shortcut to administrator desktop, but not the current user "art" desktop!)


I think the easiest and probably the best solution all around would be checking if the user is admin and then installing for all of the users, not just the current user.


Originally posted by kichik
I think the easiest and probably the best solution all around would be checking if the user is admin and then installing for all of the users, not just the current user.
If I install to all user, how can I do for the un-install? The un-installer can take away the setting for the current user only. Is there any example script that I reference?

Thanks.

The uninstaller can take it out for all users just as the installer can put it for all users. Note that I'm not talking about putting a shortcut for every user, but putting it in a common directory. For example:

SetShellVarContext all
CreateShortcut $DESKTOP\prog.lnk $INSTDIR\prog.exe