[英]Electron Builder NSIS Create a shortcut in startup
我正在使用 Electron Builder 为 Windows 生成 NSIS 安装程序。 我需要安装程序在启动菜单中创建快捷方式。
我该怎么做?
这是关于 NSIS 脚本的 Electron Builder 文档。 https://www.electron.build/configuration/nsis#custom-nsis-script
安装应用程序后,我应该把要执行的代码放在哪里?
我能够通过将创建快捷方式的代码放在 NSIS 的自定义安装脚本中的customInstall
宏中来做到这一点
在package.json
"build": {
"nsis": {
"include": "build/installer.nsh",
},
这是为了能够使用自定义脚本。
并在build/installer.nsh
!macro customInstall
CreateShortCut "$SMSTARTUP\filename.lnk" "$INSTDIR\filename.exe"
!macroend
在您的电子构建器配置中的顶级 nsis 键中使用“createStartMenuShortcut”选项:
"build": {
"nsis": {
"createStartMenuShortcut": true,
},
//Rest of the config
}
您可以在文档中找到更多配置选项
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.