electron-builder 定义打包文件的时候增加,修改.yml配置文件,增加 nsis 自定义文件
git
directories:
output: release
appId: xxx
productName: xxx
files:
- "dist"
- "dist-electron"
publish:
- provider: generic
url: xxxxx
win:
icon: xxxx
target: nsis
sign: xxxx
nsis:
license: xxxxx
unicode: true
shortcutName: xxxx
include: dist/installer.nsh
electronVersion: 11.5.0
https://www.electron.build/nsis.html#custom-nsis-script
nsis include 自定义的 .nsh 文件
在 preInit 阶段 增加静默安装的指令
git
!macro preInit
SetSilent silent
!macroend
在 customInstall 阶段打开软件
git
!macro customInstall
ExecWait '"$INSTDIR\appName.exe"'
!macroend