Post navigation

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.

13 thoughts on “Manually Repackaging the Firefox Installer on Windows”

“needing to update the list of files that are removed by the installer”

If the files are added to the non-localized or localized directories in the self extracting archive they will be automatically added to the uninstall.log and removed during uninstall. For the installer the removed-files.log can be manually modified to specify additional files to remove during install.

By the way, I am interested very much in your guide “Deploying Firefox 2 within the Enterprise”. I tried to transfer for Firefox 4 Beta Versions. But I found the right base Firefox code. I hoped there is a way to create Firefox Update files of Customize Firefox 4.

I’m interested very much in your guide Deploying Firefox 2 within the Enterprise. I tried to transfer it for Firefox 4 Beta. I’m afraid that I can´t find the right Base Firefox 4 Code. It would be great if there is a way to create Firefox 4 Update files (MAR’s).

This works great in firefox 19. Where did you find the code for the build scripts? Fantasic stuff, I was wondering how I was going to deploy this, this helped a ton. Very easy to follow! I also used one of your older tutorials for extension placement to hold true in all profiles. Thanks for the all the info!