Page tree
Skip to end of metadata
Go to start of metadata

Installation

By OS:

Windows

Firebreath comes with a default script to generate an installer, please see this document http://www.firebreath.org/display/documentation/WiX+Installer+Help .

If you want to provide your own installer this is also possible. There are a few things your installer should do:

1. Register the plugin

Ideally, you should have your installer insert the registry keys for the plugin itself; optionally you can use self-registration (such as regsvr32), but this is considered bad practice in an installer.

However, if you choose to ignore this advice (don't complain to us when it causes you problems later on) you can register the DLL with your installer.  Here is an example for InnoSetup:

Filename: "regsvr32.exe"; Parameters: "/s ""{app}\bin\npYourPlugin.dll"""; StatusMsg: "Registering plugin"

If you use the built-in WiX integration that FireBreath provides the plugin will be registered properly so that the Windows Install Service will always be able to remove it properly. You can also use the built-in WiX support to generate the wix files needed and then get the registry key list from the WiX files to use in your installer.

2. Add additional registry keys

On IE plugins run in low integrity mode; if you use an additional process to assist with your plugin and you need it to run with medium integrity mode, you can use something like the following (InnoSetup format):

[Registry]
; create elevation policy for broker (silently to medium level), see http://msdn.microsoft.com/en-us/library/bb250462(VS.85).aspx
;Each broker should have a unique GUID -- this should not be the same as your plugin's CLSID!
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{{GUID HERE}}"; ValueType: string; ValueName: "AppName"; ValueData: "MyBroker.exe"
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{{GUID HERE}}"; ValueType: string; ValueName: "AppPath"; ValueData: "{app}\bin"
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{{GUID HERE}}"; ValueType: dword; ValueName: "Policy"; ValueData: 3

3. Sign your installer and plugin (Plugin Signing)

All binaries including the DLL, additional executables, installers, etc should be signed with a valid certificate with your company name; this prevents someone adding a trojan or otherwise modifying your plugin DLL undetectably

4. Install to an appropriate location

To make auto-update later easy, don't install into the Program Files folder. Instead, install your plugin "per-user" into the user's Local or LocalLow AppData folder. Changing anything in the Program Files folder requires Administrator rights whereas changing things in the user's profile folders requires only medium user rights. Since your plugin can easily run with medium user rights but not Administrator rights the user's app folder is the best place to install into.

MSI installers have been proven to work out quite well.

TODO: How to do updating? Change class id? Browser restart needed? Browser needs to be quit before update starts?

Mac

1) Provide a signed java applet for download and install
2) Provide a .dmg and install script as a backup for those users who are too paranoid too click the "Trust" button

Linux

Copy the .so file into the appropriate location for the browsers you want to support. IE, for firefox and chrome this is ~/.mozilla/plugins for the local user.

By browser:

Firefox

In addition to the default methods for deploying on the platform, firefox supports installing your plugin via XPI. This is not recommended by the FireBreath team because it only works on Firefox, not on any other browsers.

Internet Explorer

In addition to the default methods for deploying on windows, IE supports deploying via cab files. Cab files have the advantage that you can package the MSI file inside, which will install for all browsers; that can be achieved with an .inf file something like this:

[version]
Signature="$CHICAGO$"
AdvancedINF=2.0
[Setup Hooks]
hook1=hook1
[hook1]
run=msiexec.exe /i "%EXTRACT_DIR%\your.msi" /qn

Also note the use of the #Version fragment to indicate the version of the plugin inside the cab (see: http://msdn.microsoft.com/en-us/library/ms533576.aspx )

Opera

Does not offer any additional methods for deployment. (On windows, use normal windows install method, on Mac use mac install method)

Google Chrome and Chromium

Google Chrome and the Chromium browser both allow NPAPI plugins to be packaged into an extension, and can be made public so that all pages can use the plugin. You can have many variations of the same plugin compiled for different architectures.

Listed below is a link to the relevant google documentation -

https://developer.chrome.com/extensions/npapi

