2003-01-14 00:53:58 +03:00
|
|
|
initInstall("Mozilla Calendar", "Mozilla/Calendar", "0.8");
|
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-14 00:53:58 +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 ) {
|
2004-01-16 18:09:56 +03:00
|
|
|
alert("The Mozilla Calendar has been successfully 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" )
|
|
|
|
{
|
2003-01-13 18:36:45 +03:00
|
|
|
alert("The Mozilla Calendar has been installed. \n Please restart your browser to continue.");
|
2002-03-05 17:03:26 +03:00
|
|
|
}
|
|
|
|
|
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 {
|
2003-01-13 18:36:45 +03:00
|
|
|
alert("Failed to create directory. \n"
|
2001-12-20 23:13:53 +03:00
|
|
|
+"You probably don't have appropriate permissions \n"
|
|
|
|
+"(write access to mozilla/chrome directory). \n"
|
2003-01-13 18:36:45 +03:00
|
|
|
+"If you installed Mozilla as root then you need to install calendar as root as well.\n"
|
|
|
|
+"Or, you can change ownership of your Mozilla directory to yourself and install calendar."
|
2001-12-20 23:13:53 +03:00
|
|
|
+"_____________________________\nError code:" + err);
|
|
|
|
cancelInstall(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
|