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
相关推荐
唐璜Taro3 小时前
electron自定义国内镜像
前端·javascript·electron
gnip7 小时前
首页加载、白屏优化方案
前端·javascript
思扬09287 小时前
前端学习日记 - 前端函数防抖详解
前端·学习
gnip7 小时前
包体积,打包速度优化
前端·javascript
正义的大古7 小时前
Vue 3 + TypeScript:深入理解组件引用类型
前端·vue.js·typescript
A5rZ8 小时前
缓存投毒进阶 -- justctf 2025 Busy Traffic
前端·javascript·缓存
未来之窗软件服务9 小时前
浏览器CEFSharp133+X86+win7 之多页面展示(三)
前端·javascript·浏览器开发·东方仙盟
胡斌附体9 小时前
elementui cascader 远程加载请求使用 选择单项等
前端·javascript·elementui·cascader·可独立选中单节点
烛阴9 小时前
Vector Normaliztion -- 向量归一化
前端·webgl