electron-vite打包成安装包配置

javascript 复制代码
appId: com.electron.app
productName: yunxipan
directories:
  buildResources: build
files:
  - '!**/.vscode/*'
  - '!src/*'
  - '!electron.vite.config.{js,ts,mjs,cjs}'
  - '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
  - '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
asarUnpack:
  - resources/**
win:
  executableName: yunxipan
nsis:
  artifactName: ${name}-${version}-setup.${ext}
  shortcutName: ${productName}
  uninstallDisplayName: ${productName}
  createDesktopShortcut: always
  oneClick: false # 设置为 false 以允许自定义安装路径
  perMachine: true # 允许系统范围安装
  allowToChangeInstallationDirectory: true # 允许用户更改安装目录
mac:
  entitlementsInherit: build/entitlements.mac.plist
  extendInfo:
    - NSCameraUsageDescription: Application requests access to the device's camera.
    - NSMicrophoneUsageDescription: Application requests access to the device's microphone.
    - NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
    - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
  notarize: false
dmg:
  artifactName: ${name}-${version}.${ext}
linux:
  target:
    - AppImage
    - snap
    - deb
  maintainer: electronjs.org
  category: Utility
appImage:
  artifactName: ${name}-${version}.${ext}
npmRebuild: false
publish:
  provider: generic
  url: https://example.com/auto-updates
electronDownload:
  mirror: https://npmmirror.com/mirrors/electron/

这个文件是electron-builder.yml仔细查看上面nsis目录下的最后三条,希望可以帮助到你

相关推荐
Hexene...7 分钟前
【前端Vue】npm install时根据新的状态重新引入实际用到的包,不引入未使用到的
前端·vue.js·npm
2301_7806698612 分钟前
Vue(入门配置、常用指令)、Ajax、Axios
前端·vue.js·ajax·javaweb
码农幻想梦13 分钟前
Vue3入门到实战【尚硅谷】
前端·vue
hudou_k14 分钟前
利用WebNaket实现Web应用直接访问硬件设备
前端
吃茄子的猫15 分钟前
若依框架根据当前登录人信息,显示不同的静态公司logo
前端·vue
LZQ <=小氣鬼=>24 分钟前
React + Ant Design (antd) 国际化完整实战教程
前端·react.js·前端框架·antd·moment
星海拾遗27 分钟前
react源码从入门到入定
前端·javascript·react.js
小满zs29 分钟前
Next.js第二十五章(CSS方案)
开发语言·javascript·css
Charlie_lll30 分钟前
学习Three.js–星环粒子(ShaderMaterial)
前端·three.js
wuhen_n34 分钟前
JavaScript事件循环(下) - requestAnimationFrame与Web Workers
开发语言·前端·javascript