views:

204

answers:

4

Is there an API or library for install, update, uninstall FireFox extensions ?

The article (https://developer.mozilla.org/en/Adding_Extensions_using_the_Windows_Registry) seems like a legacy information...

I have installed FireFox 3.6.3. However, I don't see "HKEY_LOCAL_MACHINE\Software\Mozilla\Firefox\Extensions" in my registry:


[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla]

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox]

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)]

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)\Main]

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.6.3 (en-GB)\Uninstall]

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3]

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3\bin]

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.6.3\extensions]


For example, I want to install my_ext.xpi (ID: my_ext@my_site.com, Path: c:\myapp\ff_addons\my_ext.xpi).

Could you talk me how can I install my extension ?

Which firefox's versions support this method ?

A: 

Are you talking about an extension or a plug-in?

Extensions are generally installed by having Firefox open an .xpi file. And .xpi files are just .zip files with a manifest (.rdf) and your various scripts and libraries. You can install it manually by creating the right directory structure. On my machine extensions live here: C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\[random-number].default\extensions. You create a subdirectory there called [email protected] and then unzip the contents of your XPI inside the subdirectory. The next time the user re-starts firefox, your extension will be installed. There are a few gotcha's though:

  1. Users have to manually restart Firefox.
  2. You don't know which profile to use if there is more than one. The profile is identified by the [random-number] above. Many users have more than one profile.
  3. On Mac and Linux this is a different directory, though the same basic idea applies.

Plugins are things like Flash that run inside a webpage. You can install those by setting a registry key, but I think in general there is a well-known folder where Firefox looks and loads anything that starts with NP (e.g. NPSWF32.dll). Seriously, it looks for NP. And each plugin must export certain NPAPI functions that Firefox uses to negotiate... stuff.

jeffamaphone
I'm talking about extensions.I know about .xpi and etc...I wanna have ability to install (update, uninstall) an extension during installation of my Windows application.
cpp_fanatic
@cpp_fanatic: I have updated my answer.
jeffamaphone
But you really should use the windows registry method if you want it to deployed to all users.
sdwilsh
Yes, and I think it plays nice with the Profiles thing too.
jeffamaphone
A: 

The windows registry method is not a legacy method, and it's the supported way of installing an add-on for all users on a machine (and all Firefox profiles).

I'm curious as to why you felt it was a legacy method.

sdwilsh
Well, I think you can help me ;) I have updated my question.And one more question (It is not important for me, but...):FireFox 3.6.3 has ignored parameter "-install-global-extension".Will this parameter supported in the future ?
cpp_fanatic
No, that parameter is no longer supported (this is why the registry method exists). There have been a few other windows registry installation questions on stack overflow that may help you with your updated question, but I don't know the answer offhand.
sdwilsh
A: 

I need to install firefox extension using windows registry. i have added my addon id and addon path in reg edit file. But the addon does not installed my firefox browser.

If you have any idea Kindly suggest me.

Thanks in advance.

Regards

Jasmin.

vasanthilakshmanan