Installable language components in Internet Explorer

by Michael S. Kaplan, published on 2006/01/15 20:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/01/15/512992.aspx


The other day, someone with the handle of ox asked in the microsoft.public.win32.programmer.international newsgroup:

how to check in my code if a kind of language pack installed. For
example, on english version winxp, while you access a Chinese website,
system will prompt you to install Asian language pack. How did. Thanks.

The answer (which I had written up as a part of an MSDN Magazine article from a few years back) is to use the Component capability methods that were added back in IE 5.0. The important methods to get the job done are:

and the GUIDs for the various language packs and other components can be found in the Detectable Components in Internet Explorer and Installable Components in Internet Explorer topics. The Language Pack and related GUIDS are:

Component Component ID
Arabic Text Display Support {76C19B38-F0C8-11CF-87CC-0020AFEECF20}
Chinese (Simplified) Text Display Support {76C19B34-F0C8-11CF-87CC-0020AFEECF20}
Chinese (traditional) Text Display Support {76C19B33-F0C8-11CF-87CC-0020AFEECF20}
Hebrew Text Display Support {76C19B36-F0C8-11CF-87CC-0020AFEECF20}
Japanese Text Display Support {76C19B30-F0C8-11CF-87CC-0020AFEECF20}
Korean Text Display Support {76C19B31-F0C8-11CF-87CC-0020AFEECF20}
Pan-European Text Display Support {76C19B32-F0C8-11CF-87CC-0020AFEECF20}
Thai Text Display Support {76C19B35-F0C8-11CF-87CC-0020AFEECF20}
Vietnamese Text Display Support {76C19B37-F0C8-11CF-87CC-0020AFEECF20}
Language Auto-Selection {76C19B50-F0C8-11CF-87CC-0020AFEECF20}
Uniscribe {3BF42070-B3B1-11D1-B5C5-0000F8051515}

I even wrote up a nice "how to really annoy readers of your website" page that would try to install of the language components even though it used none of them. I am providing the HTML for this page below (to use it just copy it, paste it into Notepad, and then open it in IE). For obvious reasons I did not include this code behind any pages on this blog. :-)

The technology has largely been passed over at this point, but getting people running earlier versions to get language support was once a very compelling technology.

Enjoy!

 

This post brought to you by "" (U+0ddd, a.k.a. SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA)
(A letter that does not have its own language pack for IE)


