fix: correct Windows install notice path

This commit is contained in:
Draculabo committed 2026-02-04 20:33:26 +08:00
1 parent 476d297e4b
commit 5bda4b19df
1 file changed
+10 -1
+10 -1
View File
@@ -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({