diff --git a/.gitignore b/.gitignore index 107d986..08bebeb 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ package-lock.json dist.zip .vscode + +bun.lockb diff --git a/app.js b/app.js index 56079a3..f6edc64 100644 --- a/app.js +++ b/app.js @@ -24,7 +24,7 @@ function createWindow() { } else { win.loadURL(`file://${__dirname}/dist/index.html`); } - const image = nativeImage.createFromPath(path.join(__dirname, 'public/icon.png')); + const image = nativeImage.createFromPath(path.join(__dirname, 'public/icon_16x16.png')).resize({ width: 16, height: 16 }); const tray = new Tray(image); // 创建一个上下文菜单 diff --git a/build/mac.json b/build/mac.json new file mode 100644 index 0000000..5cf4922 --- /dev/null +++ b/build/mac.json @@ -0,0 +1,49 @@ +{ + "appId": "com.alger.music", + "productName": "AlgerMusic", + "artifactName": "${productName}_${version}_${arch}.${ext}", + "directories": { + "output": "dist_electron/mac" + }, + "files": [ + "dist/**/*", + "package.json", + "app.js", + "electron/**/*", + "**/*", + "public/**/*", + "node_modules/**/*" + ], + "mac": { + "icon": "public/icon.icns", + "target": [ + { + "target": "dmg", + "arch": ["x64", "arm64"] + } + ], + "category": "public.app-category.music", + "darkModeSupport": true + }, + "dmg": { + "title": "${productName} ${version}", + "icon": "public/icon.icns", + "contents": [ + { + "x": 410, + "y": 150, + "type": "link", + "path": "/Applications" + }, + { + "x": 130, + "y": 150, + "type": "file" + } + ], + "window": { + "width": 540, + "height": 380 + } + } +} \ No newline at end of file diff --git a/package.json b/package.json index fb487fe..ebfbc3b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0", "b:win:x64": "electron-builder --config ./build/win64.json", "b:win:x86": "electron-builder --config ./build/win32.json", - "b:win:arm": "electron-builder --config ./build/winarm64.json" + "b:win:arm": "electron-builder --config ./build/winarm64.json", + "b:mac": "electron-builder --config ./build/mac.json" }, "dependencies": { "electron-store": "^8.1.0" diff --git a/public/icon.icns b/public/icon.icns new file mode 100644 index 0000000..1849e75 Binary files /dev/null and b/public/icon.icns differ diff --git a/public/icon_16x16.png b/public/icon_16x16.png new file mode 100644 index 0000000..9950e66 Binary files /dev/null and b/public/icon_16x16.png differ