我正在使用 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
关于windows - Electron Builder NSIS 在启动时创建快捷方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48422871/