fix: correct Windows install notice path
This commit is contained in:
1 parent
476d297e4b
commit
5bda4b19df
1 file changed
+10
-1
@@ -70,6 +70,14 @@ function getPathApi(platform: string) {
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizeWindowsInstallDirName(appName: string) {
|
||||||
|
return appName
|
||||||
|
.trim()
|
||||||
|
.replace(/[^a-zA-Z0-9]+/g, '_')
|
||||||
|
.replace(/^_+|_+$/g, '')
|
||||||
|
.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
export function getExpectedInstallRoot({
|
export function getExpectedInstallRoot({
|
||||||
platform,
|
platform,
|
||||||
localAppData,
|
localAppData,
|
||||||
@@ -88,7 +96,8 @@ export function getExpectedInstallRoot({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const pathApi = getPathApi(platform);
|
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({
|
export function isRunningFromExpectedInstallDir({
|
||||||
|
|||||||
Reference in new issue
Block a user