// 1 is in the global chrome folder. This *has* to be the default!
// 2 in in the personal profile folder. This is only supported for newer builds.
if (myJarCheckDupe && File.exists(sysChromeGlobalJar) && File.exists(sysChromeUserJar)) {
alert(myProductName + " is installed in BOTH the personal chrome folder:\n" + sysChromeUserJar + "\nand the global chrome folder:\n" + sysChromeGlobalJar + "\n\nThis will cause weird behaviour. Please delete one of the instances!");
alert(myProductName + " cant be installed since " + myJarCheckReq[i] + " needs to be installed before installing " + myProductName + "\nPlease visit mozdev.org and install the " + myJarCheckReq[i] + " module first");
inst = 0;
}
}
}
if (myJarCheckReqOS) {
var os = getPlatform();
if (os && os != myJarCheckReqOS) {
alert(myProductName + " cant be installed since your operating system (" + os + ") needs to be " + myJarCheckReqOS);
inst = 0;
}
}
if (typeof(inst) != "number") {
var ans;
ans = confirm(myProductName + " version " + myProductRegVersion + " installation.\nClick OK to use one-click-install or click Cancel to choose yourself where to install.");
if (ans)
oci = true;
// Can we install in the personal profile folder? Assumes that builds without a buildID are used by people who knows what they are doing.
if (!buildID || (buildID && buildID >= 2003030700)) {
if (!oci)
alert("You can install " + myProductName + " " + myProductRegVersion + " in two ways:\n\n1) in the global chrome folder. This will make " + myProductName + " available in all profiles.\n\n2) in the personal profile folder. This will make " + myProductName + " available only in the current profile.\n\nYou will now be prompted to select a way...");
// Check if extension already is installed
if (File.exists(sysChromeGlobalJar)) {
if (!oci)
ans = confirm("A version of " + myProductName + " is already installed in the global chrome folder:\n" + sysChromeGlobal + "\nIt's recommended that you install " + myProductName + " into this folder.\nClick OK to install into this folder.");
inst = 1;
} else if (File.exists(sysChromeUserJar)) {
if (!oci)
ans = confirm("A version of " + myProductName + " is already installed in the personal chrome folder:\n" + sysChromeUser + "\nIt's recommended that you install " + myProductName + " into this folder.\nClick OK to install into this folder.");
inst = 2;
} else {
inst = 2;
}
if (!ans && !oci) {
if (inst != 1)
ans = confirm("Click OK to install in the global chrome folder:\n" + sysChromeGlobal + "\nThis is the recommended install option!");
if (!ans) {
if (inst != 2)
ans = confirm("Click OK to install in your personal profile folder:\n" + sysChromeUser);
if (!ans) {
alert("You didn't choose any of the supported installation options!\nPlease restart the installation!");
inst = 0;
} else {
inst = 2;
}
} else {
inst = 1;
}
}
} else {
if (!oci) {
ans = confirm("Click OK to install " + myProductName + " " + myProductRegVersion + " in the global chrome folder:\n" + sysChromeGlobal);
if (!ans) {
alert("You didn't choose any of the supported installation options!\nPlease restart the installation!");
alert(myProductName + " version " + myProductRegVersion + " has been successfully installed!\nWhen you right-click on a webpage your will now have a new context menuitem called " + myProductName + "!\n\nYou must restart your browser to complete installation!");
}
}
// did it work?
if (err) {
logComment("Problem installing. Error code: " + err + ". Error codes can been seen at: " + errPage);
alert(myProductName + " version " + myProductRegVersion + " was not installed!\nError code: " + err + "\n\nError codes can been seen at:\n" + errPage)