pjs/xpinstall/packager/windows/langenus.jst

76 строки
2.7 KiB
Plaintext

// main
var srDest;
var err;
var fProgram;
// OS type detection
// which platform?
var platformStr = new String(Install.platform);
var platformNode;
if (!platformStr.search(/^Macintosh/))
platformNode = 'mac';
else if (!platformStr.search(/^Win/))
platformNode = 'win';
else
platformNode = 'unix';
logComment("initInstall: platformNode=" + platformNode);
// end
// end - OS type detection
// ----LOCALIZATION NOTE: translate only these ------
var prettyName = "English (US) Language Pack";
var langcode = "en";
var chromeNode = langcode + "-US";
// --- END CHANGABLE STUFF ---
var regName = "locales/mozilla/" + chromeNode;
var chromeName = chromeNode + ".jar";
var platformName = langcode + "-" + platformNode + ".jar";
var localeName = "locale/" + chromeNode + "/";
srDest = $SpaceRequired$:bin;
err = initInstall(prettyName, regName, "$Version$");
logComment("initInstall: " + err);
fProgram = getFolder("Program");
logComment("fProgram: " + fProgram);
if(verifyDiskSpace(fProgram, srDest))
{
setPackageFolder(fProgram);
err = addDirectory("",
"$Version$",
"bin", // dir name in jar to extract
fProgram, // Where to put this file (Returned from GetFolder)
"", // subdir name to create relative to fProgram
true); // Force Flag
logComment("addDirectory() returned: " + err);
// register chrome
var cf = getFolder("Chrome");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, chromeName), localeName + "global/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, chromeName), localeName + "communicator/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, chromeName), localeName + "messenger/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, chromeName), localeName + "editor/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, chromeName), localeName + "navigator/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, chromeName), localeName + "necko/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, chromeName), localeName + "cookie/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, chromeName), localeName + "wallet/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, platformName), localeName + "global-platform/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder(cf, platformName), localeName + "communicator-platform/");
// check return value
if(err == SUCCESS)
{
err = performInstall();
logComment("performInstall() returned: " + err);
}
else
cancelInstall(err);
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);
// end main