From ac734ecf71df017e739219f99c3edda84b534a81 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Wed, 2 Oct 2024 14:38:21 +0800 Subject: [PATCH] tweak display name --- .github/workflows/build.yml | 4 +++- electron-builder.yml | 1 - src/main/resolve/autoUpdater.ts | 2 +- src/main/utils/dirs.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b3e62c..d7f5f03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -196,7 +196,9 @@ jobs: env: npm_config_arch: ${{ matrix.arch }} npm_config_target_arch: ${{ matrix.arch }} - run: pnpm build:mac --${{ matrix.arch }} + run: | + sed -i "" -e "s/productName: mihomo-party/productName: Mihomo Party/" electron-builder.yml + pnpm build:mac --${{ matrix.arch }} - name: Generate checksums run: pnpm checksum .dmg - name: Upload Artifacts diff --git a/electron-builder.yml b/electron-builder.yml index 917361e..c01a6d4 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,6 +1,5 @@ appId: party.mihomo.app productName: mihomo-party -executableName: mihomo-party directories: buildResources: build files: diff --git a/src/main/resolve/autoUpdater.ts b/src/main/resolve/autoUpdater.ts index e65a2b3..4286803 100644 --- a/src/main/resolve/autoUpdater.ts +++ b/src/main/resolve/autoUpdater.ts @@ -96,7 +96,7 @@ export async function downloadAndInstallUpdate(version: string): Promise { ) try { await execPromise(`mv /Applications/${name}.app /tmp`) - await execPromise('cp -R "/Volumes/mihomo-party/mihomo-party.app" /Applications/') + await execPromise('cp -R "/Volumes/mihomo-party/Mihomo Party.app" /Applications/') await execPromise(`rm -rf /tmp/${name}.app`) } catch (e) { await execPromise(`mv /tmp/${name}.app /Applications`) diff --git a/src/main/utils/dirs.ts b/src/main/utils/dirs.ts index 7b16740..8af31db 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 app.getPath('userData') + return path.join(app.getPath('appData'), 'mihomo-party') } }