View Single Post
Old 27th February 2007, 00:53   #1
Junior Member
Join Date: Feb 2007
Posts: 1
Vista - Cannot copy files to non-admin user's Desktop/Pictures

Hello all,

My installer copies some files to the "$DESKTOP" and "$PICTURES" folder of the current user. I have tested it with Window XP and it works fine for admin and non-admin users. However, it does not work correctly with Vista. No matter which user I am logged in as, the files are always copied into the administrator's folders as opposed to the current user's folders.

I have tried running the "UserInfo.exe" example (that comes with the NSIS installation) as a non-admin user and noticed that UserInfo::GetName and UserInfo::GetAccountType always return the information of the Administrator user whose password was used to authorized the installation. Is this an OS bug? Can I do something to fix this?

I am using the "RequestExecutionLevel admin" command to avoid getting the warning message after the vista installation. Also, I have tried using the "SetShellVarContext current" command just before calling "$PICTURES" but it didnt work as expected.

Any help will be appreciated.
marucosuz is offline   Reply With Quote