简体   繁体   中英

NSIS CreateShortCut: Shortcuts order on Start menu

I am using NSIS to create an installer for one of my apps, and I am using this code to create shortcuts on the start menu:

;create start-menu items
  CreateDirectory "$SMPROGRAMS\myFolder"
  CreateShortCut "$SMPROGRAMS\myFolder\app.lnk" "$INSTDIR\app.exe" "" "$INSTDIR\app.exe" 0
  CreateShortCut "$SMPROGRAMS\myFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0

It works, but the Uninstaller shortcut on the start menu > myFolder appears before the app.exe shortcut.

Is there a way to control the order of the shortcuts?

Usually the installation order is ignored, Windows arranges them automatically. In older Windows versions the start menu has a context menu option for ordering them alphabetically, but newer versions order them automatically.

here is the CreateShorCut usage

CreateShorCut link.lnk target.file [parameters [icon.file [ icon_index_number [start_options [keyboard_shortcut [description]]]]]]

did you tryed :

CreateDirectory "$SMPROGRAMS\myFolder"
CreateShortCut "$SMPROGRAMS\myFolder\app.lnk" "$INSTDIR\app.exe" "" "$INSTDIR\app.exe" 0
CreateShortCut "$SMPROGRAMS\myFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM