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
相关推荐
wenzhangli71 分钟前
Ooder A2UI 核心架构深度解析:WEB 拦截层的设计与实现
前端·架构
前端百草阁26 分钟前
【前端性能优化全链路指南】从开发编写到构建运行的多维度实践
前端·性能优化
神探小白牙42 分钟前
eCharts 多系列柱状图增加背景图
javascript·ecmascript·echarts
女生也可以敲代码1 小时前
AI时代下的50道前端开发面试题:从基础到大模型应用
前端·面试
ZhengEnCi1 小时前
M5-markconv自定义CSS样式指南 📝
前端·css·python
IT_陈寒1 小时前
SpringBoot自动配置的坑差点让我加班到天亮
前端·人工智能·后端
xingpanvip1 小时前
星盘接口开发文档:星相日历接口指南
android·开发语言·前端·css·php·lua
@PHARAOH1 小时前
WHAT - GitLens supercharged 插件
前端
TT模板2 小时前
苹果cms整合西瓜播放器XGplayer插件支持跳过片头尾
前端·html5
Wect2 小时前
React 性能优化精讲
前端·react.js·性能优化