Archive: All User script


All User script
I am a brand new user to NSIS. Love it.

1. I am having somewhat of a problem. I have created a simple install script using the HMNIS editor. It works great but only for the currently logged on user. How do I set it to work for All Users of the machine?

2. Is there any way to set the Start in Directory of the created shortcuts?

Remember, I am a real novice at this. Please help.

Thanks


SetContextVar it's your friend :)


AllUser

Originally posted by Lobo Lunar
SetContextVar it's your friend :)
I am a non-programmer and don't understand what you mean here. Could you give me some more details?

Thank You

I read again your question. I thought you were talking about installation. Sorry...
Let's start again... about the users.... you must have enable "all users" to do this....must be apply for the currently user of your NT machine...
About the shortcut... I don't understand the Is there any way to set the Start in Directory of the created shortcuts
Do you ment open the folder where the shorcuts were created? If so check the ShellExec instructions of the manual...
HIH (Hope it helps)!!!


Originally posted by Lobo Lunar
I read again your question. I thought you were talking about installation. Sorry...
Let's start again... about the users.... you must have enable "all users" to do this....must be apply for the currently user of your NT machine...
About the shortcut... I don't understand the Is there any way to set the Start in Directory of the created shortcuts
Do you ment open the folder where the shorcuts were created? If so check the ShellExec instructions of the manual...
HIH (Hope it helps)!!!
Thank you for your patience with me. One more time. I want to be able to do this easily if possible using the script editor. I have created a script that does the install but only puts the shortcuts on the current users desktop.

I don't know what you mean by "enable all users to do this." Where do I do this? When I run the install program I want the user to be able to answer whether he wants this to be installed for just the current user or all users. Can you be more specific?

Thank you again.

SetShellVarContext:

Sets the context of $SMPROGRAMS and other shell folders. If set to 'current' (the default), the current user's shell folders are used. If set to 'all', the 'all users' shell folder is used. The all users folder may not be supported on all OSes.
You can use it to tell NSIS to put the shortcut on the all users' desktop instead of just on the current user's desktop.

For example:
SetShellVarContext all
CreateShortcut $DESKTOP\MyProg.lnk $INSTDIR\MyProg.exe


If you want to give the user an option you can create an InstallOptions page to get the user's input. See Examples\Modern UI\InstallOptions.nsi for an example and Contrib\InstallOptions\Readme.html for the documentation.

To set the working directory of shortcuts use SetOutPath. For example:
SetOutPath "C:\working\directory\for\the\shortcut"
CreateShortcut $DESKTOP\MyProg.lnk $INSTDIR\MyProg.exe

Originally posted by kichik
SetShellVarContext:You can use it to tell NSIS to put the shortcut on the all users' desktop instead of just on the current user's desktop.

For example:
SetShellVarContext all
CreateShortcut $DESKTOP\MyProg.lnk $INSTDIR\MyProg.exe


If you want to give the user an option you can create an InstallOptions page to get the user's input. See Examples\Modern UI\InstallOptions.nsi for an example and Contrib\InstallOptions\Readme.html for the documentation.

To set the working directory of shortcuts use SetOutPath. For example:
SetOutPath "C:\working\directory\for\the\shortcut"
CreateShortcut $DESKTOP\MyProg.lnk $INSTDIR\MyProg.exe
Thank You! This is just what I needed. Consider yourself a savior of a neophyte!!