[Bug & proposal]Bugs related to language and region
Closed this issue ยท 18 comments
To be honest, I probably never tested with Chinese images. There might be a more fundamental problem here.
I have downloaded the Win11_23H2_Chinese_Simplified_x64v2.iso
image and created an autounattend.xml file with the settings shown in your first screenshot. Windows Setup then displays this language selection dialog:
This is not the expected behavior. Windows Setup should instead use the language settings from the autounattend.xml file. Did you also see this dialog? What image did you use? Also, please attach the autounattend.xml file that you have generated.
The unexpected behavior might be related to this log message written to the X:\Windows\Panther\setupact.log
file:
Target language [zh-Hans-CN] is NOT a valid language
This is not the expected behavior. Windows Setup should instead use the language settings from the autounattend.xml file. Did you also see this dialog? What image did you use? Also, please attach the autounattend.xml file that you have generated.
Yes, I did see this window
My unattended file
I have noticed Win11_23H2_Chinese_Simplified_x64v2.iso
contains a \sources\lang.ini
file with contents
[Available UI Languages]
zh-cn = 3
and Win11_23H2_Chinese_Traditional_x64v2.iso
contains a \sources\lang.ini
file with contents
[Available UI Languages]
zh-tw = 3
Therefore, I have replaced the UI language code zh-Hans-CN
with zh-CN
, and zh-Hant-CN
with zh-TW
via
5a25a4f. This works well in my tests, i.e. the manual language dialog does not longer appear. Thank you for bringing this to my attention.
Existing URLs that use the zh-Hans-CN
or zh-Hant-CN
codes will be redirected automatically โ so just open the form with your previous inputs and download the autounattend.xml file again.
Please run your Windows installation with the new autounattend.xml file and check if the issue is resolved.
@cschneegans, I did a test run with your changes and it looks like it works:
I didn't see the language selector screen
Thank you for resolving the main issue, but there is another proposal here
2.Can a second preferred language be added to the unattended file
Do you have any solutions for it
I think the UI on this screen is somewhat misleading:
By clicking the Add a language button, you don't add a preferred language to Windows, you just add a language. The preference is rather established by the order of the languages.
Hence, setting your preferred language(s) is already possible in the form:
As I can't read Chinese characters, I had a hard time to even figure out that your screenshot shows the Country or region and Regional format settings. FWIW, this is what that section looks like on my computer:
You need to specify:
โข What autounattend.xml settings did you use? (You can just upload your file here.)
โข What was the expected result for the Country or region and Regional format settings?
โข What was the actual result, i.e. what Country or region and Regional format settings are shown on your screenshot?
The box above shows China
Using your autounattend.xml file and the Win11_23H2_Chinese_Simplified_x64v2.iso
image, I get this result:
According to Google, ็พๅฝ is Chinese for United States, so I think the Country or region setting was applied correctly. I don't know why you are getting a different result. Please do the following:
- Open Windows PowerShell.
- Type
Get-WinHomeLocation
and press Enter. - Type
Set-WinHomeLocation -GeoId 244
and press Enter. - Type
Get-WinHomeLocation
again and press Enter.
Copy and paste the entire output here.
I have currently identified the problem:
UUP image bug or NTLite encapsulation bug
After my testing, I discovered the reason
I removed PowerShell from NTLite
And in autounattend.xml, it is precisely using
PowerShell command Set-WinHomeLocation
completes region switch
But that doesn't mean I can't remove PowerShell
Because I found that such code is unnecessary
Actually, I only need to modify these four lines in autounattend.xml to achieve the purpose of setting the region
So, I need you to modify the source code so that it directly sets<SystemLocale>
and<UserLocale>
Instead of using PowerShell
I disagree. System locale, user locale and the home location are three distinct settings, and there is no XML element that sets the home location.
However, it appears that you can set the home location via the registry. Try using this .reg file in the Scripts to run whenever a user logs on for the first time section:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\International\Geo]
"Nation"="244"
"Name"="US"
This link will configure the form to use the .reg file and the settings from the autounattend.xml file you posted earlier.
I disagree. System locale, user locale and the home location are three distinct settings, and there is no XML element that sets the home location.
I think<SystemLocale>
and<UserLocale>
can also be optional settings for unattend-generator
A new idea
Create Oobe.xml
before OOBE startup
Using the parameter <location>
in Oobe. xml
Save in Windows\System32\Oobe\Info
Delete files after OOBE ends
Look, the autounattend.xml files created by my generator rely heavily on PowerShell, and I have no plans to change this. If you decide to remove PowerShell, you are on your own.