diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1c1ee2..835bb3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -142,6 +142,7 @@ jobs: run: | pnpm install pnpm add @mihomo-party/sysproxy-linux-${{ matrix.arch }}-gnu + sed -i "s/productName: Mihomo Party/productName: mihomo-party/" electron-builder.yml pnpm prepare --${{ matrix.arch }} - name: Build env: @@ -197,7 +198,6 @@ jobs: npm_config_arch: ${{ matrix.arch }} npm_config_target_arch: ${{ matrix.arch }} run: | - sed -i "" -e "s/productName: mihomo-party/productName: Mihomo Party/" electron-builder.yml chmod +x build/pkg-scripts/postinstall pnpm build:mac --${{ matrix.arch }} - name: Generate checksums @@ -248,7 +248,6 @@ jobs: npm_config_arch: ${{ matrix.arch }} npm_config_target_arch: ${{ matrix.arch }} run: | - sed -i "" -e "s/productName: mihomo-party/productName: Mihomo Party/" electron-builder.yml sed -i "" -e "s/macos/catalina/" electron-builder.yml chmod +x build/pkg-scripts/postinstall pnpm build:mac --${{ matrix.arch }} diff --git a/aur/mihomo-party-electron/PKGBUILD b/aur/mihomo-party-electron/PKGBUILD index 408f326..7d26b99 100644 --- a/aur/mihomo-party-electron/PKGBUILD +++ b/aur/mihomo-party-electron/PKGBUILD @@ -24,6 +24,7 @@ options=('!lto') prepare(){ cd $srcdir/${_pkgname}-${pkgver} + sed -i "s/productName: Mihomo Party/productName: mihomo-party/" electron-builder.yml pnpm install } diff --git a/aur/mihomo-party-git/PKGBUILD b/aur/mihomo-party-git/PKGBUILD index 30fc523..f8162eb 100644 --- a/aur/mihomo-party-git/PKGBUILD +++ b/aur/mihomo-party-git/PKGBUILD @@ -25,6 +25,7 @@ pkgver() { prepare(){ cd $srcdir/${_pkgname} + sed -i "s/productName: Mihomo Party/productName: mihomo-party/" electron-builder.yml pnpm install } diff --git a/aur/mihomo-party/PKGBUILD b/aur/mihomo-party/PKGBUILD index fb36105..15b5e37 100644 --- a/aur/mihomo-party/PKGBUILD +++ b/aur/mihomo-party/PKGBUILD @@ -20,6 +20,7 @@ options=('!lto') prepare(){ cd $srcdir/${pkgname}-${pkgver} + sed -i "s/productName: Mihomo Party/productName: mihomo-party/" electron-builder.yml pnpm install } diff --git a/changelog.md b/changelog.md index 86e2f52..62b3735 100644 --- a/changelog.md +++ b/changelog.md @@ -2,3 +2,4 @@ - 1.5.0 之后 macOS 改用 pkg 安装方式,不再支持 dmg 安装方式,因此本次更新需要手动下载安装包进行安装 - electron33 已不再支持 macOS 10.15,故为 10.15 提供单独的安装包,需要的用户请自行下载安装,应用内更新时会自动检测系统版本,安装后后续可正常在应用内直接更新 +- 1.5.1 之后 Windows 下 `profuctName` 改为 `Mihomo Party`, 更新后若出现找不到文件报错,手动以管理员权限运行一次即可 diff --git a/electron-builder.yml b/electron-builder.yml index 7429815..3621e49 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,5 +1,5 @@ appId: party.mihomo.app -productName: mihomo-party +productName: Mihomo Party directories: buildResources: build files: @@ -30,7 +30,6 @@ win: artifactName: ${name}-windows-${version}-${arch}-portable.${ext} nsis: artifactName: ${name}-windows-${version}-${arch}-setup.${ext} - shortcutName: Mihomo Party uninstallDisplayName: ${productName} allowToChangeInstallationDirectory: true oneClick: false @@ -57,7 +56,7 @@ linux: target: - deb - rpm - maintainer: mihomo-party + maintainer: mihomo-party-org category: Utility artifactName: ${name}-linux-${version}-${arch}.${ext} deb: diff --git a/package.json b/package.json index c77144f..bb3a9b3 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.5.0", "description": "Mihomo Party", "main": "./out/main/index.js", - "author": "mihomo-party", + "author": "mihomo-party-org", "homepage": "https://mihomo.party", "scripts": { "format": "prettier --write .", diff --git a/src/main/index.ts b/src/main/index.ts index 6536ec7..f3e6950 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -92,15 +92,6 @@ app.on('open-url', async (_event, url) => { showMainWindow() await handleDeepLink(url) }) -// Quit when all windows are closed, except on macOS. There, it's common -// for applications and their menu bar to stay active until the user quits -// explicitly with Cmd + Q. -app.on('window-all-closed', (e) => { - e.preventDefault() - // if (process.platform !== 'darwin') { - // app.quit() - // } -}) app.on('before-quit', async (e) => { e.preventDefault() @@ -109,8 +100,7 @@ app.on('before-quit', async (e) => { app.exit() }) -powerMonitor.on('shutdown', async (e) => { - e.preventDefault() +powerMonitor.on('shutdown', async () => { triggerSysProxy(false) await stopCore() app.exit() diff --git a/src/main/utils/dirs.ts b/src/main/utils/dirs.ts index 0907a60..87df764 100644 --- a/src/main/utils/dirs.ts +++ b/src/main/utils/dirs.ts @@ -13,7 +13,7 @@ export function dataDir(): string { if (isPortable()) { return path.join(exeDir(), 'data') } else { - return path.join(app.getPath('appData'), 'mihomo-party') + return app.getPath('userData') } }