How can I create desktop shortcuts for all user while installing a package?
Asked
Active
Viewed 1.3k times
2 Answers
10
NSIS supports several of the common/shared special folders:
SetShellVarContext all
CreateShortcut "$desktop\myapp.lnk" "$instdir\myapp.exe"
This code assumes you are elevated...
-
This works for me on Windows 10. However, it doesn't seem to do the trick for a similar shortcut in the 'start programs' folder (`$SMPROGRAMS`). – florisla Jun 06 '16 at 11:59
-
In MUI2, you have to `!insertmacro MUI_STARTMENU_WRITE_BEGIN Application` to set $SMPROGRAMS. When you are done `_END` – rickfoosusa Mar 15 '21 at 18:32
2
With !include NTProfiles.nsh
[1] you can create a shortcut in the folder "${ProfilePathAllUsers}\Desktop"
.

robert
- 3,484
- 3
- 29
- 38
-
Hi Robert.. Thanks for the solution.. but it seems to b not working in my package maker 1.1.. Is there any constraints bcoz of version.? I adden NTProfiles.nsh in Include Folder and given the path as u mentioned... Thanks.. – vijay Sep 22 '11 at 07:01
-
1This code uses undocumented registry values! NSIS has native support for the shared desktop folder so this kind of thing is not required nor recommended! – Anders Jul 11 '12 at 04:09