Hello,

If I drag an xpi into Firefox that containins the install.js file shown at the bottom of this post, the extension I wrote cannot instantiate an instance of the component in mycomponent.dll. The component and typelib are placed in c:\program files\myapp\, as expected, but it seems like the component doesn't get registered...after restarting Firefox, the Components.classes[cid].createInstance() call made in the XUL throws "Components.classes[cid] has no properties".

If I change install.js so that mycomponent.dll and IMyTypelib.xpt wind up in the components folder (c:\program files\mozilla firefox\components\), the call to createInstance in the XUL succeeds.

Any idea why the createInstance result is different depending on where the component/typelib are located?

Thanks,
Roy

var err = initInstall("myextension", "myextension", 1.0);
var appFolder;
var putChromeHere;

if (err == SUCCESS) {
   appFolder = getFolder("file:///", "c|/program%20files/myapp");
   ///appFolder = getFolder("Components");
   putChromeHere = getFolder(appFolder, "myextension");
}
if (err == SUCCESS) {
   err = setPackageFolder(putChromeHere);
}
if (err == SUCCESS) {
   err = addDirectory("myextension", "myextension", putChromeHere, "");
}
if (err == SUCCESS) {
err = addFile("mycomponent.dll", "1.0", "components/mycomponent.dll", appFolder, "");
}
if (err == SUCCESS) {
err = addFile("IMyTypelib.xpt", "1.0", "components/IMyTypelib.xpt", appFolder, "");
}
if (err == SUCCESS) {
   err = performInstall();
}
if (err == SUCCESS) {
   err = refreshPlugins();
   alert("please restart");
}
if (err != SUCCESS) {
   cancelInstall(err);
}
_______________________________________________
dev-tech-xpinstall mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpinstall

Reply via email to