Unattend for Regional and Language Options in Vista

Sorting it all Out
Michael Kaplan's random stuff of dubious value
Be sure to read the disclaimer here first!

Unattend for Regional and Language Options in Vista

  • Comments 12

In previous posts, I have talked about the unattend mode of Regional and Language Options.

And in the most recent of those, I promised to talk about the changes in Vista. So that is what is happening in this very post!

WARNING: The stuff covered here will not work in Windows prior to Vista....

Some of the exciting features that were added may be small items, but a few of them have been requested for a very very long time:

  • No more failures when you try to install more than nine keyboards at a time;
  • You can now remove keyboard layouts -- keyboard layout list modification is no longer an "add only" feature;
  • Individual settings you can see in the Regional and Language Options UI can now be changed (previously you could only change the user locale, not the settings in it) -- this is a much easier way to handle the SetLocaleInfo notification issue;
  • Failures are written to the event log (previously they were only written to a \windows\regopt.log);
  • You can choose whether you want to reset all of the override settings when you change the user locale (this is a feature you can use to reset the current user locale);
  • Just as with the Vista UI, the ability to apply settings to either the default user account or to the system accounts exists;
  • Support for the MUI feature of optional fallback language in addition to UI language.

One of the big new changes, to go along with all of the changes to Vista's unattend during setup story in general, is a move to an XML file format rather than the old text file format used previously....

To run it, make sure you follow that advice I gave about control.exe, instead of rundll32.exe like that KB article suggests:

control.exe intl.cpl,,/f:"c:\Unattend.xml"

A sample of the XML file that should work in Beta 2 of Vista (and probably most other builds, this functionality has been in there for a while now!) can be seen below:

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">

    <!-- user list -->
    <gs:UserList>
        <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/>
    </gs:UserList>

    <!-- GeoID -->
    <gs:LocationPreferences>
        <gs:GeoID Value="134"/>
    </gs:LocationPreferences>

    <!-- UI Language Prefernces -->
    <gs:MUILanguagePreferences>
        <gs:MUILanguage Value="cy-GB"/>
        <gs:MUIFallback Value="en-GB"/>
    </gs:MUILanguagePreferences>

    <!-- system locale -->
    <gs:SystemLocale Name="en-GB"/>

    <!-- input preferences -->
    <gs:InputPreferences>
        <gs:InputLanguageID Action="add" ID="0409:00000409"/>
        <gs:InputLanguageID Action="remove" ID="0409:00000409"/>
        <!--bs-Latn-BA--><gs:InputLanguageID Action="add" ID="141a:0000041a"/>
        <!--cy-GB--><gs:InputLanguageID Action="add" ID="0452:00000452"/>
        <!--cy-GB--><gs:InputLanguageID Action="add" ID="0809:00000809"/>
    </gs:InputPreferences>

    <!-- user locale -->
    <gs:UserLocale>
        <gs:Locale Name="en-US" SetAsCurrent="true" ResetAllSettings="false">
            <gs:Win32>
                <gs:iCalendarType>1</gs:iCalendarType>
                <gs:sList>...</gs:sList>
                <gs:sDecimal>;;</gs:sDecimal>
                <gs:sThousand>::</gs:sThousand>
                <gs:sGrouping>1</gs:sGrouping>
                <gs:iDigits>2</gs:iDigits>
                <gs:iNegNumber>2</gs:iNegNumber>
                <gs:sNegativeSign>(</gs:sNegativeSign>
                <gs:sPositiveSign>=</gs:sPositiveSign>
                <gs:sCurrency>kr</gs:sCurrency>
                <gs:sMonDecimalSep>,,</gs:sMonDecimalSep>
                <gs:sMonThousandSep>...</gs:sMonThousandSep>
                <gs:sMonGrouping>3</gs:sMonGrouping>
                <gs:iCurrDigits>1</gs:iCurrDigits>
                <gs:iCurrency>3</gs:iCurrency>
                <gs:iNegCurr>3</gs:iNegCurr>
                <gs:iLZero>0</gs:iLZero>
                <gs:sTimeFormat>:HH:m:s tt:</gs:sTimeFormat>
                <gs:s1159>a.m.</gs:s1159>
                <gs:s2359>p.m.</gs:s2359>
                <gs:sShortDate>d/M/yy</gs:sShortDate>
                <gs:sLongDate>dddd, MMMM yyyy</gs:sLongDate>
                <gs:iFirstDayOfWeek>6</gs:iFirstDayOfWeek>
                <gs:iFirstWeekOfYear>2</gs:iFirstWeekOfYear>
                <gs:sNativeDigits>0246813579</gs:sNativeDigits>
                <gs:iDigitSubstitution>1</gs:iDigitSubstitution>
                <gs:iMeasure>0</gs:iMeasure>
                <gs:iTwoDigitYearMax>2021</gs:iTwoDigitYearMax>
            </gs:Win32>
        </gs:Locale>
    </gs:UserLocale>

</gs:GlobalizationServices>

Note the use of comments in the XML. :-)

