Thank you Doug!

> A) touch a file .autoreg next to the executable.
Can you give me an example?

> B) run regxpcom with the right commands.
The Firefox distribution doesn't include this tool in the bin directory.

> C) install the component via xpinstall.
Yes, xpinstall copies the native dll + xpt file into the components
directory.
But nothing gets registered after performInstall(). Compreg.dat and xpti.dat
are not updated!

> D) run some priveleged js (as your code above attempts to do)

Yes I will try this way. I now learned how to pass a valid nsIFile object
(the xpt file) to autoregister.
But it gives me NS_ERROR_FACTORY_NOT_REGISTERED. If I pass
autoRegister(null) nothing happens. I expected that all components will be
reregistered according the documentation.

How can I register my component by code?

Martin


  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  var compman=Components.manager;
  compman.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  var file =
Components.classes['@mozilla.org/file/local;1'].createInstance(Components.in
terfaces.nsILocalFile);
  file.initWithPath("C:\\Programme\\Mozilla
Firefox\\components\\nsISample.xpt");
  compman.autoRegister(file);





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

Reply via email to