I really wish someone would come along and post info on the *right* way to do this. The goal is not to delete those files. The goal is to tell xpcom to regenerate them - deleting them is just one (very heavy-handed) way to accomplish the goal of forcing them to be regenerated. I can't speak for the xpcom ComponentManager, but the InterfaceInfoManager was designed to take the contents of the existing "xpti.dat" into account when generating the new "xpti.dat". Deleting the old file is *not* something that you should do on end user machines when installing your component. You run the risk of destabilizing their xpcom install.

John.

CK Hsu wrote:

Hi,
I found the solution, thanks for the help. I delete the "xpti.dat" and "compreg.dat" in my install.js file. Here's my code:

//-------------------------------------------------------------------
var componentsFolder = getFolder("Components");
logComment("componentsFolder = " + componentsFolder);

var myFolder = getFolder("Current User");
logComment("myFolder = " + myFolder);

{
    // add the DLL and say where it'll go
    addFile("dymo.dll", "1.0", "dymo.dll", componentsFolder, "");
    logComment("addFile() dymoxpcom.dll: " + err);

    // add the typelib also
    addFile("IDymo.xpt", "1.0", "IDymo.xpt", componentsFolder, "");
    logComment("addFile() dymoxpcom.xpi: " + err);

    // delete xpti.dat and compreg.dat
    var f = getFolder(myFolder, "xpti.dat");
    err = File.remove(f);
    logComment("remove(): xpti.dat" + err);

    f = getFolder(myFolder, "compreg.dat");
    err = File.remove(f);
    logComment("remove(): compreg.dat" + err);

    // perform the installation if there are no errors
    if (err == SUCCESS)
    {
        err = performInstall();
        logComment("PerformInstall(): " + err);

        err = refreshPlugins();
        logComment("refreshPlugins(): " + err);

alert("The DYMO Components will be available after restarting the Firefox browser!");
    }
    else
        cancelInstall(err);
}

"CK Hsu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

Hi,
Thank you for replying. I tried what you suggested but it still does not work. However, if I manually delete "xpti.dat" and "comreg.dat" and restart Firefox then my component works.

The net result seems to be that XPInstall did register my component, but I still am missing the "final step," which is removing those two .dat files. Is there anything I can do this with XPInstall?

Thanks.

CK

"Martin Kremer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

Hi,

just create or "touch" a file called ".autoreg" in the "components" folder
(where the .dll is located).

HTH,
Martin


-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von CK Hsu
Gesendet: Dienstag, 30. August 2005 01:01
An: [email protected]
Betreff: Please HELP! how do I register my component from XPInstall?


Hi,
I finsihed writing an XPCOM component and I can register the
component by
calling regxpcom, then deleting xpti.dat and compreg.dat,
then restarting
the Firefox browser.

I followed the Weblock sample to try and create a installer
(.xpi) file
using XPInstall. I was able to copy the component's .dll and
.xpt files in
the "components" folder, but I am at a total loss on how to
register my
component so it can be used. What am I missing?!

Thanks in advance!

This is what my install.js looks like (packaged in the .xpi file):

//////////////////////////////////////////////////////////////
///////////////////////////////////////////////////
// initialize the installation
var err = initInstall("DYMO XPCOM", "dymoxpcom", 1.0);
logComment("initInstall(): " + err);

var componentsFolder = getFolder("Components");
logComment("componentsFolder = " + componentsFolder);

{
   // add the DLL and say where it'll go
   addFile("dymoxpcom.dll", "1.0", "dymoxpcom.dll",
componentsFolder, "");
   logComment("addFile() dymoxpcom.dll: " + err);

   // add the typelib also
   addFile("dymoxpcom.xpt", "1.0", "dymoxpcom.xpt",
componentsFolder, "");
   logComment("addFile() dymoxpcom.xpi: " + err);

   // perform the installation if there are no errors
   if (err == SUCCESS)
   {
       err = performInstall();
       logComment("PerformInstall(): " + err);

       err = refreshPlugins(true);
       logComment("refreshPlugins(): " + err);
   }
   else
       cancelInstall(err);
}
//////////////////////////////////////////////////////////////
///////////////////////////////////////////////////


_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom






_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to