简体   繁体   English

NSIS CreateShortCut:“开始”菜单上的快捷方式顺序

[英]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: 我正在使用NSIS为我的某个应用程序创建安装程序,并且我使用此代码在开始菜单上创建快捷方式:

;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. 它可以工作,但开始菜单> myFolder上的卸载程序快捷方式出现在app.exe快捷方式之前。

Is there a way to control the order of the shortcuts? 有没有办法控制快捷方式的顺序?

Usually the installation order is ignored, Windows arranges them automatically. 通常会忽略安装顺序,Windows会自动排列它们。 In older Windows versions the start menu has a context menu option for ordering them alphabetically, but newer versions order them automatically. 在较旧的Windows版本中,开始菜单有一个上下文菜单选项,用于按字母顺序排序,但较新的版本会自动对它们进行排序。

here is the CreateShorCut usage 这是CreateShorCut用法

CreateShorCut link.lnk target.file [parameters [icon.file [ icon_index_number [start_options [keyboard_shortcut [description]]]]]] 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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