Sorting it all Out Michael Kaplan's random stuff of dubious value Be sure to read the disclaimer here first!
Paul Langton asked via the contact link:
Gday Michael, Firstly, love the blog and though a lot of it is waaaay over my head its always a great read, I'd go so far to say the best of all the MSDN blogs that I've sampled. OK suck up out of the way, I have a VB script that does the same function as ticking the two tickboxes in "Supplemental language support" - i.e. "Install files for complex script and right to left languages (including Thai)" and "Install Files for East Asian Languages": Dim oShell ' Windows Scripting Host shellDim oFSO ' File system objectDim sCurDir ' Script pathDim sWinDir ' Windows root path '=======================================================================' Main'On Error Resume Next Set oShell = CreateObject("WScript.Shell")Set oFSO = CreateObject("Scripting.FileSystemObject") sCurDir = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\") - 1)sWinDir = oShell.ExpandEnvironmentStrings ("%WinDir%") ' Install "Supplemental Language Support" oShell.Run sWinDir & "\system32\rundll32.exe advpack.dll,LaunchINFSection " & sCurDir & "\intl.inf,LANGUAGE_COLLECTION.COMPLEX.INSTALL", 1, 1 oShell.Run sWinDir & "\system32\rundll32.exe advpack.dll,LaunchINFSection " & sCurDir & "\intl.inf,LANGUAGE_COLLECTION.EXTENDED.INSTALL", 1, 1 My question is - what is the best way to detect if these are already enabled so when it is run it doesn't reinstall all this stuff? Rgds,Paul
Gday Michael,
Firstly, love the blog and though a lot of it is waaaay over my head its always a great read, I'd go so far to say the best of all the MSDN blogs that I've sampled.
OK suck up out of the way, I have a VB script that does the same function as ticking the two tickboxes in "Supplemental language support" - i.e. "Install files for complex script and right to left languages (including Thai)" and "Install Files for East Asian Languages":
Dim oShell ' Windows Scripting Host shellDim oFSO ' File system objectDim sCurDir ' Script pathDim sWinDir ' Windows root path '=======================================================================' Main'On Error Resume Next Set oShell = CreateObject("WScript.Shell")Set oFSO = CreateObject("Scripting.FileSystemObject") sCurDir = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\") - 1)sWinDir = oShell.ExpandEnvironmentStrings ("%WinDir%") ' Install "Supplemental Language Support" oShell.Run sWinDir & "\system32\rundll32.exe advpack.dll,LaunchINFSection " & sCurDir & "\intl.inf,LANGUAGE_COLLECTION.COMPLEX.INSTALL", 1, 1 oShell.Run sWinDir & "\system32\rundll32.exe advpack.dll,LaunchINFSection " & sCurDir & "\intl.inf,LANGUAGE_COLLECTION.EXTENDED.INSTALL", 1, 1
Dim oShell ' Windows Scripting Host shellDim oFSO ' File system objectDim sCurDir ' Script pathDim sWinDir ' Windows root path
'=======================================================================' Main'On Error Resume Next
Set oShell = CreateObject("WScript.Shell")Set oFSO = CreateObject("Scripting.FileSystemObject")
sCurDir = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\") - 1)sWinDir = oShell.ExpandEnvironmentStrings ("%WinDir%")
' Install "Supplemental Language Support"
oShell.Run sWinDir & "\system32\rundll32.exe advpack.dll,LaunchINFSection " & sCurDir & "\intl.inf,LANGUAGE_COLLECTION.COMPLEX.INSTALL", 1, 1
oShell.Run sWinDir & "\system32\rundll32.exe advpack.dll,LaunchINFSection " & sCurDir & "\intl.inf,LANGUAGE_COLLECTION.EXTENDED.INSTALL", 1, 1
My question is - what is the best way to detect if these are already enabled so when it is run it doesn't reinstall all this stuff?
Rgds,Paul
Ok, first of all -- Paul, don't ever do this!
The code that does the installation of these components does indeed perform these steps, but it also does more than that -- and if you do only these things then you will probably findout at some point that not everything works as you want it to.
This is obviously bad.
The way to get this done is to use the method given in KB article 289125. Just install one of the East Asian and one of the Complex script locales and it will perform ALL of the installation steps, rather than just the ones you want.
And now to the actual question -- how to know when to skip this due to the installation already happening?
Well, you can actually use the old IsValidLocale function on any of the locales that is within one of the language groups in question (e.g. 0x0411 which is Japanese or 0x041e which is Thau) using the LCID_INSTALLED flag, or the IsValidLanguageGroup function to check the actual language groups and see if they are installed.
Now all of this is useful to remember, especially in the context of What isn't in the default install for NLS and Language groups -- the vestigial tail of NLS, especially since they give some use for language groups. :-)
But please try to avoid depending on anything in the INFs, since that is undocumented, unsupported, subject to change, and is changing massively in Vista....
This post brought to you by "ૐ" (U+0ad0, a.k.a. GUJARATI OM)