/[suikacvs]/www/mozilla/livehttpheaders/install.js
Suika

Diff of /www/mozilla/livehttpheaders/install.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by w, Sun Jul 6 10:28:39 2003 UTC revision 1.4 by wakaba, Sat Jan 14 07:46:31 2012 UTC
# Line 1  Line 1 
1  const X_MSG =      "Install Live HTTP Header";  /*
2  const X_NAME =     "/livehttpheaders";   * This file is auto-generated (at 2004-07-10T07:33:50Z).
3  const X_VER  =     "0.1";   * Do not edit by hand!
4  const X_JAR_FILE = "livehttpheaders-ja.jar";   */
5    
6  const X_CHROME =   "chrome";  const PACKAGE_NAME = 'LiveHTTPHeaders 0.9 日本語パック';
7  const X_LOCALE =  "locale/ja-JP/livehttpheaders/";  const PACKAGE_VERSION = '1.4 (2004-07-10T07:33:50Z)';
8    const DISPLAY_NAME = 'LiveHTTPHeaders 0.9 日本語パック 1.4 (2004-07-10T07:33:50Z)';
9  var err = initInstall(X_MSG, X_NAME, X_VER);  
10  logComment("initInstall: " + err);  const PACKAGE_JAR_DIRECTORY = 'chrome/';
11  logComment("Installation started...");  const PACKAGE_JAR_FILENAME = 'livehttpheaders-ja.jar';
12    var PACKAGE_CONTENT_DIR = new Array ();
13  resetError();  var PACKAGE_LOCALE_DIR = new Array ("locale/ja-JP/livehttpheaders/");
14  addFile(X_NAME, X_JAR_FILE, getFolder(X_CHROME), "");  
15  err = getLastError();  var err = initInstall (DISPLAY_NAME, PACKAGE_NAME, PACKAGE_VERSION);
16  if (err == SUCCESS || err == REBOOT_NEEDED) {  var messages = loadResources ('install-res.en.inf');
17    registerChrome(DELAYED_CHROME | LOCALE, getFolder(X_CHROME, X_JAR_FILE), X_LOCALE);  
18  }  var contentFlag = CONTENT | DELAYED_CHROME;
19  err = getLastError();  var localeFlag = LOCALE | DELAYED_CHROME;
20  if (err == SUCCESS || err == REBOOT_NEEDED) {  var UChrome = getFolder ('Chrome');
21    performInstall();  var existsInProfile = File.exists (getFolder (getFolder('Current User', 'chrome'), PACKAGE_JAR_DIRECTORY + PACKAGE_JAR_FILENAME));
22    err = getLastError();  
23    if (err == SUCCESS || err == REBOOT_NEEDED) {  if (existsInProfile || !confirm (messages.installToChrome)) {
24      //alert("Please restart mozilla");    UChrome = getFolder ('Current User', 'chrome');
25    } else {    contentFlag = CONTENT | PROFILE_CHROME;
26      // Nothing to do, Mozilla will display an error message himself    localeFlag  = LOCALE | PROFILE_CHROME;
27    }  }
28  } else {  logComment('initInstall: ' + err);
29    cancelInstall();  setPackageFolder (UChrome);
30    if (err == -202) {  var folder = getFolder (UChrome, PACKAGE_JAR_FILENAME);
31      alert("You need to have write permissions to the chrome directory:\n" +  
32            getFolder(X_CHROME));  resetError ();
33    } else if (err == -210) {  addFile (PACKAGE_NAME, PACKAGE_JAR_DIRECTORY + PACKAGE_JAR_FILENAME, UChrome, '');
34      alert("Installation cancelled by user");  err = getLastError ();
35    }else {  if (err == SUCCESS || err == REBOOT_NEEDED) {
36      alert("An unknown error occured.  Error code: " + err + "\n" +    for (var i = 0; i < PACKAGE_CONTENT_DIR.length; i++) {
37            "Look at the following URL for a description of the error code:\n" +      registerChrome (contentFlag, folder, PACKAGE_CONTENT_DIR[i]);
38            "http://developer.netscape.com/docs/manuals/xpinstall/err.html");    }
39    }    for (var i = 0; i < PACKAGE_LOCALE_DIR.length; i++) {
40  }      registerChrome (localeFlag, folder, PACKAGE_LOCALE_DIR[i]);
41      }
42    }
43    
44    err = getLastError();
45    if (err == SUCCESS || err == REBOOT_NEEDED) {
46      performInstall();
47      err = getLastError();
48      if (err == SUCCESS || err == REBOOT_NEEDED) {
49        //alert("Please restart mozilla");
50      } else {
51        // Nothing to do, Mozilla will display an error message himself
52      }
53    } else {
54      cancelInstall();
55      if (err == -202) {
56        alert (messages.noPermission.replace (/%s/, folder));
57      } else if (err == -210) {
58        alert (messages.canceldByUser);
59      }else {
60        alert(messages.unknownError.replace (/%s/, err));
61      }
62    }
63    
64    /*
65    ***** BEGIN LICENSE BLOCK *****
66    Version: MPL 1.1/GPL 2.0/LGPL 2.1
67    
68    The contents of this file are subject to the Mozilla Public License Version
69    1.1 (the "License"); you may not use this file except in compliance with
70    the License. You may obtain a copy of the License at
71    <http://www.mozilla.org/MPL/>
72    
73    Software distributed under the License is distributed on an "AS IS" basis,
74    WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
75    for the specific language governing rights and limitations under the
76    License.
77    
78    The Initial Developer is Wakaba <w@suika.fam.cx>.
79    Portions created by the Initial Developer are Copyright (C) 2003
80    the Initial Developer. All Rights Reserved.
81    
82    Contributor(s):
83            Wakaba <w@suika.fam.cx> (original author)
84    
85    Alternatively, the contents of this file may be used under the terms of
86    either the GNU General Public License Version 2 or later (the "GPL"), or
87    the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
88    in which case the provisions of the GPL or the LGPL are applicable instead
89    of those above. If you wish to allow use of your version of this file only
90    under the terms of either the GPL or the LGPL, and not to allow others to
91    use your version of this file under the terms of the MPL, indicate your
92    decision by deleting the provisions above and replace them with the notice
93    and other provisions required by the GPL or the LGPL. If you do not delete
94    the provisions above, a recipient may use your version of this file under
95    the terms of any one of the MPL, the GPL or the LGPL.
96    
97    ***** END LICENSE BLOCK *****
98    */
99    /* $Date$ */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24