krishnachovdry
4th August 2010 16:03 UTC
Install by admin for other users
Hi all,
I was developing a Windows installer using NSIS. The application will be installed by administrator for any selected user in the system. Username will be entered by admin in a custom page. How can i do this using NSIS.
I tried SetShellVarContext command, but using that we can install for all/current user. My requirement is, application should be installed for a specific user.
Can someone help me on this.
MSG
4th August 2010 18:17 UTC
What you want is to find the selected user's shell folders, so you can put files there (such as shortcuts in start menu). Unfortunately, in Microsoft Windows this is rather impossible if the selected user is not logged on to the system. You *can* use the GetUserShellFolderFromRegistry function, but this is a very ugly workaround and I can guarantee you that it will not always work. It most certainly won't work on a fresh installation of Windows, for instance.
What you want is not possible in Windows, because Windows is not designed to be used in this way. If you want to make a Windows installer, I suggest you only do what Windows was designed for. And that is: Admin-level installs install for all users, and user-level installs install for this user.