summaryrefslogtreecommitdiff
path: root/addons/plugin_thunderbird/static/thunderbird_plugin/install.js
diff options
context:
space:
mode:
authorDarshan Kalola <dka@openerp.com>2014-06-27 14:06:07 +0200
committerRichard Mathot <rim@openerp.com>2014-06-27 14:06:07 +0200
commit0b6404bd9d6edc6ad4b7bc2644275b4e7c06eca7 (patch)
treee67d83da3bd725a772f16c6197c81c83c1ad9dec /addons/plugin_thunderbird/static/thunderbird_plugin/install.js
parent9fc9f994a77c7a5240916e025ecdb32adf511008 (diff)
[REM] plugin/plugin_outlook/plugin_thunderbird
Unsupported modules, moved to https://github.com/odoo/odoo-extra. Closes #804
Diffstat (limited to 'addons/plugin_thunderbird/static/thunderbird_plugin/install.js')
-rw-r--r--addons/plugin_thunderbird/static/thunderbird_plugin/install.js105
1 files changed, 0 insertions, 105 deletions
diff --git a/addons/plugin_thunderbird/static/thunderbird_plugin/install.js b/addons/plugin_thunderbird/static/thunderbird_plugin/install.js
deleted file mode 100644
index 50e4b301e32..00000000000
--- a/addons/plugin_thunderbird/static/thunderbird_plugin/install.js
+++ /dev/null
@@ -1,105 +0,0 @@
-// constants
-const APP_DISPLAY_NAME = "OpenERP Thunderbird Plugins";
-const APP_NAME = "OpenERP";
-const APP_VERSION = "1.0";
-const WARNING = "WARNING: You need administrator privileges to install OpenERP Thunderbird Plugin. It will be installed in the application directory for all users.";
-const VERSION_ERROR = "This extension can only be installed in a version higher than 2.0";
-const NOT_WRITABLE_ERROR = "This extension requires write access to the application directory to install properly."
-const locales = [
- "en-US",
- null
-];
-
-// Gecko 1.7 doesn't support custom button labels
-var incompatible = (typeof Install.BUTTON_POS_0 == "undefined");
-if (incompatible)
- alert(VERSION_ERROR);
-
-if (!incompatible) {
- // Check whether all directories can be accessed
- var dirList = [
- getFolder("Components"),
- getFolder(getFolder("Program", "defaults"), "pref")
- ];
- for (var i = 0; i < dirList.length; i++)
- if (!File.isWritable(dirList[i]))
- incompatible = true;
-
- if (incompatible)
- alert(NOT_WRITABLE_ERROR);
-}
-
-if (!incompatible && confirm(WARNING, APP_DISPLAY_NAME)) {
- /* Pre-Install Cleanup (for prior versions) */
-
- // List of files to be checked
- var checkFiles = [
- [getFolder("Components"), "nsXmlRpcClient.js"], // Root component
- [getFolder("Components"), "xml-rpc.xpt"], // Component interface
- ];
-
- // Remove any existing files
- initInstall("pre-install", "/rename", "0.0"); // open dummy-install
- for (var i = 0 ; i < checkFiles.length ; i++) {
- var currentDir = checkFiles[i][0];
- var name = checkFiles[i][1];
- var oldFile = getFolder(currentDir, name);
-
- // Find a name to rename the file into
- var newName = name + "-uninstalled";
- for (var n = 1; File.exists(oldFile) && File.exists(getFolder(currentDir, newName)); n++)
- newName = name + n + "-uninstalled";
-
- if (File.exists(oldFile))
- File.rename(oldFile, newName);
- }
- performInstall(); // commit renamed files
-
- /* Main part of the installation */
-
- var chromeType = DELAYED_CHROME;
-
- var files = [
- ["components/nsXmlRpcClient.js", getFolder("Components")],
- ["components/xml-rpc.xpt", getFolder("Components")],
- ["defaults/preferences/tiny.js", getFolder(getFolder("Program", "defaults"), "pref")],
- ];
-
- // initialize our install
- initInstall(APP_NAME, APP_PACKAGE, APP_VERSION);
-
- // Add files
- for (var i = 0; i < files.length; i++)
- addFile(APP_NAME, APP_VERSION, files[i][0], files[i][1], null);
-
- try {
- var err = registerChrome(CONTENT | chromeType, jar, "content/");
- if (err != SUCCESS)
- throw "Chrome registration for content failed (error code " + err + ").";
-
- err = registerChrome(SKIN | chromeType, jar, "skin/classic/");
- if (err != SUCCESS)
- throw "Chrome registration for skin failed (error code " + err + ").";
-
- for (i = 0; i < locales.length; i++) {
- if (!locales[i])
- continue;
-
- err = registerChrome(LOCALE | chromeType, jar, "locale/" + locales[i] + "/");
- if (err != SUCCESS)
- throw "Chrome registration for " + locales[i] + " locale failed (error code " + err + ").";
- }
-
- var err = performInstall();
- if (err != SUCCESS && err != 999)
- throw "Committing installation failed (error code " + err + ").";
-
- alert("OpenERP Thunderbird Plugin " + APP_VERSION + " is now installed.\n" +
- "It will become active after you restart your browser.");
- }
- catch (ex) {
- alert("Installation failed: " + ex + "\n" +
- "You probably don't have the necessary permissions (log in as system administrator).");
- cancelInstall(err);
- }
-}