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
相关推荐
YHHLAI3 小时前
Vue 3 流式输出实战:从零掌握 LLM Streaming 与 SSE 协议
前端·javascript·vue.js
2601_965798473 小时前
Arrow Unlocker HTML5 Game Review: Keep Web Arcade Players Coming Back
前端·html·html5
不简说3 小时前
JS 代码技巧 vol.10 — 20 个 V8 引擎原理,解释"为什么这样写快"
前端·javascript·面试
醉城夜风~4 小时前
HTML常用标签详解学习博客:从基础标签到页面结构完整掌握
前端·学习·html
OpenTiny社区4 小时前
拒绝臃肿!TinyRobot从“AI 输入框”到“AI输入控制台”的可扩展进化
前端·vue.js
淼澄研学5 小时前
PyTorch深度学习实战:5个核心方法从0到1构建神经网络
前端·数据库·python
MartinYeung55 小时前
[论文学习]WASP:面向提示注入攻击的Web代理安全性基准测试
前端·网络·学习
lemon_sjdk5 小时前
从 ServletRequest 到 Spring 抽象:Web 请求的底层基石与演化
java·前端·spring
程序员黑豆5 小时前
鸿蒙应用开发之状态变化通知:@Watch 装饰器详解与实战
前端·harmonyos
swipe5 小时前
13|(前端转全栈)支付成功不等于结束:回调、幂等、超时关单和状态竞争
前端·后端·面试