From 5bda4b19dfc9ce64735cd39600d41a5deefc26ee Mon Sep 17 00:00:00 2001 From: Draculabo Date: Wed, 4 Feb 2026 20:33:26 +0800 Subject: [PATCH] fix: correct Windows install notice path --- src/utils/installNotice.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/installNotice.ts b/src/utils/installNotice.ts index 291f57b..3750adb 100644 --- a/src/utils/installNotice.ts +++ b/src/utils/installNotice.ts @@ -70,6 +70,14 @@ function getPathApi(platform: string) { return path; } +function normalizeWindowsInstallDirName(appName: string) { + return appName + .trim() + .replace(/[^a-zA-Z0-9]+/g, '_') + .replace(/^_+|_+$/g, '') + .toLowerCase(); +} + export function getExpectedInstallRoot({ platform, localAppData, @@ -88,7 +96,8 @@ export function getExpectedInstallRoot({ } const pathApi = getPathApi(platform); - return pathApi.resolve(pathApi.join(localAppData, appName)); + const installDirName = normalizeWindowsInstallDirName(appName); + return pathApi.resolve(pathApi.join(localAppData, installDirName)); } export function isRunningFromExpectedInstallDir({