1 |
const X_MSG = "Install Live HTTP Header";
|
2 |
const X_NAME = "/livehttpheaders";
|
3 |
const X_VER = "0.1";
|
4 |
const X_JAR_FILE = "livehttpheaders-ja.jar";
|
5 |
|
6 |
const X_CHROME = "chrome";
|
7 |
const X_LOCALE = "locale/ja-JP/livehttpheaders/";
|
8 |
|
9 |
var err = initInstall(X_MSG, X_NAME, X_VER);
|
10 |
logComment("initInstall: " + err);
|
11 |
logComment("Installation started...");
|
12 |
|
13 |
resetError();
|
14 |
addFile(X_NAME, X_JAR_FILE, getFolder(X_CHROME), "");
|
15 |
err = getLastError();
|
16 |
if (err == SUCCESS || err == REBOOT_NEEDED) {
|
17 |
registerChrome(DELAYED_CHROME | LOCALE, getFolder(X_CHROME, X_JAR_FILE), X_LOCALE);
|
18 |
}
|
19 |
err = getLastError();
|
20 |
if (err == SUCCESS || err == REBOOT_NEEDED) {
|
21 |
performInstall();
|
22 |
err = getLastError();
|
23 |
if (err == SUCCESS || err == REBOOT_NEEDED) {
|
24 |
//alert("Please restart mozilla");
|
25 |
} else {
|
26 |
// Nothing to do, Mozilla will display an error message himself
|
27 |
}
|
28 |
} else {
|
29 |
cancelInstall();
|
30 |
if (err == -202) {
|
31 |
alert("You need to have write permissions to the chrome directory:\n" +
|
32 |
getFolder(X_CHROME));
|
33 |
} else if (err == -210) {
|
34 |
alert("Installation cancelled by user");
|
35 |
}else {
|
36 |
alert("An unknown error occured. Error code: " + err + "\n" +
|
37 |
"Look at the following URL for a description of the error code:\n" +
|
38 |
"http://developer.netscape.com/docs/manuals/xpinstall/err.html");
|
39 |
}
|
40 |
}
|
41 |
|