Difference between revisions of "Multi language"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
Line 1: Line 1:
To use wpkg in an environment where there are machines with different languages I use the following script to start wpkg. It will start wpkg with /base arguement and insert the LCID  (decimal) as subdir in the path [http://www.microsoft.com/globaldev/nlsweb/].
+
To use wpkg in an environment where there are machines with different languages I use the following script to start wpkg. Save this script as run-wpkg.js and start it with <pre>cscript run-wpkg.js</pre>
 +
 
 +
It will start wpkg with /base arguement and insert the LCID  (decimal) as subdir in the path [http://www.microsoft.com/globaldev/nlsweb/]. For example: "/base:\\server\wpkg\1031\" for a german Windows.
 
For each language i have a subdirectory with packages.xml, profiles.xml and hosts.xml. This will make it possible to have nearly identical packages for multiple languages (e.g. KB fixpacks) which only differ in the install string argument.
 
For each language i have a subdirectory with packages.xml, profiles.xml and hosts.xml. This will make it possible to have nearly identical packages for multiple languages (e.g. KB fixpacks) which only differ in the install string argument.
  

Revision as of 06:44, 22 November 2005

To use wpkg in an environment where there are machines with different languages I use the following script to start wpkg. Save this script as run-wpkg.js and start it with
cscript run-wpkg.js

It will start wpkg with /base arguement and insert the LCID (decimal) as subdir in the path [1]. For example: "/base:\\server\wpkg\1031\" for a german Windows. For each language i have a subdirectory with packages.xml, profiles.xml and hosts.xml. This will make it possible to have nearly identical packages for multiple languages (e.g. KB fixpacks) which only differ in the install string argument.

var wbemFlagReturnImmediately = 0x10;
var wbemFlagForwardOnly = 0x20;

   var objWMIService = GetObject("winmgmts:\\\\.\\root\\CIMV2");
   var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL",
                                          wbemFlagReturnImmediately | wbemFlagForwardOnly);

   var enumItems = new Enumerator(colItems);
   for (; !enumItems.atEnd(); enumItems.moveNext()) {
      var objItem = enumItems.item();

      WScript.Echo("LangCode: " + objItem.OSLanguage);
      WScript.Echo("Locale: " + objItem.Locale);
      WScript.Echo();


      var objShell = WScript.CreateObject("WScript.Shell");
      var runString = "cscript \\\\Server\\wpkg\\wpkg.js /base:\\\\server\\wpkg\\" +
 objItem.OSLanguage + " \\\\server\\wpkg\\wpkg.js /synchronize";
      WScript.Echo(runString);
      objShell.Run(runString);

   }