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
相关推荐
环境栈笔记3 分钟前
指纹浏览器安卓怎么用?从运行位置到功能验收,先把三种方案分清
前端·人工智能·后端·自动化
计算机魔术师21 分钟前
Anthropic IPO 招股文件披露近 9000 亿美元隐性债务
前端
Hello.Reader35 分钟前
Three.js / Cesium 卡顿怎么办?把三维渲染搬到 GPU 服务器
服务器·开发语言·javascript
chi113036 分钟前
【无标题】
前端·javascript·python
萝卜兔0081 小时前
PIKACHU_UnsafeFileUpload
javascript·php
IT_陈寒1 小时前
JavaScript实战技巧总结:深挖数组遍历的性能陷阱与实战解法
前端·人工智能·后端
步行cgn2 小时前
为什么既要 web.xml 又要 springmvc.xml?能不能只配一个?
xml·前端·hive
风骏时光牛马2 小时前
大模型综合能力评测:多维度性能与对齐效果对比
前端
winfredzhang2 小时前
从零手写一个毛玻璃风格的页面搭建台:单文件 HTML 实现组件放置、面板磁吸与图层管理
前端·html
葡萄城技术团队10 小时前
1000 人协同压测的环境瓶颈排查:CPU 争用与 Wi\-Fi
前端