mirror of
https://github.com/PhoenixPE/PhoenixPE.git
synced 2025-09-16 18:18:04 +02:00
improve error message if input locale is dropped
This commit is contained in:
@@ -128,18 +128,17 @@ If,ExistFile,"%ProjectTemp%\Get-Intl.ini",Begin
|
|||||||
StrFormat,Replace,%InputLocale1%,", ",;,%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}
|
// 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
|
// 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%
|
StrFormat,Pos,%InputLocale1%,"{",%Pos%
|
||||||
Set,%CleanInputLocale1%,""
|
Set,%CleanInputLocale1%,""
|
||||||
If,%Pos%,Bigger,0,Begin
|
If,%Pos%,Bigger,0,Begin
|
||||||
ForEach,%Element%,%InputLocale1%,Delim=;,Begin
|
ForEach,%Element%,%InputLocale1%,Delim=;,Begin
|
||||||
StrFormat,Pos,%Element%,"{",%Pos%
|
StrFormat,Pos,%Element%,"{",%Pos%
|
||||||
If,%Pos%,Equal,0,List,Append,%CleanInputLocale1%,%Element%,Delim=;
|
If,%Pos%,Equal,0,List,Append,%CleanInputLocale1%,%Element%,Delim=;
|
||||||
|
Else,Echo,"Dropped invalid input locale [%Element%]",WARN
|
||||||
End
|
End
|
||||||
Set,%InputLocale1%,%CleanInputLocale1%
|
Set,%InputLocale1%,%CleanInputLocale1%
|
||||||
Echo,"Dropped invalid input locales",WARN
|
|
||||||
End
|
End
|
||||||
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%
|
IniRead,"%ProjectTemp%\Get-Intl.ini","International","User locale for default user",%UserLocale%
|
||||||
// Fallback to another term in Get-Intl.ini
|
// Fallback to another term in Get-Intl.ini
|
||||||
If,%UserLocale%,Equal,"",IniRead,"%ProjectTemp%\Get-Intl.ini","International","Default system UI language",%UserLocale%
|
If,%UserLocale%,Equal,"",IniRead,"%ProjectTemp%\Get-Intl.ini","International","Default system UI language",%UserLocale%
|
||||||
// Fallback to LocaleName from HKCU\Control Panel\International
|
// 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
|
||||||
// sometimes fails due to invalid content like de-EN that breaks dism call
|
|
||||||
If,%UserLocale%,Equal,"",RegRead,HKCU,"Control Panel\International","LocaleName",%UserLocale%
|
If,%UserLocale%,Equal,"",RegRead,HKCU,"Control Panel\International","LocaleName",%UserLocale%
|
||||||
End
|
End
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user