[Project_owners] Installing the extension with the command line

Michael Vincent mv_van_rantwijk at yahoo.com
Sun Aug 28 16:11:30 EDT 2005

Didier Ernotte wrote:
> Hi,
> I have a user that have open a bug on my extension because it does not
> work when the extension is installed with the following command line

TIP: you should always add the link to that bug because it enables other 
people, like me, to have a look for you.

> firefox.exe -install-global-extension extension.xpi

Did he use an absolute or relative path for "extension.xpi" ?

> I was not aware that could be possible. 

Have you tried it yourself?

> What what are the difference
> between installing the extension that way, or just open the xpi file in
> the browser. 

> I guess the location of the extension is not the same, but
> what are the impact on the code of the extension. 

Correct, the location of the extension should be different.

> For example, I need to read a file in the profile directory. If I use
>   var file =
> file=Components.classes["@mozilla.org/file/directory_service;1"].
> getService(Components.interfaces.nsIProperties).get("ProfD",
> Components.interfaces.nsIFile);

Add a dump and have a look at the console, that should help!

> Did I get a reference on the user profile directory or the global
> profile directory ?

The users profile directory, and I think that you are revering to the 
application directory when you use "global profile directory", right?

> If I have to write a file in the profile directory, same question, and
> maybe I have to take care about the permission to write to that
> location ? right ?

Yes, that might be necessary.

BTW: here are two (useful) references:



More information about the Project_owners mailing list