cschneegans/unattend-generator

[Bug & proposal]Bugs related to language and region

Closed this issue ยท 18 comments

1.The home location setting seems to be overridden by Format dates, times, currency, and numbers arranging
2.Can a second preferred language be added to the unattended file
image
image
image

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:

playground-2024-08-19-00-48-31

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

playground-2024-08-19-00-50-12

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:

image

I didn't see the language selector screen

@cschneegans

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:

image

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:

image

I have realized that my own form is misleading as well. I have redesigned the form to make it clearer how the 1st, 2nd and 3rd language preference are related:

image

image
It seems that it still doesn't work

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:

image

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?

Using your autounattend.xml file and the Win11_23H2_Chinese_Simplified_x64v2.iso image, I get this result:

image

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:

  1. Open Windows PowerShell.
  2. Type Get-WinHomeLocation and press Enter.
  3. Type Set-WinHomeLocation -GeoId 244 and press Enter.
  4. 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
image
image

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.