NSIS - Desktop Shortcut For All Users
Asked Answered
B

2

8

How can I create desktop shortcuts for all user while installing a package?

Brewmaster answered 21/9, 2011 at 14:5 Comment(1)
This usually means only the admin can delete your shortcut, uncool!Chromatography
C
11

NSIS supports several of the common/shared special folders:

SetShellVarContext all
CreateShortcut "$desktop\myapp.lnk" "$instdir\myapp.exe"

This code assumes you are elevated...

Chromatography answered 11/7, 2012 at 4:7 Comment(2)
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).Lotti
In MUI2, you have to !insertmacro MUI_STARTMENU_WRITE_BEGIN Application to set $SMPROGRAMS. When you are done _ENDForeignborn
E
2

With !include NTProfiles.nsh [1] you can create a shortcut in the folder "${ProfilePathAllUsers}\Desktop".

[1] - http://nsis.sourceforge.net/NT_Profile_Paths

Epicene answered 21/9, 2011 at 14:9 Comment(2)
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..Brewmaster
This code uses undocumented registry values! NSIS has native support for the shared desktop folder so this kind of thing is not required nor recommended!Chromatography

© 2022 - 2024 — McMap. All rights reserved.