mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-03 14:20:50 +08:00
✨ feat: 完善mac打包规则 修复 icon显示问题
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -14,3 +14,5 @@ package-lock.json
|
||||
dist.zip
|
||||
|
||||
.vscode
|
||||
|
||||
bun.lockb
|
||||
|
||||
2
app.js
2
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);
|
||||
|
||||
// 创建一个上下文菜单
|
||||
|
||||
49
build/mac.json
Normal file
49
build/mac.json
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
BIN
public/icon.icns
Normal file
BIN
public/icon.icns
Normal file
Binary file not shown.
BIN
public/icon_16x16.png
Normal file
BIN
public/icon_16x16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 626 B |
Reference in New Issue
Block a user