diff --git a/logo.ico b/logo.ico new file mode 100644 index 0000000..bb7375e Binary files /dev/null and b/logo.ico differ diff --git a/package.json b/package.json index 6cb253d..aead7bb 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { - "name": "locking-client", + "name": "locking", "version": "1.0.0", - "description": "locking-client", + "description": "locking", "main": "src/main/index.js", "scripts": { "electron": "electron ./src/main/index.js", - "package": "electron-packager . --platform=win32 --arch=x64 --out ./electron_dist" + "package": "electron-packager . --platform=win32 --arch=x64 --out ./electron_dist --icon=test.ico" }, "repository": { "type": "git", @@ -16,6 +16,17 @@ "client", "shell" ], + "build": { + "mac": { + "icon": "logo.ico" + }, + "win": { + "icon": "logo.ico" + }, + "linux": { + "icon": "logo.ico" + } + }, "author": "yiyun", "license": "ISC", "devDependencies": { diff --git a/src/main/index.js b/src/main/index.js index 170cb48..562566a 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -25,7 +25,7 @@ function createWindow() { // plugins: true, preload: path.join(__dirname, './', 'preload.js'), }, - icon: path.join(__dirname, 'logo.ico'), + icon: path.join(__dirname, '../../', 'logo.ico'), // frame: false, }) // and load the index.html of the app. @@ -61,7 +61,7 @@ function createWindow() { // }) // 创建系统通知区菜单 - tray = new Tray(path.join(__dirname, 'logo.ico')); + tray = new Tray(path.join(__dirname, '../../', 'logo.ico')); const contextMenu = Menu.buildFromTemplate([ {label: '最大化', click: () => { mainWindow.maximize()}}, {label: '最小化', click: () => {mainWindow.minimize()}}, diff --git a/test.ico b/test.ico new file mode 100644 index 0000000..2740a47 Binary files /dev/null and b/test.ico differ