5

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?

Meredith
  • 920
  • 7
  • 16
  • 31

2 Answers2

1

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.

Cosmin
  • 21,216
  • 5
  • 45
  • 60
-2

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
Ugo Robain
  • 3,014
  • 1
  • 14
  • 15