I have my XPI installer.

install.js:
/* --------------------------------- */
initInstall("MYAPP", "myapp", "0.1.1");
var sysChromeGlobal = getFolder("Chrome","myapp");
var sysChromeUser = getFolder(getFolder("Profile","chrome"),"myapp");

var globalChrome = confirm("Click OK if you want to install in the global
chrome folder\n---"+sysChromeGlobal+"\nOtherwise click Cancel if you prefer
to install in the personal profile\n---"+sysChromeUser);

//Global Chrome
var f;
if(globalChrome) {
 f = sysChromeGlobal;
}else{
 f = sysChromeUser;
}

setPackageFolder(f);
var err = addDirectory("myapp");
logComment("install MYAPP: " + err);

var chromeFlag;
if (globalChrome) chromeFlag = DELAYED_CHROME;
else chromeFlag = PROFILE_CHROME;

if ( err == SUCCESS ) {
 registerChrome(CONTENT | chromeFlag, getFolder(f, "content/myapp/"));
 registerChrome(LOCALE | chromeFlag, getFolder(f, "locale/en-US/myapp/"));
 registerChrome(SKIN | chromeFlag, getFolder(f, "skin/modern/myapp/"));

  err = performInstall();
  if ( err == SUCCESS ) {
    alert("MYAPP has been succesfully installed. \n"
      +"Please restart your browser to continue.");
  } else {
    alert("performInstall() failed. \n"
    +"_____________________________\nError code:" + err);
    cancelInstall(err);
  }
} 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);
}
/* ---------------------------------*/

Some questions:
1) How che install another .xpi from this install.js script?

2) This file install MYAPP as directory (subdirectory of chorme) ; how can
easy modifing this script to install the package as jar file?

Bye,
--Gabriele


_______________________________________________
Mozilla-xpinstall mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpinstall

Reply via email to