home *** CD-ROM | disk | FTP | other *** search
/ Freelog 97 / FreelogNo97-MaiJuin2010.iso / Internet / SmoothWheel / SmoothWheel.exe / install.js < prev    next >
Text File  |  2010-02-02  |  4KB  |  74 lines

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3.  *
  4.  * The contents of this file are subject to the Mozilla Public License Version
  5.  * 1.1 (the "License"); you may not use this file except in compliance with
  6.  * the License. You may obtain a copy of the License at
  7.  * http://www.mozilla.org/MPL/
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is useragent toolbar.
  15.  *
  16.  * The Initial Developer of the Original Code is David Illsley.
  17.  * Portions created by the Initial Developer are Copyright (C) 2001
  18.  * the Initial Developer. All Rights Reserved.
  19.  *
  20.  * Contributor(s):
  21.  *  Andy Edmonds <aedmonds@mindspring.com>
  22.  *  David Illsley <illsleydc@bigfoot.com>
  23.  *  Pavol Vaskovic <pali@pali.sk>
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  27.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. //SmoothWheel by Avi Halachmi (avihpit@yahoo.com)
  40. //started: 22-Mar-2003: avih
  41. //2004-04-05: Paradox: added profile install (changelog line and "sw_" vars prefix added by avih)
  42. //2004-07-03: avih: modified for jar file install, modified question text
  43.  
  44. const SW_INST_TO_PROFILE = "Do you wish to install smoothwheel to your profile?\nThis will mean it does not need reinstalling when you update your browser.\n(Click Cancel if you want smoothwheel installing to the application directory.)";
  45.  
  46. initInstall("SmoothWheel", "/avih/smoothwheel", "0.0.1");
  47. var sw_instToProfile = confirm(SW_INST_TO_PROFILE);
  48. var sw_chromef = sw_instToProfile ? getFolder("Profile", "chrome") : getFolder("chrome");
  49. var sw_mgDir = getFolder(sw_chromef , "smoothwheel");
  50. setPackageFolder(sw_mgDir);
  51. //var sw_err = addDirectory("smoothwheel");
  52. var sw_err = addDirectory("chrome");  //adds the content of the chrome directory from the installation package to mw_mgDir
  53. if ( sw_err == SUCCESS ) {
  54.     if(sw_instToProfile) registerChrome(CONTENT | PROFILE_CHROME, getFolder(sw_mgDir, "smoothwheel.jar"), "content/");
  55.       else registerChrome(CONTENT | DELAYED_CHROME, getFolder(sw_mgDir, "smoothwheel.jar"), "content/");
  56.   sw_err = performInstall();
  57.   if ( sw_err == SUCCESS ) {
  58.     alert("SmoothWheel v0.45.6.20100202 has been succesfully installed. \n"
  59.       +"Please restart your browser to continue.");
  60.   }
  61.   else {
  62.     alert("performInstall() failed. \n"
  63.     +"_____________________________\nError code:" + sw_err);
  64.     cancelInstall(sw_err);
  65.   }
  66. }
  67. else {
  68.   alert("Failed to create directory. \n"
  69.     +"You probably don't have appropriate permissions \n"
  70.     +"(write access to mozilla/chrome directory). \n"
  71.     +"_____________________________\nError code:" + sw_err);
  72.     cancelInstall(sw_err);
  73. }
  74.