diff --git a/electron-builder.json b/electron-builder.json index 12d2b549..84c3d9f3 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -2,33 +2,13 @@ "$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json", "productName": "Escrcpy", "appId": "org.viarotel.escrcpy", - "asar": true, "directories": { "output": "dist-release", "buildResources": "electron/resources/build" }, + "icon": "logo", "files": ["dist", "dist-electron"], - "publish": { - "provider": "github", - "owner": "viarotel-org", - "repo": "escrcpy", - "updaterCacheDirName": "escrcpy-updater" - }, - "nsis": { - "artifactName": "${productName}-${version}-win-setup-${arch}.${ext}", - "shortcutName": "${productName}", - "uninstallDisplayName": "${productName}", - "oneClick": false, - "perMachine": false, - "allowToChangeInstallationDirectory": true, - "deleteAppDataOnUninstall": false - }, - "portable": { - "artifactName": "${productName}-${version}-win-portable-${arch}.${ext}", - "requestExecutionLevel": "user" - }, "win": { - "icon": "logo.ico", "target": [ { "target": "nsis", @@ -49,8 +29,20 @@ "to": "extra" } }, + "nsis": { + "artifactName": "${productName}-${version}-win-setup-${arch}.${ext}", + "shortcutName": "${productName}", + "uninstallDisplayName": "${productName}", + "oneClick": false, + "perMachine": false, + "allowToChangeInstallationDirectory": true, + "deleteAppDataOnUninstall": false + }, + "portable": { + "artifactName": "${productName}-${version}-win-portable-${arch}.${ext}", + "requestExecutionLevel": "user" + }, "mac": { - "icon": "logo.icns", "target": [ { "target": "dmg", @@ -62,6 +54,11 @@ } ], "artifactName": "${productName}-${version}-mac-${arch}.${ext}", + "extraResources": { + "from": "electron/resources/extra", + "to": "extra", + "filter": ["**/*", "!core"] + }, "entitlementsInherit": "electron/resources/build/entitlements.mac.plist", "extendInfo": { "NSDocumentsFolderUsageDescription": "Application requests access to the user's Documents folder.", @@ -73,9 +70,9 @@ "hardenedRuntime": false }, "linux": { + "desktop": "logo", "maintainer": "viarotel@qq.com", "category": "Utility", - "icon": "logo.png", "target": [ { "target": "AppImage", @@ -86,7 +83,19 @@ "arch": ["x64", "arm64"] } ], - "artifactName": "${productName}-${version}-linux-${arch}.${ext}" + "artifactName": "${productName}-${version}-linux-${arch}.${ext}", + "extraResources": { + "from": "electron/resources/extra", + "to": "extra", + "filter": ["**/*", "!core"] + } }, - "npmRebuild": false + "asar": true, + "npmRebuild": false, + "publish": { + "provider": "github", + "owner": "viarotel-org", + "repo": "escrcpy", + "updaterCacheDirName": "escrcpy-updater" + } } diff --git a/electron/configs/index.js b/electron/configs/index.js index 8e5682fd..4886c996 100644 --- a/electron/configs/index.js +++ b/electron/configs/index.js @@ -7,7 +7,7 @@ export const desktopPath = process.env.DESKTOP_PATH export const devPublishPath = resolve('dev-publish.yml') -export const logoPath = buildResolve('logo.png') +export const logoPath = buildResolve('logo@256x256.png') export const icoLogoPath = buildResolve('logo.ico') export const icnsLogoPath = buildResolve('logo.icns') diff --git a/electron/helpers/index.js b/electron/helpers/index.js index df3dd186..9ced8f0b 100644 --- a/electron/helpers/index.js +++ b/electron/helpers/index.js @@ -10,7 +10,7 @@ export const extraResolve = (value) => { } export const buildResolve = value => - resolve(process.env.CWD, `electron/resources/build/${value}`) + resolve(`electron/resources/build/${value}`) export function exposeContext(key, value) { if (process.contextIsolated) { diff --git a/electron/resources/build/logo.png b/electron/resources/build/logo.png deleted file mode 100644 index 026b5bfa..00000000 Binary files a/electron/resources/build/logo.png and /dev/null differ diff --git a/electron/resources/build/logo@256x256.png b/electron/resources/build/logo@256x256.png new file mode 100644 index 00000000..6e4f6681 Binary files /dev/null and b/electron/resources/build/logo@256x256.png differ diff --git a/electron/resources/extra/tray-Template.png b/electron/resources/extra/tray-Template.png index 7274ac53..6e4f6681 100644 Binary files a/electron/resources/extra/tray-Template.png and b/electron/resources/extra/tray-Template.png differ diff --git a/electron/resources/extra/tray.png b/electron/resources/extra/tray.png index 7274ac53..6e4f6681 100644 Binary files a/electron/resources/extra/tray.png and b/electron/resources/extra/tray.png differ diff --git a/package.json b/package.json index 079a8fdd..4dd62168 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@viarotel-org/unocss-config": "^0.7.4", "@vitejs/plugin-vue": "^4.3.4", "dayjs": "^1.11.10", - "electron": "^26.1.0", + "electron": "^27.0.2", "electron-builder": "^24.6.4", "electron-store": "^8.1.0", "electron-updater": "^6.1.4",