2002-01-30 18:22:19 +03:00
|
|
|
initInstall("Mozilla Calendar", "Mozilla/Calendar", "0.7");
|
2001-12-20 23:13:53 +03:00
|
|
|
|
|
|
|
calendarDir = getFolder("Chrome","calendar");
|
|
|
|
|
|
|
|
setPackageFolder(calendarDir);
|
|
|
|
|
2002-01-30 18:22:19 +03:00
|
|
|
addDirectory( "resources" );
|
2001-12-20 23:13:53 +03:00
|
|
|
|
|
|
|
addDirectory("", "components", getFolder( "Components" ), "" );
|
|
|
|
|
2003-01-07 18:52:05 +03:00
|
|
|
addDirectory( "", "", "icons", getFolder( "Chrome", "icons" ), "", true );
|
2002-03-05 17:03:26 +03:00
|
|
|
|
2002-01-30 18:22:19 +03:00
|
|
|
var err = getLastError();
|
|
|
|
|
2001-12-20 23:13:53 +03:00
|
|
|
if ( err == SUCCESS ) {
|
2002-01-30 18:22:19 +03:00
|
|
|
|
2002-03-05 17:03:26 +03:00
|
|
|
var calendarContent = getFolder(calendarDir, "content");
|
|
|
|
var calendarSkin = getFolder(calendarDir, "skin");
|
|
|
|
var calendarLocale = getFolder(calendarDir, "locale");
|
2001-12-20 23:13:53 +03:00
|
|
|
|
2002-03-05 17:03:26 +03:00
|
|
|
var returnval = registerChrome(CONTENT | DELAYED_CHROME, calendarContent );
|
|
|
|
var returnval = registerChrome(SKIN | DELAYED_CHROME, calendarSkin, "modern/");
|
2002-04-05 18:27:07 +04:00
|
|
|
var returnval = registerChrome(SKIN | DELAYED_CHROME, calendarSkin, "classic/");
|
2002-03-05 17:03:26 +03:00
|
|
|
var returnval = registerChrome(LOCALE | DELAYED_CHROME, calendarLocale, "en-US/");
|
|
|
|
|
2002-01-30 18:22:19 +03:00
|
|
|
err = performInstall();
|
2001-12-20 23:13:53 +03:00
|
|
|
|
2002-01-30 18:22:19 +03:00
|
|
|
if ( err == SUCCESS ) {
|
|
|
|
alert("The Mozilla Calendar has been succesfully installed. \n"
|
2001-12-20 23:13:53 +03:00
|
|
|
+"Please restart your browser to continue.");
|
2002-01-30 18:22:19 +03:00
|
|
|
}
|
2002-03-05 17:03:26 +03:00
|
|
|
else if( err == "999" )
|
|
|
|
{
|
|
|
|
alert("The Mozilla Calendar has been installed. \n You must restart your browser to continue.");
|
|
|
|
}
|
|
|
|
|
2002-01-30 18:22:19 +03:00
|
|
|
else {
|
2001-12-20 23:13:53 +03:00
|
|
|
alert("performInstall() failed. \n"
|
|
|
|
+"_____________________________\nError code:" + err);
|
|
|
|
cancelInstall(err);
|
2002-01-30 18:22:19 +03:00
|
|
|
}
|
2001-12-20 23:13:53 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
alert("Failed to create directory. \n"
|
|
|
|
+"You probably don't have appropriate permissions \n"
|
|
|
|
+"(write access to mozilla/chrome directory). \n"
|
|
|
|
+"_____________________________\nError code:" + err);
|
|
|
|
cancelInstall(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
|