2003-12-14 23:57:26 +00:00
const APP _DISPLAY _NAME = "Offline Support" ;
const APP _NAME = "offline" ;
const APP _PACKAGE = "/XXX.mozdev.org/offline" ;
const APP _VERSION = "0.0.2" ;
const APP _JAR _FILE = "offline.jar" ;
const APP _CONTENT _FOLDER = "content/messenger-offline/" ;
const APP _LOCALE _FOLDER = "locale/en-US/messenger-offline/" ;
const APP _SUCCESS _MESSAGE = "You may need to restart Thunderbird first." ;
const INST _TO _PROFILE = "Do you wish to install " + APP _DISPLAY _NAME + " to your profile?\nThis will mean it does not need reinstalling when you update Mozilla Thunderbird.\n(Click Cancel if you want " + APP _DISPLAY _NAME + " installing to the Thunderbird directory.)" ;
initInstall ( APP _NAME , APP _PACKAGE , APP _VERSION ) ;
// profile installs only work since 2003-03-06
var instToProfile = confirm ( INST _TO _PROFILE ) ;
var chromef = instToProfile ? getFolder ( "Profile" , "chrome" ) : getFolder ( "chrome" ) ;
var err = addFile ( APP _PACKAGE , APP _VERSION , APP _JAR _FILE , chromef , null )
if ( err == SUCCESS ) {
var jar = getFolder ( chromef , APP _JAR _FILE ) ;
if ( instToProfile ) {
registerChrome ( CONTENT | PROFILE _CHROME , jar , APP _CONTENT _FOLDER ) ;
registerChrome ( LOCALE | PROFILE _CHROME , jar , APP _LOCALE _FOLDER ) ;
} else {
registerChrome ( CONTENT | DELAYED _CHROME , jar , APP _CONTENT _FOLDER ) ;
registerChrome ( LOCALE | DELAYED _CHROME , jar , APP _LOCALE _FOLDER ) ;
}
err = performInstall ( ) ;
if ( err == SUCCESS || err == 999 ) {
alert ( APP _DISPLAY _NAME + " " + APP _VERSION + " has been succesfully installed.\n" + APP _SUCCESS _MESSAGE ) ;
} 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 your profile or chrome directory). \n"
+ "_____________________________\nError code:" + err ) ;
cancelInstall ( err ) ;
}