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目录下的最后三条,希望可以帮助到你

相关推荐
南枝异客6 分钟前
电话号码的字母组合
开发语言·javascript·算法
护国神蛙34 分钟前
给你一个页面如何定时刷新
前端·javascript·浏览器
一直游到海水变蓝丿42 分钟前
el-select下拉框 添加 el-checkbox 多选框
前端·javascript·vue.js
阿奇__2 小时前
element 跨页选中,回显el-table选中数据
前端·vue.js·elementui
努力往上爬de蜗牛2 小时前
vue3 daterange正则踩坑
javascript·vue.js·elementui
谢尔登2 小时前
【React】SWR 和 React Query(TanStack Query)
前端·react.js·前端框架
断竿散人2 小时前
专题一、HTML5基础教程-Viewport属性深入理解:移动端网页的魔法钥匙
前端
3Katrina2 小时前
理解Promise:让异步编程更优雅
前端·javascript
星之金币2 小时前
关于我用Cursor优化了一篇文章:30 分钟学会定制属于你的编程语言
前端·javascript
天外来物2 小时前
实战分享:用CI/CD实现持续部署
前端·nginx·docker