Now as was true in the old format, you only have to include the sections that you have changes in. However, at a minimum you must always have the following skeleton:

<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">

    <!-- user list -->
    <gs:UserList>
        <gs:User UserID="Current"/>
    </gs:UserList>

</gs:GlobalizationServices>

WARNING: Since I am a person who did not look at the event log when I could not get a file to work, you can save yourself a lot of time if you don't forget to add that "gs:UserList" tag!

Anticipating another question -- at present only the "Current" user is supported.

But don't worry. Think of this as another one of those instances where potential features in future versions are poking their heads out for people to gawk at! :-)

Now of course if anything changes between now and Vista shipping I will post again with whatever the updates are....

Anticpating another response -- the current plan of record is that the old text files will have to be converted to the new format, though of course that is a bigger issue than just Regional and Language Options -- it affects the unattend files for all of Vista. But I'll keep you updated on this issue if I hear anything else.

Now I am sure there are things I am forgetting, but I will make sure to add those in the future, too. :-)

 

This post brought to you by "" (U+183d, a.k.a. MONGOLIAN LETTER ZA) 

Comment on the blather
Leave a Comment
  • Please add 3 and 5 and type the answer here:
  • Post
Blog - Comment List
  • OK, my turn to be a wet nilly. :)

    Did the team also get around to fixing the 'thou shall not turn off the hot keys for input languages'. Whenever I install a new keyboard language, I must remember not to touch CTRL+ALT or whatever. Many of my users switch between english and norwegian keyboard layout all the time, without realising just why that is...

    On a related note, I sometimes sleep on the SHIFT key while figuring out what key to hit next, and that turned in to a big no-no a couple of Windows versions ago.

    It would be much easier if all this was turned off by default... (incididentally: It is much easier to install Win2003 as a workstation OS -- there are way fewer settings that are messed up by default)

    --
    Rune
  • Hi Rune,

    We are talking about different teams here -- every application has the ability add shortcuts, and there is no way to stop them when they do.
  • Dans mon précédent billet consacré aux paramètres régionaux de Windows XP, je détaillais l’utilisation

  • You may have read my previous post on the 'unattend' file format info for Vista, creatively titled Unattend

  • Question!  I see that sort order is not one of the options under user locale, which makes sense because sort order is not a parameter, but attached to LCID.  However, it seems that user locale is determined by NAME in this example, so I'm stumped trying to figure out how to create an unattend answer file like this one where I specify that I want, for example, the alternative Japanese sorting mechanism.  Can I somehow specify the locale I want by LCID instead of NAME?  -RH

  • On close to the second anniversary of my blog Unattend for Regional and Language Options in Vista , Ryan

  • Hey there,

    I seem to have a problem with the value of <gs:sCurrency>kr</gs:sCurrency>

    i whant to change it to the € sign. But when i check my settings he gives an error on /gs:sCurrency> . (I checked this with Internet Explorer and also had an error in eventvwr).

    I am trying this on a vista machine with SP1.

  • Is it possible to set the default input method to the language pack's defaults?

    The "defaults" are described here - http://technet.microsoft.com/en-us/library/cc766191(WS.10).aspx

    However, I find it that, once I installed & applied the ru-RU language pack with the following XML, the default keyboard layout was still English. Russian was enalbed, so that's halfway there.

    <gs:GlobalizationServices xmlns:gs=\"urn:longhornGlobalizationUnattend\">
      <gs:UserList>
         <gs:User UserID=\"Current\" CopySettingsToDefaultUserAcct=\"true\" CopySettingsToSystemAcct=\"true\"/>
      </gs:UserList>;
      <gs:MUILanguagePreferences>
         <gs:MUILanguage Value=\"" + sLLCC + "\"/>
      </gs:MUILanguagePreferences>;
      <gs:UserLocale>
         <gs:Locale Name=\"" + sLLCC + "\" SetAsCurrent=\"true\" ResetAllSettings=\"false\"/>
      </gs:UserLocale>
      <gs:SystemLocale Name=\"" + sLLCC + "\"/>
    </gs:GlobalizationServices>

  • And the reason I don't want to specify the input method by providing the InputMethodID value is because:

    1) I don't want to keep a list of IDs for each language pack language myself

    2) I don't know what to plug in for an IME

  • There is no way to change the default of a language pack, and intl.cpl has no mechanism itself to run code to process the XML file you specify there -- so it will fail if you pass it straight in....

    For IMEs you just need the Guids for the given IME.

  • Hi  Micheal,

    Can you please suggest how to do this same thing in Windows Server 2008 R2.???

    I wanted to get Unattended file for Regional and Language Options in Windows Server 2008 R2, But I could not find.

    Can you please help?

  • Pingback from  Installatie van multi language packs via commandline in Windows 2008 R2/Windows 7 | bITs of thoughts

Page 1 of 1 (12 items)