Manually Repackaging the Firefox Installer on Windows

One of the things I've alluded to in a few posts but failed to actually post is how to manually repackage a Firefox 2 installer on Windows. This post will remedy that situation.

We have documented at least three different cases where we would need to manually repackage the installer (cases where the Firefox Release Repackager won't work). These cases included packaging more than two extensions, needing to update the list of files that are removed by the installer and most recently, replacing setup.exe with a rebranded version. Let's talk about how we can manually repackage the installer.

First thing is to download the installer we want to repackage and unzip it using 7-Zip. For our example, we'll use Firefox 2.0.0.5. Create a directory and then download Firefox Setup 2.0.0.5.exe. Execute the following command to extract the contents of the file:

7z x "Firefox Setup 2.0.0.5.exe"

This will unpack the contents into the directory. After you have unpacked the file, move "Firefox Setup 2.0.0.5.exe" into a different directory or remove it.

Next we make the updates we want to make, such as replacing setup.exe, changing removed-files.log or adding additional extensions. After we've made our changes, we want to repackage the files into a 7-Zip archive.

7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3

This will create a file called app.7z that contains our files. Note that I can't tell you what all those parameters do - those are copied directly from the Firefox build scripts.

For the next step, we'll need to download a file and create a file. We need to download 7zSD.sfx which is the self-extracting installer. You can download it here. Then we need to create a file called app.tag that looks like this:

;!@Install@!UTF-8!
Title="Our New Name"
RunProgram="setup.exe"
;!@InstallEnd@!

app.tag is used to tell the self extracting installer what file to run after the files are extracted. I'm not sure what "Title" is used for.

Now that we have all the files, we can actually create the installer:

copy /B 7zSD.sfx+app.tag+app.7z our_new_installer.exe

The "/B" is very important! It tells copy that these are binary files so it doesn't add extra characters to the files.

And that's it. We now have a self extracting installer with our customizations.

Firefox Enterprise Working Group Call Reminder

Just a reminder that we will be having our first Firefox Enterprise Working Group call tomorrow. The theme is "experience." Here's the meeting details:

Wednesday, July 25 at 10:00am Pacific, 1:00pm Eastern, 17:00 UTC.

Call-in information:

  • 650-903-0800 or 650-215-1282 x91 Conf# 280 (US/INTL)
  • 1-800-707-2533 (pin 369) Conf# 280 (US)

We'll also have a "backchannel" for people to talk on irc if they want - irc.mozilla.org - #ewg

Please don't feel like you need to be involved in an "enterprise" in order to participate. We're expecting folks involved in enterprises, educational institutions, and more.

Please update the wiki if you can with your participation. As pointed out earlier, you can be as anonymous as you want. The wiki is at http://wiki.mozilla.org/Enterprise.

We look forward to your participation!

Operator and hAudio

One of the cool things that you can do with Operator is experiment with new microformats. The folks at Digital Bazaar and others have been working on an hAudio microformat and David Lehn has created some experimental Operator User Scripts for you to try out. hAudio.js contains the primary microformat. money.js is used to allow actions on currencies.

You can try out these microformats on the site Bitmunk, as well as WebOrganics

Rebranding the Firefox Installer

Updated files for Firefox 2.0.0.9 are available here.

One of the other extensions I've written is the Rebrand extension. This extension allows you to rebrand Firefox to whatever you want just by installing an extension. A question I often get asked by people that use this extension is whether or not it is possible to rebrand the installer. This post will provide instructions on how to rebrand the Firefox 2 installer. In particular, we are going to create a new customized setup.exe that can be used with the instructions in this post. Basically you unpack the installer and simply replace setup.exe with the new one we will create.

The installer for Firefox 2 is based on the Nullsoft Scriptable Install System so first we need to install NSIS.

To actually customize the installer, we need the original files that were used to create the installer. I have packaged the files from a non branded Firefox 2.0.0.5 for you. That means the files show "Bon Echo" instead of "Firefox" and the images are just a globe (no Firefox). You can download them here. After you download the package, unzip it into a directory and we're ready to go.

Here are the files we'll need to change.

  • license.rtf - This is the license agreement that must be agreed to by the user during the install. You'll need to replace it with your own RTF file containing a license. If you do not want or need the user to agree to a license agreement, you can comment out the line:

    !insertmacro MUI_PAGE_LICENSE license.rtf

    in installer.nsi.
  • branding.nsi - This file contains most of the text changes you'll make, including name of your browser and your company.
  • wizHeader.bmp - This image is at the top of right of every page in the installer.
  • wizWatermark.bmp - This image is on the first page of the installer.
  • defines.nsi - This file contains some version specific strings, so it will need to be changed as you move to different versions of the Firefox source code. It will also need to be changed if you change the name of the executable.
  • version.nsh - Unfortunately the installer folks didn't do a good job of keeping branding strings just in branding.nsi, so there are a few miscellaneous things you might want to change here.

Now that we've customized the files, it's time to build the installer. To do this, we'll use one of the tools that came with NSIS, makensis.exe.

makensis installer.nsi

If we did things correctly, the result of this command should be a new setup.exe that contains all of our customizations. You can test this immediately by just running setup.exe and seeing if it contains your customizations.

There's not a quick and easy way to integrate this setup.exe into the Firefox packaging, so for now my recommendation is to unpack a Firefox 2 installer using 7-Zip and simply replace setup.exe with the new one you just created. Once I get the information on manually repackaging Firefox, I'll post it.

Note that this is a new process I've just put together, so please let me know if I've missed anything or if you have problems.

Firefox Enterprise Working Group Update

Fixed Eastern time - sorry about that.

I wanted to give an update on where we are with the Enterprise Working Group. We're planning our first call for Wednesday, July 25 at 10:00am Pacific, 1:00pm Eastern, 17:00 UTC. Here's the meeting details:

  • 650-903-0800 or 650-215-1282 x91 Conf# 280 (US/INTL)
  • 1-800-707-2533 (pin 369) Conf# 280 (US)

Please don't feel like you need to be involved in an "enterprise" in order to participate. We're expecting folks involved in enterprises, education institutions, and more.

Each of the calls will be organized around a central theme, with the primary goal being to simply communicate information and document that information, in the hopes that people inside and outside the group can learn from our experiences. For the first call, the theme is going to be "Experience" and I'm hoping to get people to talk about what their experiences have been so far, not just with deploying Firefox but with communication around Firefox within their organization, including convincing people that it's important. The theme of the next call (in approximately two weeks) is going to be "Wishlist" and we'll talk about what people see missing from Firefox for enterprise deployment. If you definitely want to speak about your experience on the call, you can email me in advance at ewg@kaply.com with your name and a summary and I'll make sure you can share your experience. That will help things move along on the calll

Our plan on the calls is to allow for completely anonymous participation with regards to the company/institution for which you work. We understand that there is the potential for sensitive information to be shared, so no one is required to share their affiliation on the phone call or in any documents produced by the Firefox Enterprise Working Group unless they choose to do so. We will probably come up with some generic way to categorize companies like based on employee count or something like that, primarily so that companies with similar deployment situations can work together.

The wiki is going to be hosted at http://wiki.mozilla.org/Enterprise. We'll also be starting a blog specific to the group.

We look forward to your participation!

Incidentally, we already have someone that will participate in the Firefox Enterprise Working Group that is blogging. Check it out here.

Writing User Scripts for Operator

I think the APIs in Operator 0.8b have settled down enough that I can start to document how to write user scripts. Note these user scripts are for Operator, NOT for Firefox 3. How things will work in Firefox 3 hasn't been decided yet. And I am working very hard to make this the final API for Operator 1.0.

What are Operator User Scripts?

Operator user scripts are user added pieces of JavaScript that can enable additional functionality within Operator like new actions for microformats and RDF, as well as adding new microformats. Examples can be found on the Operator User Scripts page. User scripts are added to Operator by opening Options and selecting the User Scripts tab. You can then select a user script that has been saved to your local hard drive. People have asked why I don't allow user scripts to be installed directly from the web similar to Greasemonkey scripts. There are two reasons. First, the code to do that detection is licensed under GPL, so I can't just take it and put it in Operator. Second, Operator user scripts operate with the same security privileges as an extension so they can pretty much do anything they want. That's not something you want to install in a drive by situation.

Writing a User Scripts

I'm going to have separate pages for the user script documentation, rather than using posts. The first one is here - Creating a Microformat Action User Script (Basic). As always, I appreciate feedback, especially from folks that have already written actions. And speaking of actions, we have some new ones to add to the list:

Enjoy!

Operator 0.8b is Available

I have made a beta of Operator 0.8 available. Continued thanks to Elias Torres for the RDFa support.

Operator 0.8b adds a much requested feature - an operator icon on the location bar. It's not perfect yet, but it is there. Also, I updated the action API a little bit to allow for the naming of actions as well as having actions act on multiple properties in a microformat. For instance, in the past, the "Goto web page" action only worked for the first URL in an hCard. Now it will work for all the URLs.

The other big fix in this release was that there were cases where sorting/removing duplicates didn't work correctly. For action developers, I added the ability to have multiple translations of an action in one action. I'll document that soon.

All the caveats from Operator 0.8a apply, so please read them.

Please report bugs here.

Have fun.

New Actions for Operator 0.8

I know I've been slacking on posting information on how to create actions for Operator 0.8. I've been tweaking the API a little bit, so that's why I've been hesitant. Operator 0.8 beta will be very soon, and then I'll post a tutorial on creating actions.

In the mean time, I have been working with a few folks to get their actions working on Operator 0.8.

  • The Minimap Addon gives you a suite of built-in maps and mapping tools for your web browser. And it also supports integration with Operator.
  • Egon Willighagen is using RDFa combined with an Operator action to allow for searching PubChem from the Chemical Blogspace. More information is available in his post.
  • Søren Johannessen has updated his actions for the Danish Blogosphere for Operator 0.8. You can read about them and download them at microformats.dk.
  • Pelle Wessman has updated his actions for the Swedish Blogosphere for Operator 0.8. You can read about them and download them at http://pelle.vox.nu/.
  • Charl van Niekerk has created actions for the African Blogosphere for Operator 0.8. You can read about them and download them at http://blog.charlvn.za.net/.

And I've been adding/updating some of my user scripts. These include support for the license microformat, as well as some improvements to species.

Incidentally, the improvements to the action API will NOT break actions already written for Operator 0.8. The improvements include the ability to translate your actions into other languages, the ability to customize the name that appears for your action in the Operator dropdowns and the ability to have multiple items in the action menu for something that appears multiple times in a microformat. For instance, in the past, even if an hCard had multiple web pages, there was only one action that opened the first web page. Now an action can detect the multiple web pages and display unique action names for each of them.

Stay tuned!

Floods in Central Texas

I don't tend to post personal stuff on my blog (yet), but I couldn't resist this one. Around SXSW I posted some pictures from the back of my house showing the river when it was low:

and swelled from the rain (which it looks like most of the time now since we've had good rains here lately):

Here's what it looks like today:

You can check at the video at KVUE here and here.

They did their flood updates from my back patio.

Firefox in the Enterprise: Part 2 - Benefits

Before I get started with this post, I wanted to let people know that I am working with representatives of other companies to form an Enterprise Working Group for Firefox. The goal of this group will be to work together to document enterprise requirements and either create extensions or submit patches to Firefox to meet these requirements. We hope that anyone interested in Firefox in the enterprise will join us. We'll be having our first meeting in the next few weeks.

In my previous post I talked about obstacles to the enterprise adoption of Firefox, but it wouldn't be fair to talk about obstacles without talking about the benefits. We all know the benefits to Firefox users, like tabbed browsing and pop up blocking, so this post is going to focus on enterprise specific benefits. Obviously there are many more benefits beyond what I'm covering here. I'd love to hear your opinion in the comments on this post.

Extensions

Extensions are a great way to add genuine business value to Firefox. Within IBM, for example, we have extensions like Koala that can be used to automate business processes, or extensions like Tommy! which take our corporate directory to the next level by integrating other services like blogs. We have an extension available that uses the Firefox password manger to enable single sign on to IBM domains. And of course we have the CCK to produce IBM customized versions of Firefox. We have also seen Greasemonkey used to add business value. For instance, one of our support teams uses a Greasemonkey script to prefill fields in a web application that would normally have to be done with every problem report. The result can be seen in real time savings for support calls.

And these are just few. I haven't even mentioned some of the other extensions that add IBM specific toolbars or enhance our ability to search our corporate directory. So what does this mean for your business? There are probably areas where a simple Firefox extension or Greasemonkey script could greatly enhance the experience of your employees. It's definitely something to keep in mind.

Customization

I really can't say enough about the customizablity of Firefox. Because most of the user interface code is written in JavaScript and can be modified via extensions, I have been able to do some extensive customization. I've had schools approach me about things ranging from removing history or bookmarks to disabling access to preferences. I have been able to accomplish all of this through the use of extensions. If you have specific needs around browser customization, whether it be locking down the browser, or perhaps a kiosk, Firefox can be customized to meet that need.

Web Development

My experience has shown that Firefox has become the web development platform, even for organizations that use Internet Explorer internally. The extensions available for Firefox, like the Venkman JavaScript Debugger, the DOM Inspector, Firebug, and the Web Developer extension make web development much easier on Firefox. And there are even more extensions to benefit the web developer.

Open Source

There are some Firefox benefits specifically because it is open source. You can replace the existing update infrastructure with your own so updates are served from your servers. If you have questions, you can access developers directly. When you open a bug, you can keep up with the status and even choose to fix it yourself. You have access to the source code for debugging problems. You can build your own browser with patches that you want if it comes to that.

Open Standards

By using Firefox, you are encouraging the use of open standards and protocols, and helping to keep the web open.

Summary

That's all I have for now. I know I've only scratched the surface here. Please comment as to additional enterprise benefits. And stay tuned for more info on the Enterprise Working Group.