[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:

http://www.mozilla.org/projects/firefox/extensions/commandlineoptions.htmlhttps://bugzilla.mozilla.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=install-global-extension&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&resolution=DUPLICATE&resolution=---&emailassigned_to1=1&emailtype1=exact&email1=&emailassigned_to2=1&emailreporter2=1&emailqa_contact2=1&emailtype2=exact&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=

Michael


More information about the Project_owners mailing list