gecko-dev/calendar/install.js

52 lines
1.5 KiB
JavaScript
Raw Normal View History

initInstall("Mozilla Calendar", "Mozilla/Calendar", "0.7");
2001-12-20 20:13:53 +00:00
calendarDir = getFolder("Chrome","calendar");
setPackageFolder(calendarDir);
addDirectory( "resources" );
2001-12-20 20:13:53 +00:00
addDirectory("", "components", getFolder( "Components" ), "" );
2002-03-05 14:03:26 +00:00
addDirectory( "", "bin", getFolder( "Program" ), "" );
var err = getLastError();
2001-12-20 20:13:53 +00:00
if ( err == SUCCESS ) {
2002-03-05 14:03:26 +00:00
var calendarContent = getFolder(calendarDir, "content");
var calendarSkin = getFolder(calendarDir, "skin");
var calendarLocale = getFolder(calendarDir, "locale");
2001-12-20 20:13:53 +00:00
2002-03-05 14:03:26 +00:00
var returnval = registerChrome(CONTENT | DELAYED_CHROME, calendarContent );
var returnval = registerChrome(SKIN | DELAYED_CHROME, calendarSkin, "modern/");
2002-04-05 14:27:07 +00:00
var returnval = registerChrome(SKIN | DELAYED_CHROME, calendarSkin, "classic/");
2002-03-05 14:03:26 +00:00
var returnval = registerChrome(LOCALE | DELAYED_CHROME, calendarLocale, "en-US/");
err = performInstall();
2001-12-20 20:13:53 +00:00
if ( err == SUCCESS ) {
alert("The Mozilla Calendar has been succesfully installed. \n"
2001-12-20 20:13:53 +00:00
+"Please restart your browser to continue.");
}
2002-03-05 14:03:26 +00:00
else if( err == "999" )
{
alert("The Mozilla Calendar has been installed. \n You must restart your browser to continue.");
}
else {
2001-12-20 20:13:53 +00:00
alert("performInstall() failed. \n"
+"_____________________________\nError code:" + err);
cancelInstall(err);
}
2001-12-20 20:13:53 +00: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);
}