improve error message if input locale is dropped

This commit is contained in:
Homes32
2023-01-09 18:43:49 -06:00
parent ac3dc56f6b
commit f6388c0a00

View File

@@ -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