To update your plugin - you only need to publish a newer extension version with the updated plugin packaged within the extension.

NOTE: NPAPI plugins contained in Chrome/Chromium extension are not system-wide - they are only made available to the user who installed the extension, and only for that specific browser.

TIP: If you include an NPAPI plugin compiled for Mac OSX as well as a Linux compiled plugin in your extension - you must list the OSX compiled plugin first in the manifest file, or it will fail.

Safari

Does not offer any additional methods for deployment. (On windows, use normal windows install method, on Mac use mac install method)

 

Updating:

On OS X you need a version-specific filename for your plugin, e.g. put the version number in the filename. On Windows you even need to install it to a version-specific directory with a version-specific filename. Once the plugin is installed, you can try the following to reload the plugin in open browsers:

Make the browser refresh the list of installed plugins

navigator.plugins.refresh(false); 

This will not reload a currently loaded plugin, it will just make the browser aware of the new version.

Reloading a loaded plugin

Now you need to remove and readd your plugin (from ALL pages that use it).

 

Reload example
<script>
 var myplugin = "<object id=\"plugin\" type=\"application/x-foobar\"> </object>";

function onload(){ // Assuming this function put your plugin on the page in the first place
 document.getElementById('pluginHere').innerHTML = myplugin;
}

function reload(){
 document.getElementById('pluginHere').innerHTML = "";
 document.getElementById('pluginHere').innerHTML = myplugin;
}
</script>
... 
<div id="pluginHere">
</div> 

If you don't feel like sending out installers, scripts, ... for updates, you can take a look at Omaha and Update Engine.

  • No labels

9 Comments

  1. is there anyone succeed to reload a plugin on windows. Spend almost two day, failed to do so. I did exactly as above. thanks. what could be wrong?

  2. In order to even start answering your question we'd need a whole lot more information than "failed to do so".  That could mean anything from "nothing happened at all when I tried" to "when I tried it triggered a booby trap and my girlfriend was abducted by aliens and my computer exploded".  Also, I would strongly recommend you ask such a question on stackoverflow.com with the firebreath tag – a lot more people will see it.

    1. thanks for Richard's answer.

      I mean reload a plugin after update. I tried the mac version, it works as I expected, howeve, I need to change the plugin name for each version.

      navigator.plugins.refresh(false);
       

      In windows, I tried those steps, I couldn't make it work. do you know what could be wrong?

      "On Windows you even need to install it to a version-specific directory with a version-specific filename. Once the plugin is installed, you can try the following to reload the plugin in open browsers
       
      ....
       
      "
       
      thanks alot.
       
      Dave
       
       

       

  3. I would appreciate any recommendations on hosting auto-updates of the plugin. Specifically, I'm looking for being able to automatically update the plugin on the end-users' machines -  like Google chrome auto-updates itself without the user having to do anything (although I am open to seeking the user's permission before updating the software). My package is a .msi/.exe built using FireBreath / WiX subsystem. I'm aware of the Omaha open-source server, but I haven't found any hosted service where I could simply register and upload my plugin. I would prefer to avoid the hassle of hosting my own update server and am hoping to find a SaaS service that I could avail of. Any pointers will be appreciated.

    Best

    1. To the best of my knowledge, no such thing exists. Omaha is the best I know of for automatically updating; updating in-place inside the browser is fraught with painful debugging and few have gotten it to successfully work.

      1. Thanks Richard. And by the way, I can live without in-place plugin updates. I just need a hosted service where I could simply upload newer versions of the software manifest ... Anyways, at this point it seems I'll have to host / write my own. I could quickly whip up something in javascript and embed it into the web-app / browser-extensions.

  4. Unknown User (ilyxak)

    Link to code.google.com is invalid.

    Possibly it was moved here: https://developer.chrome.com/extensions/npapi

    Please validate.

    1. That was the correct link. Thanks, I updated it.

  5. A quick way to force plugins to be reloaded in firefox on linux:

    $ killall plugin-container