fix: install notice showing in Chinese and not recognizing MSI install path
- Use app.getPreferredSystemLanguages() for reliable OS language detection instead of relying solely on app.getLocale() which returns Chromium's internal locale (was returning zh-CN on pt-BR systems) - Support both Squirrel (%LOCALAPPDATA%) and WiX/MSI (Program Files) install directories when checking if app runs from expected location - Extract matchLocaleTag helper for cleaner language resolution logic - Add getAllExpectedInstallRoots to enumerate all valid install paths
This commit is contained in:
1 parent
4ce8d266ab
commit
0753bbdce6
2 files changed
+117
-17
No files matched your search
@@ -116,6 +116,8 @@ function isRunningFromExpectedInstallDir() {
|
||||
localAppData: process.env.LOCALAPPDATA,
|
||||
appName: app.getName(),
|
||||
execPath: process.execPath,
|
||||
programFiles: process.env.ProgramFiles,
|
||||
programFilesX86: process.env['ProgramFiles(x86)'],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -140,6 +142,7 @@ function showWindowsInstallNoticeIfNeeded() {
|
||||
hasShownInstallNotice = true;
|
||||
const language = resolveInstallNoticeLanguage({
|
||||
configLanguage: startupConfig?.language,
|
||||
preferredLanguages: app.getPreferredSystemLanguages(),
|
||||
locale: app.getLocale(),
|
||||
});
|
||||
const text = getInstallNoticeText(language);
|
||||
|
||||
Reference in new issue
Block a user