electron 静默安装同时安装完成后自动启动(nsis)

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
相关推荐
wow_DG1 小时前
【Vue2 ✨】Vue2 入门之旅(四):生命周期钩子
开发语言·javascript·ecmascript
网络研究院5 小时前
苹果 Safari 地址栏可能被超大光标视觉欺骗
前端·safari·苹果
slongzhang_6 小时前
html添加水印
前端·html
Small black human7 小时前
前端-什么是Vue
前端·javascript·vue.js
IT 前端 张7 小时前
Axios与Ajax:现代Web请求大比拼
前端·javascript·ajax
ikun778g8 小时前
uniapp使用uview UI,自定义级联选择组件
前端·前端框架·uni-app
java水泥工8 小时前
基于Echarts+HTML5可视化数据大屏展示-惠民服务平台
前端·echarts·html5
万少9 小时前
可可图片编辑 HarmonyOS(3)应用间分享图片
前端·harmonyos·客户端
Hy行者勇哥9 小时前
现代软件系统架构:前端、后端、数据库、部署、算法与AI学习的结构与交互分析
前端·数据库·学习
前端开发爱好者10 小时前
90% 前端都不知道的 20 个「零依赖」浏览器原生能力!
前端·javascript·vue.js