From f6388c0a00ece4972a4256e1aa8f647ca3d5edad Mon Sep 17 00:00:00 2001 From: Homes32 Date: Mon, 9 Jan 2023 18:43:49 -0600 Subject: [PATCH] improve error message if input locale is dropped --- Projects/PhoenixPE/Tweaks/Localization.script | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Projects/PhoenixPE/Tweaks/Localization.script b/Projects/PhoenixPE/Tweaks/Localization.script index 39df279..9b4f374 100644 --- a/Projects/PhoenixPE/Tweaks/Localization.script +++ b/Projects/PhoenixPE/Tweaks/Localization.script @@ -126,20 +126,19 @@ If,ExistFile,"%ProjectTemp%\Get-Intl.ini",Begin If,%cmb_InputLocale1%,Equal,HostOS,Begin IniRead,"%ProjectTemp%\Get-Intl.ini","International","Active keyboard(s)",%InputLocale1% StrFormat,Replace,%InputLocale1%,", ",;,%InputLocale1% - // check for entries like: + // check for entries like: // Active keyboard(s)=0407:00000407, 0407:{FE0420F1-38D1-4B4C-96BF-E7E20A74CFB7}{64D7E8FF-F5F8-4B63-B47F-F4059F73A7E4} - // dism won't accept those guid based keyboard settings and will fail with error 87 + // dism won't accept guid based keyboard settings and will fail with error 87 so just drop them // to reproduce: install keyman or use a grown up windows installation with many language setting changes over time - // so just drop them StrFormat,Pos,%InputLocale1%,"{",%Pos% Set,%CleanInputLocale1%,"" If,%Pos%,Bigger,0,Begin ForEach,%Element%,%InputLocale1%,Delim=;,Begin StrFormat,Pos,%Element%,"{",%Pos% If,%Pos%,Equal,0,List,Append,%CleanInputLocale1%,%Element%,Delim=; + Else,Echo,"Dropped invalid input locale [%Element%]",WARN End Set,%InputLocale1%,%CleanInputLocale1% - Echo,"Dropped invalid input locales",WARN End End @@ -152,8 +151,7 @@ If,ExistFile,"%ProjectTemp%\Get-Intl.ini",Begin IniRead,"%ProjectTemp%\Get-Intl.ini","International","User locale for default user",%UserLocale% // Fallback to another term in Get-Intl.ini If,%UserLocale%,Equal,"",IniRead,"%ProjectTemp%\Get-Intl.ini","International","Default system UI language",%UserLocale% - // Fallback to LocaleName from HKCU\Control Panel\International - // sometimes fails due to invalid content like de-EN that breaks dism call + // As a last ditch, fallback to LocaleName from HKCU\Control Panel\International in case of fails due to invalid content like de-EN that breaks dism call If,%UserLocale%,Equal,"",RegRead,HKCU,"Control Panel\International","LocaleName",%UserLocale% End