cloudbase / windows-imaging-tools

Tools to automate the creation of a Windows image for OpenStack, supporting KVM, Hyper-V, ESXi and more.
Apache License 2.0
670 stars 227 forks source link

Change locale settings #325

Closed T0schi closed 4 years ago

T0schi commented 4 years ago

Hi, i´ve tried to to create a German Win10 Pro (1809) Image. I´ve used a German language ISO and got an image with German display language but with US locale settings (keyboard layout, locale settings, date/time format). The ways i tried this were with PS Settings Set-WinHomeLocation -GeoID 94 $1 = New-WinUserLanguageList -Language "de-DE" Set-WinUserLanguageList $1 Set-WinSystemLocale de-DE Set-Culture 'de-DE'

and Regitry values in /CustomCommands/RunBeforeWindowsUpdates.ps1 reg add "HKCU\Control Panel\International\Geo" v/ Name /t REG_SZ /d DE /f reg add "HKCU\Control Panel\International\Geo" v/ Nation /t REG_SZ /d 94 /f reg add "HKCU\Software\Microsoft\CTF\SortOrder\Language\" /v 00000000 /t REG_SZ /d 00000407 /f reg add "HKCU\Software\Microsoft\CTF\SortOrder\Language\" /v 00000001 /t REG_SZ /d 00000409 /f reg add "HKCU\Keyboard Layout\Preload\" /v 1 /t REG_SZ /d 00000407 /f reg add "HKCU\Keyboard Layout\Preload\" /v 2 /t REG_SZ /d 00000409 /f

but it seems that this values are not being set or are overwritten afterwards.

Where is the right place to set this custom values or rather how can i refer on an own Unattend file?

ader1990 commented 4 years ago

You can change https://github.com/cloudbase/windows-openstack-imaging-tools/blob/master/UnattendTemplate.xml#L69 to define the locale.

ader1990 commented 4 years ago

HKCU means current user hive, which will be reset during sysprep.

T0schi commented 4 years ago

Thank you for the hint, i had to set all values to de-DE in the lines 67-72 and 146 -150 till it worked. Changing the value in L69 was not enough in my case.