<HTML xmlns:IE>
<HEAD>
<STYLE>
@media all { IE\:clientCaps {behavior:url(#default#clientCaps)}}
</STYLE>

<SCRIPT>
function window.onload()
{
   var fAra,fChs,fCht,fHeb,fJpn,fKor,fEur,fTha,fVie,fUni;
   var fInstallWorked=false;
   var sAraID= "{76C19B38-F0C8-11CF-87CC-0020AFEECF20}";
   var sChsID= "{76C19B34-F0C8-11CF-87CC-0020AFEECF20}";
   var sChtID= "{76C19B33-F0C8-11CF-87CC-0020AFEECF20}";
   var sHebID= "{76C19B36-F0C8-11CF-87CC-0020AFEECF20}";
   var sJpnID= "{76C19B30-F0C8-11CF-87CC-0020AFEECF20}";
   var sKorID= "{76C19B31-F0C8-11CF-87CC-0020AFEECF20}";
   var sEurID= "{76C19B32-F0C8-11CF-87CC-0020AFEECF20}";
   var sThaID= "{76C19B35-F0C8-11CF-87CC-0020AFEECF20}";
   var sVieID= "{76C19B37-F0C8-11CF-87CC-0020AFEECF20}";
   var sUniID= "{3BF42070-B3B1-11D1-B5C5-0000F8051515}"; 

   // find out if a language is not installed
   fAra= (!(oClientCaps.isComponentInstalled(sAraID,"componentid")))
   fChs= (!(oClientCaps.isComponentInstalled(sChsID,"componentid")))
   fCht= (!(oClientCaps.isComponentInstalled(sChtID,"componentid")))
   fHeb= (!(oClientCaps.isComponentInstalled(sHebID,"componentid")))
   fJpn= (!(oClientCaps.isComponentInstalled(sJpnID,"componentid")))
   fKor= (!(oClientCaps.isComponentInstalled(sKorID,"componentid")))
   fEur= (!(oClientCaps.isComponentInstalled(sEurID,"componentid")))
   fTha= (!(oClientCaps.isComponentInstalled(sThaID,"componentid")))
   fVie= (!(oClientCaps.isComponentInstalled(sVieID,"componentid")))
   fUni= (!(oClientCaps.isComponentInstalled(sUniID,"componentid")))

   // if support for any language is unavailable, mark it to be installed
   if (fAra) oClientCaps.addComponentRequest(sAraID, "componentid");
   if (fChs) oClientCaps.addComponentRequest(sChsID, "componentid");
   if (fCht) oClientCaps.addComponentRequest(sChtID, "componentid");
   if (fHeb) oClientCaps.addComponentRequest(sHebID, "componentid");
   if (fJpn) oClientCaps.addComponentRequest(sJpnID, "componentid");
   if (fKor) oClientCaps.addComponentRequest(sKorID, "componentid");
   if (fEur) oClientCaps.addComponentRequest(sEurID, "componentid");
   if (fTha) oClientCaps.addComponentRequest(sThaID, "componentid");
   if (fVie) oClientCaps.addComponentRequest(sVieID, "componentid");
   if (fUni) oClientCaps.addComponentRequest(sUniID, "componentid");
  
   // Do requests, if any were actually made
   if (fAra|fChs|fCht|fHeb|fJpn|fKor|fEur|fTha|fVie|fUni)
   {
       document.write('Must install some languages!');
       fInstallWorked=oClientCaps.doComponentRequest();
       document.write('The return from the doComponentRequest call was: ' + fInstallWorked);
   }
   else
   {
       document.write('All languages are installed!');
   }
}
</SCRIPT>
<Title>The ANNOYING 'install every language on IE' page!</Title>
</HEAD>

<BODY BGCOLOR="#FFFFFF">
   :
   <IE:clientCaps ID="oClientCaps" />
   :
</BODY>



# Maurits [MSFT] on 16 Jan 2006 12:55 PM:

I can't get that code to work, as is.

I suspect that the
if (!fTha)
lines should be
if (fTha) // fTha means Tha is NOT installed

But either way, the doComponentRequest never returns.

I'm on Windows 2000 - I may have checked the "never install language packs" option out of annoyance in foreign email prompting me...

How can I un-"never install"? I tried checking the "Enable Install on Demand" checkboxes but they had no effect.

# Michael S. Kaplan on 16 Jan 2006 2:17 PM:

Whoops -- some double negatives in there! Fixed now....

Of course you would have to make sure that you did not have the appropriate language support installed....

# Maurits [MSFT] on 16 Jan 2006 4:31 PM:

This line

if (fAra|fChs|fCht|fHeb|fJpn|fKor|fEur|fTha|fVie|fUni)

should be

if ((!fAra)||(!fChs)||(!fCht)||(!fHeb)||(!fJpn)||(!fKor)||(!fEur)||(!fTha)||(!fVie)||(!fUni))

But I'm still getting a "permission denied" error on the doComponentRequest(...) line. I'm in the My Computer Zone... I'll try it on a different zone.

# Maurits [MSFT] on 16 Jan 2006 4:37 PM:

Still errors (permission denied) on doComponentRequest

I did a search for how to undo the "never install" checkbox and came up with this thread:

http://www.annoyances.org/exec/forum/winxp/t1065439220

It describes a method to fix it for XP but not for 2000 (bangs head against wall...)

# Michael S. Kaplan on 16 Jan 2006 5:07 PM:

Permission denied kind of speaks for itself, I guess (the big question is whether the install works if you go to a site that needs the script support -- you should get the install happening then).

Ok, fixed the code to get rid of that last problem, to go with your initial fix idea.

# Maurits [MSFT] on 16 Jan 2006 5:15 PM:

Well, I've given up on finding the way to undo that "never install language packs" checkbox in Windows 2000... but the Installable Components page

http://msdn.microsoft.com/workshop/author/behaviors/reference/methods/installable.asp

specifically says

"Note: The following components do not install on demand in Microsoft Windows 2000."

so I guess it's by-design :'(

# Michael S. Kaplan on 16 Jan 2006 5:17 PM:

Well, it will help get those pre-Win2000 machines up to date! :-)

# Maurits [MSFT] on 16 Jan 2006 5:32 PM:

Just noticed this line in your custom CSS:
h2 { font-Variant:small-caps; }

Very nice, especially as a way to test how browsers handle small-cap variants of international characters :)

# Michael S. Kaplan on 16 Jan 2006 5:38 PM:

Thanks Maurits!

I was especially sensitive about the issue raised for the title of *this* post:

http://blogs.msdn.com/michkap/492179.aspx

and I wanted to come up with some kind of override to the behavior. :-)

# Jerry Pisk on 17 Jan 2006 3:31 PM:

Shouldn't GUIDs be random? Must have been a lot of luck getting those sequential ones generated ;)

# Michael S. Kaplan on 17 Jan 2006 4:14 PM:

Hi Jerry --

Tools like guidgen generate the first one and then the rest are sequential.

# Richard on 23 Jan 2006 7:23 AM:

GUID generation was always sequential, but revealed you NIC's MAC. So they were randomised in Win2k (also was the case if you had no NIC).

You can still get sequential ones, from a VS2005 command prompt:
uuidgen /n20 /x
will give sequential ones (/x option).

Wes on 15 Mar 2010 1:53 AM:

thanks a million. the link to how to restore the language pack options helped me out. I have a native Korean customer that has learned to do the basic (click a box to see if it fixes it) surfing thru trial and error with an English xp pro install. he just needed to get the language packs and MUI's installed to fix a lot of his short-comings in the English version.

and now I have some new code to put on my home sever box to test these out :)

thanks again


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2006/07/25 Is East Asian support installed?

go to newer or older post, or back to index or month or day