annotate xul/install.js @ 242:9622e3f5c6f9

Servlet version 1.19b4 - bug fixes - new stuff in DocumentBean
author robcast
date Wed, 04 Aug 2004 20:42:48 +0200
parents 49cb8a445126
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
199
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
1 /*
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
2
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
3 Copyright (C) 2003 WTWG, Uni Bern
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
4
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
5 This program is free software; you can redistribute it and/or
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
6 modify it under the terms of the GNU General Public License
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
7 as published by the Free Software Foundation; either version 2
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
8 of the License, or (at your option) any later version.
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
9
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
13 GNU General Public License for more details.
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
14
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
16 along with this program; if not, write to the Free Software
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
18
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
19 Author: Christian Luginbuehl, 22.05.2003 , Version Alcatraz 0.5
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
20
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
21 */
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
22
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
23 var authorName = "ubern";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
24
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
25
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
26 var appName = "ALCATRAZ";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
27 var appVersion = "0.5.0";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
28 var appChromeName = "alcatraz";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
29 var appFile = "alcatraz.jar";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
30
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
31 var jarAppPath = "content/";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
32 var jarSkinPath = "skin/";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
33 var jarLocalePath = "locale/en-US/";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
34
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
35 var userChrome = getFolder("Profile", "chrome");
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
36
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
37 var successMessage = "The ALCATRAZ package has been successfully installed.\n\nRestart your browser to continue ...";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
38 var errorMessage = "Installation failed! Well, I have no idea what to do now ... sorry :-(";
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
39
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
40
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
41 initInstall(appName, authorName + appChromeName, appVersion);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
42
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
43 addFile(appName, appVersion, appFile, userChrome, '', true);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
44
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
45 registerChrome(Install.CONTENT | Install.PROFILE_CHROME, getFolder(userChrome, appFile), jarAppPath);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
46 registerChrome(Install.SKIN | Install.PROFILE_CHROME, getFolder(userChrome, appFile), jarSkinPath);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
47 registerChrome(Install.LOCALE | Install.PROFILE_CHROME, getFolder(userChrome, appFile), jarLocalePath);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
48
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
49 /**
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
50 * pretty simple error handling
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
51 */
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
52 var code = getLastError();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
53
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
54 if (code == SUCCESS) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
55 code = performInstall();
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
56
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
57 if (code == SUCCESS ||code == REBOOT_NEEDED) {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
58 alert(successMessage);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
59 } else {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
60 alert(errorMessage);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
61 cancelInstall(code)
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
62 }
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
63 } else {
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
64 cancelInstall(code);
49cb8a445126 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
65 }