~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/xpinstall/packager/os2/regus.jst

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// main
 
2
var srDest;
 
3
var err;
 
4
var fProgram;
 
5
var searchPlugins = "searchplugins";
 
6
var platformNode = getPlatform();
 
7
/* BEGIN TEMPORARY UNTIL xpinstall/packager/common/share.t is fixed*/
 
8
platformNode = "win";
 
9
/* END TEMPORARY */
 
10
 
 
11
// ----LOCALIZATION NOTE: translate only these ------
 
12
var prettyName = "US Region Pack";
 
13
var chromeNode = "US";
 
14
// --- END CHANGABLE STUFF ---
 
15
 
 
16
var regName    = "locales/mozilla/" + chromeNode;
 
17
var chromeName = chromeNode + ".jar";
 
18
var localeName = "locale/" + chromeNode + "/";
 
19
 
 
20
srDest = $SpaceRequired$:bin;
 
21
err    = initInstall(prettyName, regName, "$Version$"); 
 
22
logComment("initInstall: " + err);
 
23
 
 
24
if (platformNode == 'mac')
 
25
{
 
26
  searchPlugins = "Search Plugins";
 
27
}
 
28
 
 
29
fProgram = getFolder("Program");
 
30
logComment("fProgram: " + fProgram);
 
31
 
 
32
if(verifyDiskSpace(fProgram, srDest))
 
33
{
 
34
  var chromeType = LOCALE;
 
35
  var fTarget;
 
36
 
 
37
  setPackageFolder(fProgram);
 
38
 
 
39
  fTarget = getFolder("Chrome");
 
40
  err = addDirectory("",
 
41
                     "bin/chrome",       // dir name in jar to extract 
 
42
                     fTarget,            // Where to put this file (Returned from GetFolder) 
 
43
                     "");                // subdir name to create relative to fProgram
 
44
  logComment("addDirectory() returned: " + err);
 
45
  if (err == SUCCESS)
 
46
  {
 
47
    fTarget = getFolder("Program", "defaults");
 
48
    logComment("fTarget: " + fTarget);
 
49
    err = addDirectory("",
 
50
                       "bin/defaults", // dir name in jar to extract 
 
51
                       fTarget,        // Where to put this file (Returned from GetFolder) 
 
52
                       "");            // subdir name to create relative to fProgram 
 
53
    logComment("addDirectory() returned: " + err);
 
54
    if (err == SUCCESS)
 
55
    {
 
56
      fTarget = getFolder("Program", searchPlugins);
 
57
      logComment("fTarget: " + fTarget);
 
58
      err = addDirectory("",
 
59
                         "bin/searchplugins", // dir name in jar to extract 
 
60
                         fTarget,          // Where to put this file (Returned from GetFolder) 
 
61
                         "");                 // subdir name to create relative to fProgram 
 
62
      logComment("addDirectory() returned: " + err);
 
63
    }
 
64
  }
 
65
  if (err != SUCCESS)
 
66
  {
 
67
    logComment("addDirectory() to " + fProgram + "failed!");
 
68
    // couldn't install globally, try installing to the profile
 
69
    resetError();
 
70
    chromeType |= PROFILE_CHROME;
 
71
    fProgram = getFolder("Profile");
 
72
    logComment("try installing to the profile: " + fProgram);
 
73
    err = addDirectory("","bin/chrome",fProgram,"chrome");
 
74
  }
 
75
 
 
76
  if (err == SUCCESS)
 
77
  {
 
78
    // register chrome
 
79
    var cf = getFolder(fProgram, "chrome/"+ chromeName);
 
80
    registerChrome(chromeType, cf, localeName + "global-region/");
 
81
    registerChrome(chromeType, cf, localeName + "communicator-region/");
 
82
    registerChrome(chromeType, cf, localeName + "editor-region/");
 
83
    registerChrome(chromeType, cf, localeName + "messenger-region/");
 
84
    registerChrome(chromeType, cf, localeName + "navigator-region/");
 
85
 
 
86
    err = performInstall(); 
 
87
    logComment("performInstall() returned: " + err);
 
88
  }
 
89
  else
 
90
  {
 
91
    cancelInstall(err);
 
92
    logComment("cancelInstall due to error: " + err);
 
93
  }
 
94
}
 
95
else
 
96
  cancelInstall(INSUFFICIENT_DISK_SPACE);
 
97
 
 
98
// end main