DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
#filter substitution
// main
var srDest;
var err;
var fProgram;
var platformNode;
var searchPlugins = "searchplugins";

if (platformNode == 'mac')
{
  searchPlugins = "Search Plugins";
}
platformNode = getPlatform();
logComment("initInstall: platformNode=" + platformNode);
// end
// end - OS type detection

var chromeNode = "@AB_CD@";

var regName    = "locales/mozilla/" + chromeNode;
var chromeName = chromeNode + ".jar";
var localeName = "locale/" + chromeNode + "/";

srDest = $SpaceRequired$:bin;
err    = initInstall("@AB_CD@ Langpack", "@AB_CD@", "$Version$"); 
logComment("initInstall: " + err);

fProgram = getFolder("Program");
logComment("fProgram: " + fProgram);

if(verifyDiskSpace(fProgram, srDest))
{
  var chromeType = LOCALE;
  var fTarget;

  err = addDirectory("",
                     "bin",     // dir name in jar to extract 
                     fProgram,  // Where to put this file (Returned from GetFolder) 
                     "");       // Force Flag 
  logComment("addDirectory() returned: " + err);

  if (err != SUCCESS)
  {
    logComment("addDirectory() to " + fProgram + "failed!");
    // couldn't install globally, try installing to the profile
    resetError();
    chromeType |= PROFILE_CHROME;
    fProgram = getFolder("Profile");
    logComment("try installing to the user profile:" + fProgram);
    err = addDirectory("","bin",fProgram,"");
  }
 
  setPackageFolder(fProgram);
 
  // check return value
  if (err == SUCCESS)
  {
    fTarget = getFolder("Program", "defaults");
    logComment("fTarget: " + fTarget);
    err = addDirectory("",
                       "bin/defaults", // dir name in jar to extract 
                       fTarget,        // Where to put this file (Returned from GetFolder) 
                       "");            // subdir name to create relative to fProgram 
    logComment("addDirectory() returned: " + err);

    fTarget = getFolder("Program", searchPlugins);
    logComment("fTarget: " + fTarget);
    err = addDirectory("",
                       "bin/searchplugins", // dir name in jar to extract 
                       fTarget,          // Where to put this file (Returned from GetFolder) 
                       "");                 // subdir name to create relative to fProgram 
    logComment("addDirectory() returned: " + err);

    // register chrome
    var cf = getFolder(fProgram, "chrome/"+chromeName);

    registerChrome(chromeType, cf, "locale/global/");
    registerChrome(chromeType, cf, "locale/global-platform/");
    registerChrome(chromeType, cf, "locale/global-region/");

    registerChrome(chromeType, cf, "locale/browser/");
    registerChrome(chromeType, cf, "locale/browser-region/");
    registerChrome(chromeType, cf, "locale/passwordmgr/");
    registerChrome(chromeType, cf, "locale/mozapps/");

    registerChrome(chromeType, cf, "locale/necko/");
#ifdef EXTENSION_PREF
    registerChrome(chromeType, cf, "locale/autoconfig/");
#endif
    registerChrome(chromeType, cf, "locale/cookie/");
    registerChrome(chromeType, cf, "locale/pippki/");
    registerChrome(chromeType, cf, "locale/pipnss/");

#ifdef LOCALE_HAS_HELP
    registerChrome(chromeType, cf, "locale/help/");
#endif
#ifdef LOCALE_HAS_DOMI
    registerChrome(chromeType, cf, "locale/inspector/");
#endif

    err = performInstall(); 
    logComment("performInstall() returned: " + err);
  }
  else
  {
    cancelInstall(err);
    logComment("cancelInstall due to error: " + err);
  }
}
else
  cancelInstall(INSUFFICIENT_DISK_SPACE);

// end main