【问题标题】:Electron Builder NSIS Create a shortcut in startupElectron Builder NSIS 在启动时创建快捷方式
【发布时间】:2018-07-03 12:30:50
【问题描述】:
【问题讨论】:
标签:
windows
electron
nsis
electron-builder
【解决方案1】:
我可以通过将创建快捷方式的代码放在 NSIS 的自定义安装脚本中的 customInstall 宏中来做到这一点
在package.json
"build": {
"nsis": {
"include": "build/installer.nsh",
},
这是为了能够使用自定义脚本。
而在build/installer.nsh
!macro customInstall
CreateShortCut "$SMSTARTUP\filename.lnk" "$INSTDIR\filename.exe"
!macroend
【解决方案2】:
在您的电子构建器配置中的顶级 nsis 键中使用“createStartMenuShortcut”选项:
"build": {
"nsis": {
"createStartMenuShortcut": true,
},
//Rest of the config
}
您可以在the docs找到更多配置选项