electron-builder.yml配置说明
appId: com.electron.test //appid 包名 productName: 测试程序 //安装程序的名字 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}' - '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}' asarUnpack: - resources win: executableName: 测试程序 icon: build/icon/favicon.ico //程序图标 nsis: oneClick: false //是否一键安装 allowElevation: true //允许请求提升。若为false,则用户必须使用提升的权限重新启动安装程序。 allowToChangeInstallationDirectory: true //是否允许修改安装目录 createDesktopShortcut: true //卸载时图标 createStartMenuShortcut: true // 是否创建开始菜单图标 runAfterFinish: false //是否安装完成后运行 include: ../build/script/installer.nsh //我这里放的是将应用程序默认安装在哪个路径 artifactName: ${name}-${version}-setup.${ext} uninstallDisplayName: ${productName} installerIcon: ./build/icon.ico // 安装时图标 uninstallerIcon: ./build/icon.ico 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/