rv = reg->SelectLocale(info->GetArguments(), PR_TRUE);
NS_ConvertUCS2toUTF8 utf8Args(info->GetArguments()); rv = reg->SelectLocale(utf8Args, PR_TRUE);
extern "C" void RunChromeInstallOnThread(void *data){    nsresult rv;    NS_ASSERTION(data, "No nsInstallInfo passed to Chrome Install");    nsInstallInfo *info = (nsInstallInfo*)data;    nsIXPIListener* listener = info->GetListener();    if (listener)        listener->OnInstallStart(info->GetURL());    // make sure we've got a chrome registry -- can't proceed if not    nsIXULChromeRegistry* reg = info->GetChromeRegistry();    if (reg)    {        // build up jar: URL        nsCString spec;        spec.SetCapacity(200);        spec = "jar:";        nsCOMPtr<nsIURI> pURL;        rv = NS_NewURI(getter_AddRefs(pURL), "file:");        if (NS_SUCCEEDED(rv))        {            nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(pURL);            if (fileURL)                rv = fileURL->SetFile(info->GetFile());            else                rv = NS_ERROR_NO_INTERFACE;            if (NS_SUCCEEDED(rv))            {                nsCAutoString localURL;                rv = fileURL->GetSpec(localURL);                spec.Append(localURL);                spec.Append("!/");            }        }        // Now register the new chrome        if (NS_SUCCEEDED(rv))        {            PRBool isSkin    = (info->GetType() & CHROME_SKIN);            PRBool isLocale  = (info->GetType() & CHROME_LOCALE);            PRBool isContent = (info->GetType() & CHROME_CONTENT);            PRBool selected  = (info->GetFlags() != 0);            if ( isContent )            {                rv = reg->InstallPackage(spec.get(), PR_TRUE);            }            if ( isSkin )            {              rv = reg->InstallSkin(spec.get(), PR_TRUE, PR_FALSE);                if (NS_SUCCEEDED(rv) && selected)                {                    rv = reg->SelectSkin(info->GetArguments(), PR_TRUE);                }            }            if ( isLocale )            {                rv = reg->InstallLocale(spec.get(), PR_TRUE);                if (NS_SUCCEEDED(rv) && selected)                {                    rv = reg->SelectLocale(info->GetArguments(), PR_TRUE);                }            }            // now that all types are registered try to activate            if ( isSkin && selected )                reg->RefreshSkins();#ifdef RELOAD_CHROME_WORKS// XXX ReloadChrome() crashes right now            if ( isContent || (isLocale && selected) )                reg->ReloadChrome();#endif        }    }    if (listener)        listener->OnInstallDone(info->GetURL(), nsInstall::SUCCESS);    delete info;}