installing xpi from another xpi

"Gabriele" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpinstall
Organization [Infostrada]
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.