Thanks Doug. You are right, I happened to be making an error in my install
script with addFile that I was falsely blaming on component registration.
I was a bit mislead by the WebLock installation example in the XPCOM book.
Here is the code snippet after component addFile and before registerChrome
that got me originally concerned so that maybe others will not be:
http://www.mozilla.org/projects/xpcom/book/cxc/html/weblock_package.html#998197
This line in the "Weblock Installation Script"
// ? have to register component here or with regxpcom?

I was about to go with what I think might be a third "dynamic" option for
anyone interested... nsIComponentRegistrar is scriptable and you could
invoke autoRegister from your install script. I have not verified this yet
but I think it might be cleaner than running regxpcom via file.execute (btw,
I thought you could only execute files within your xpi?).

In case you're interested the silly mistake I was making was:
addFile("myFile.dll", "", getFolder("Components"), "")
instead of:
addFile("myFile.dll", "myFile.dll", getFolder("Components"), "")
I thought the xpiSrc param was a path to where it lived in the xpi, not the
root relative path including the file name. Oops!



"Doug Turner" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> John Nason wrote:
>
> > This is a double post with the XPInstall board but that one doesn't seem
> > very active and people here should probably know the answer anyway.
> > I was wondering if anyone knows how to register a XPCOM dll from a
XPInstall
> > script? There is documentation that indicates that it can be done, but I
> > have not found a way to actually do it. Simply copying my .dll and .xpt
and
> > registering my chrome is not enough. I still need to run regxpcom
externally
> > to actually register my component. How can I do this from within my
install
> > script?
> > Thanks for the help.
>
> After an installation and browser restart, any
> added components will be registered.
>
> See:
> http://lxr.mozilla.org/seamonkey/source/xpinstall/src/nsInstall.cpp#106
>
> Anything more dynamic than that, you should look
> at using File.execute:
>
>
http://devedge.netscape.com/library/manuals/2001/xpinstall/1.0/File8.html#997901
>
> calling regxpcom.
>
> I hope this helps,
>
> Doug Turner
>


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

Reply via email to