Hi,
I have a working XPCOM Sample.
I am searching for way to register this component after copying it into the
components directory, since non debug-mozilla do not do this automatically.
I do not want the users to register the component manually because firefox
browser does not seem to have regxpcom.exe.
Therefore the install.js in the xpi file should do this.
According the source of regxpcom a nsiLocalFile object is passed to the
autoregister function.
The C++ source uses NS_NewNativeLocalFile.
I do not know how to initialize the file object in JavaScript.
Can you help me? Below is my code.
function autoRegister()
{
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);
}
Thank you!
Martin
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom