-
Notifications
You must be signed in to change notification settings - Fork 9
/
_install.js
49 lines (41 loc) · 1.76 KB
/
_install.js
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
const APP_DISPLAY_NAME = "Extension Developer";
const APP_NAME = "extensiondev";
const APP_PACKAGE = "/Ted Mielczarek/extensiondev";
const APP_VERSION = "0.3.0.20060726";
const APP_JAR_FILE = "extensiondev.jar";
const APP_CONTENT_FOLDER = "content/";
const APP_LOCALE_FOLDER = "locale/en-US/";
const APP_SKIN_FOLDER = "skin/";
const APP_SUCCESS_MESSAGE = "";
initInstall(APP_NAME, APP_PACKAGE, APP_VERSION);
var chromef = getFolder("Profile", "chrome");
var instFlags = PROFILE_CHROME;
addFile(APP_PACKAGE, APP_VERSION, "zip.sh", chromef, null);
addFile(APP_PACKAGE, APP_VERSION, "zip.bat", chromef, null);
addFile(APP_PACKAGE, APP_VERSION, "winzip.bat", chromef, null);
addFile(APP_PACKAGE, APP_VERSION, "cygzip.bat", chromef, null);
addFile(APP_PACKAGE, APP_VERSION, "7zip.bat", chromef, null);
addFile(APP_PACKAGE, APP_VERSION, "winrar.bat", chromef, null);
addFile(APP_PACKAGE, APP_VERSION, "wzcline.bat", chromef, null);
var err = addFile(APP_PACKAGE, APP_VERSION, "chrome/" + APP_JAR_FILE, chromef, null);
if(err >= SUCCESS) {
var jar = getFolder(chromef, APP_JAR_FILE);
registerChrome(CONTENT | instFlags, jar, APP_CONTENT_FOLDER);
registerChrome(LOCALE | instFlags, jar, APP_LOCALE_FOLDER);
registerChrome(SKIN | instFlags, jar, APP_SKIN_FOLDER);
err = performInstall();
if(err >= SUCCESS) {
alert(APP_NAME + " " + APP_VERSION + " has been succesfully installed.\n"
+APP_SUCCESS_MESSAGE
+"Please restart your browser before continuing.");
} else {
alert("Install failed. Error code:" + err);
cancelInstall(err);
}
} else {
alert("Failed to create " +APP_JAR_FILE +"\n"
+"You probably don't have appropriate permissions \n"
+"(write access to Profile/chrome directory). \n"
+"_____________________________\nError code:" + err);
cancelInstall(err);
}