Changes

Jump to: navigation, search

Firefox

1,213 bytes added, 19:22, 4 August 2010
Extensions: Update 3.x Extension section with more detail
==== Firefox 3.0 Series Extensions ====
'''Note:''' With Firefox Starting in 3.6, the "-install-global-extension" command -line switch has been disabledparameter is deprecated and the new official procedure to install a global extension is: extract the extension and copy the folder to the %ProgramFiles%\Mozilla Firefox\extensions folder with a folder name matching the extension GUID.
To install extensions globally:Install the extension by hand, this will (for IETab) create a directory "{77b819fa-95ad-4f2c-ac7c-486b356188a9}" in your %userprofile%\Mozilla\Extensions. Copy this folder to a reasonable place within your %SOFTWARE% share. To install the application, If you will have to xcopy or robocopy it to your "%PROGRAMFILES%\Mozilla Firefox\a large number of extensions" directory.You will need to get robocopy or xcopy for this. xcopy comes with WinXPmanage, Robocopy is part of consider using the Windows Resource Kit. Copy Extension Templates described in the *copy.exe file to your %SOFTWARE%-share, a "tools"-folder might be a good place for that.Don't be confused, the exit code "1" of robocopy means success! (don't ask me why..next section.)
In your repository under the firefox folder, create a folder for each extension you want to package. Save the downloaded XPI to that folder. To download and extension from addons.mozilla.org, right-click on the Add to Firefox button and choose Save Link As. Create a folder in the extension folder for each new version of the extension. Extract the extension to its respective version folder. Extensions can be extracted as ZIP files, either by appending a .zip extension or using your preferred archive utility. See below for an example of the recommended directory structure.
==== IETab with Firefox 3.6 ====<source lang="xmldos"><package id="firefox3-ext-ietab"%SOFTWARE%\ name="firefox\ Firefox Extension IETab"Setup 3.6.7.exe revision=" Firefox Setup 3.6.8.exe adblock\ adblock_plus-1".2-fx+sm+tb+fn.xpi reboot="false" adblock_plus-1.2.1-fx+sm+tb+fn.xpi priority="0" 1.2\ <extracted extension files> 1.2.1\ <extracted extension files></source>
<depends packageAfter you have extracted the extension, open the install.rdf file to retrieve the extension's GUID. The extension GUID shouldn't change between versions. This is also a good opportunity to double-id="firefox3" />check the version number. Look for the line near the top, like this one from Adblock Plus:
<variable namesource lang='fxdir' value='"xml"><em:id>{77b819fad10d0bf8-95adf5b5-4f2cc8b4-ac7ca8b2-486b356188a92b9879e08c5d}' </em:id></source>
<check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Firefox\extensions\%FXDIR%\chromeNow that you have extracted the extension and retrieved the extension GUID you can create the package.manifest" />The following is an example for Adblock Plus:
<install cmdsource lang='taskkill /F /IM firefox.exe'"xml"> <exit codepackage id="0firefox-adblock" /> <exit code name="128Adblock+" /> </install> <install cmd revision='%COMSPEC% /C "%SOFTWAREversion%\Tools\robocopy.exe" /E priority="%SOFTWARE%\Internet\Firefox\Extensions\%FXDIR%10" "%PROGRAMFILES(x86)%\Mozilla Firefox\extensions\%FXDIR%"'> <exit codevariable name="0version" value="1.2.1" /> <exit codevariable name="1extid" value="{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}" /> </install>check <install cmdtype='cmd /C copy /Y "%SETTINGS%\ietab.jsfile" condition="exists" path="%PROGRAMFILES%\Mozilla Firefox\extensions\%FXDIRextid%\defaults\preferences"' /> <install cmd='taskkill /F /IM firefoxchrome.exe'> <exit code=manifest"0" /> <exit code="128" /> </install>
<upgrade install cmd='%COMSPEC% /C xcopy /E /Y "%SOFTWARE%\apps\firefox\adblock\%version%" "%PROGRAMFILES%\Mozilla Firefox\extensions\%extid%\"' /> <upgrade cmd="taskkill /F /IM firefoxFirefox.exe'"> <exit code="0" /> <exit code="128" /> <exit code="-1073741515" /upgrade> <upgrade cmd='cmd /c rmdir /q /s "%PROGRAMFILES%\Mozilla Firefox\extensions\%FXDIR%"' /upgrade> <upgrade cmd='%COMSPEC% /C if exist "%SOFTWAREPROGRAMFILES%\Tools\robocopy.exe" /E "%SOFTWARE%\Internet\Mozilla Firefox\Extensionsextensions\%FXDIRextid%" rmdir /q /s "%PROGRAMFILES(x86)%\Mozilla Firefox\extensions\%FXDIRextid%"'> <exit code="0" /> <exit code="1" /> </upgrade> <upgrade cmd='cmd %COMSPEC% /C copy xcopy /E /Y "%SETTINGSSOFTWARE%\ietab.jsapps\firefox\adblock\%version%" "%PROGRAMFILES%\Mozilla Firefox\extensions\%FXDIRextid%\defaults\preferences"' /> <upgrade remove cmd='"taskkill /F /IM firefoxFirefox.exe'"> <exit code="0" /> <exit code="128" /> <exit code="-1073741515" /upgrade> </remove> <remove cmd='cmd %COMSPEC% /c C if exist "%PROGRAMFILES%\Mozilla Firefox\extensions\%extid%" rmdir /q /s "%PROGRAMFILES%\Mozilla Firefox\extensions\%FXDIRextid%"' />
</package>
</source>
 
If your extension requires additional configuration you can install it manually, make your changes, and then save the <extension>.js file from %AppData%\Mozilla\Firefox\Profiles\<random>\extensions\<extension GUID>\defaults\preferences. This file can then either be copied into your extracted copy of the extension, or it can be copied over with an additional install/upgrade action in the package definition from another location.
 
Note that there is no easy way to check the installed version of an extension. Also note that non-admin users will not be able to upgrade extensions which are installed globally. It's important to monitor extensions installed this way for updates.
=== Firefox 3.6 Series Extension Templates ===
As stated in: [[Firefox#Firefox_3_extensionsFirefox_3.0_Series_Extensions]] the "install-global-extension" switch doesn't work starting with Firefox 3.6.
So, there is a better and much smoother way deploying extensions. And: it makes adding a new extension to a WPKG repo about 80 percent easier: '''templating'''.
117
edits

Navigation menu