' // *************************************************************************** ' // ' // Copyright (c) Microsoft Corporation. All rights reserved. ' // ' // Microsoft Deployment Toolkit Solution Accelerator ' // ' // File: DeployWiz_LanguagePack.vbs ' // ' // Version: 6.3.8456.1000 ' // ' // Purpose: Wizard pane for choosing one or more language packs for install ' // ' // *************************************************************************** Option Explicit dim g_oXMLLanguageList Function oXMLLanguageList If IsEmpty(g_oXMLLanguageList) then Set g_oXMLLanguageList = oUtility.LoadConfigFileSafe( "scripts\ListOfLanguages.xml" ) End if Set oXMLLanguageList = g_oXMLLanguageList End function dim g_oPackageGroup '''''''''''''''''''''''''''''''''''''' Function MarkupName(LocaleName) Dim oLang, width width = 99 For each oLang in oXMLLanguageList.selectNodes("//LOCALEDATA/LOCALE/SISO639LANGNAME") If Instr(1,LocaleName,oLang.Text & "-", vbTextCompare) = 1 and len(oLang.Text) < width then width = len(oLang.Text) MarkupName = unescape(replace(oUtility.SelectSingleNodeString(oLang.ParentNode,"SENGLANGUAGE"),"\x","%u")) & " (" & _ LocaleName & ")" End if Next End Function Function ConstructLPQuery ( isLangPack ) Dim Keyword Dim isServer Dim ImgBuild Dim SPVersion Dim LPQuery Dim LPVersion Dim i isServer = inStr(1,oEnvironment.Item("ImageFlags"),"SERVER",vbTextCompare) <> 0 ImgBuild = oEnvironment.Item("ImageBuild") If isServer then LPQuery = "PackageType = 'LanguagePack' and ( ProductName = 'Microsoft-Windows-Server-LanguagePack-Package' or ProductName = 'Microsoft-Windows-Server-Refresh-LanguagePack-Package' or ProductName = 'Microsoft.LanguageExperiencePack')" Else LPQuery = "PackageType = 'LanguagePack' and ( ProductName = 'Microsoft-Windows-Client-LanguagePack-Package' or ProductName = 'Microsoft-Windows-Client-Refresh-LanguagePack-Package' or ProductName = 'Microsoft.LanguageExperiencePack')" End if If not isLangPack then LPQuery = "PackageType != 'LanguagePack' and (substring(ProductVersion,1,8) = '" & left(ImgBuild,8) & "' or ProductVersion = '') " ElseIf isServer and left(ImgBuild,4) = "6.0." then ' All Windows Server 2008 Language Packs use Product Version 6.0.6001.18000 LPQuery = LPQuery & " and substring(ProductVersion,1,8) = '6.0.6001' " ElseIf left(ImgBuild,4) = "6.0." then ' All Windows Vista Language Packs use Product Version 6.0.6000.16386 LPQuery = LPQuery & " and substring(ProductVersion,1,8) = '6.0.6000' " Else LPQuery = LPQuery & " and substring(ProductVersion,1,7) = '" & left(ImgBuild,7) & "' and substring(ProductVersion,5,4) >= '" & mid(ImgBuild,5,4) & "'" End if If not isLangPack then ' Nothing ElseIf left(ImgBuild,4) = "6.0." then LPVersion = Mid(ImgBuild,8,1) If IsNumeric(LPVersion) and LPVersion > 0 then ' Exclude all Language Packs that are less than the Current OS. LPQuery = LPQuery & " and Keyword != 'Language Pack'" For i = 2 to LPVersion LPQuery = LPQuery & " and Keyword != 'SP" & (LPVersion - 1) & " Language Pack'" Next End if End if If UCase(oEnvironment.Item("ImageProcessor")) = "X64" then LPQuery = "//packages/package[(ProcessorArchitecture = 'amd64' or ProcessorArchitecture = 'neutral') and " & LPQuery & "]" Else LPQuery = "//packages/package[(ProcessorArchitecture = 'x86' or ProcessorArchitecture = 'neutral') and " & LPQuery & "]" End if oLogging.CreateEntry vbTab & "QUERY: " & LPQuery, LogTypeInfo ConstructLPQuery = LPQuery End function Dim g_oXMLPackageList Dim g_sPackageDialogBox Function CanDisplayPackageDialogBox Dim dXMLCollection Dim LocalLanguage Dim oItem Dim sInputType Dim sDone Dim oNewItem Dim sToAdd ' Load and cache the application list If IsEmpty(g_oXMLPackageList) then Set g_oXMLPackageList = new ConfigFile g_oXMLPackageList.sFileType = "Packages" End if ' Get the list of language packs g_oXMLPackageList.sSelectionProfile = oEnvironment.Item("WizardSelectionProfile") g_oXMLPackageList.sCustomSelectionProfile = oEnvironment.Item("CustomWizardSelectionProfile") Set g_oXMLPackageList.fnCustomFilter = GetRef("CustomPackageFilter") Set dXMLCollection = g_oXMLPackageList.FindItemsEx(ConstructLPQuery(TRUE)) If dXMLCollection.count = 0 then CanDisplayPackageDialogBox = False Exit Function End if CanDisplayPackageDialogBox = TRUE oLogging.CreateEntry "CanDisplayPackageDialogBox = TRUE", LogTypeVerbose ' Ultimate and Enterprise SKU's allow for more than one Language Pack to be installed at a time. If IsInstallationUltimateEnterprise Then g_sPackageDialogBox = g_oXMLPackageList.GetHTMLEx( "CheckBox", "LanguagePacks" ) Else ' Convert property LanguagePacks back into a non-array if it's an array. If isArray(property("LanguagePacks")) then oProperties.Item("LanguagePacks") = property("LanguagePacks")(0) End if g_sPackageDialogBox = g_oXMLPackageList.GetHTMLEx( "Radio", "LanguagePacks" ) End if ' Ensure that the default Language Pack has been added to the list. for each oItem in oEnvironment.ListItem("ImageLanguage").Keys g_sPackageDialogBox = "  (Already installed in OS)" & vbNewLine & g_sPackageDialogBox g_sPackageDialogBox = "