seenorth
seenorth

Reputation: 27

How to create a start menu shortcut in NSIS in Windows 11?

I'm looking for a way to add a shortcut of my program to the Windows 11 start menu using NSIS. The previously recommended way seems to not work anymore in Windows 11.

Section /o "Start Menu Shortcut"
CreateShortcut "$SMPROGRAMS\${APPNAME}.lnk" "$INSTDIR\${APPNAME}.exe" "" "$INSTDIR\${ICON}"
SectionEnd

This only creates a new shortcut file in the "AppData\Roaming\Microsoft\Windows\Start Menu\Programs" directory. However the shortcut does not automatically appear in the start menu.

Upvotes: 0

Views: 516

Answers (2)

Igor
Igor

Reputation: 1

Try this one:

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "$autostartApplicationName" "$INSTDIR\$desktopAppName"

Do not forget to add this code to "uninstall" section:

DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "$autostartApplicationName"

Upvotes: 0

Anders
Anders

Reputation: 101606

The Start Menu in Windows 11 displays only pinned applications in the initial view. There is no documented way for you to pin your own application. It may appear in the recommended section the first time the application is installed, you don't have any control over this.

The user can pin your application by opening the Start Menu and clicking on "All apps" or search for you application, and then pin it...

Upvotes: 1

Related Questions