Config files and scripts to create MSI-files for Firefox and Thunderbird, almost completely automatic, within two minutes. Requires only tools which are completely free (no demo, fully free).
Note about Thunderbird: This page talks in many places only about Firefox, but config files are provided for both programs, and all descriptions apply to both. Just change the variable appname in the file init.bat to toggle between processing Firefox and Thunderbird.
Updates
2017-04-13: Firefox 52 triggers warning from light.exe
warning LGHT1076 : ICE60: The file filA8B8DD2ECDA7D0B88DF54B62F4BAC465 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
The filename is random. The referenced file is EmojiOneMozilla.ttf.
It will nevertheless be included in the MSI-file and get installed in the fonts subdirectory.
2015-08-08: Project abandoned
I will probably not find time to finalize the port of this from Win-XP to Win-7 anytime soon.
2014-09-05: progress switching registry filter to whitelist
Finally: filter registry entries with whitelist instead of blacklist.
No surprises so far, but still testing, because better safe than sorry.
Next up: fix the last Win7 issues, then update this web page.
2014-07-25: Thunderbird 31
If you use this for Thunderbird 31,
delete the file "Thunderbird userChrome.css" after extracting the zip file,
and edit the file "Thunderbird mozilla.cfg":
change the value of toolkit.telemetry.prompted
from true to 2.
Also there appears to be yet another error in setting
a wrong registry key in 64bit Win7 (probably harmless).
Warning: run these scripts in XP only (in a virtual machine):
This was developed and tested long ago in Windows-XP (32bit).
The created MSI-files also work in Windows-7, both 32 and 64bit
(only the registry-key TaskBarIDs will be missing).
In theory the reverse should also be possible.
Starting with the version March 18th 2013 this should probably
actually work, at least in 32-bit Windows-7.
However I must strongly recommend to not do it, because in one
case I found a really nasty interaction between Mozillas Installer,
the tool RegFromApp, and Windows-7, which can have serious consequences:
It can cause additional registry keys to end up in the output of RegFromApp,
and subsequently in the MSI-file. In one case it was the key
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
Installing the resulting MSI-file appears to work fine first, but uninstalling
it would remove a lot of registry entries that obviously should better not be removed!
This specific key is now filtered out in the current version,
but I cannot rule out the possibility of more such surprises.
Thus I plan to change the registry filter to use whitelisting instead of blacklisting.
Meanwhile double-check the two reg-files to make sure nothing is in there that
could cause problems upon install or uninstall.
Also Windows-7 64bit is probably too much different to fit well. Not only does the installer from Mozilla set many different registry keys there, it also leaves away an incompatible DLL (and all its registry keys). If you want MSI-files that work correctly in 64bit Windows-7, then you should create them in 64bit Windows-7. If you need MSI-files for both 32bit and 64bit, then you should create two different MSI-files. I have seen Firefox installed with MSI-files from Windows-XP work in Windows 7 64bit, but on inspection of the registry keys, I see many differences, and do not yet know if any of them are relevant for correct operation of some functions.
Flexible: Works both with the normal rapid-release versions, and the esr versions. Tested with versions 10esr, 16, 17esr, 23, and 24 beta 9.
Reliable: This is not the wrapper-trick, and not one of the (often unreliable) before-after comparisons. It creates perfectly pure MSI-files, using the WiX toolset by Microsoft. All installation steps will be performed cleanly by Windows-Installer, there are no troublesome 'Custom Actions' involved.
Customizable: You can easily add config changes. My example disables the automatic updater and contains a few more suggestions. Just change this and/or add more. More info below.
optional adjustments:
If both scripts ended with *OK*, you should now have the MSI-file. The program, that was installed during this process, should have been automatically uninstalled after the last keypress.
The MSI-file tells windows installer to do four things: copy files, create shortcuts, define registry keys, and declare an icon for ARP.
The files are taken from the directory into which Firefox was installed.
Shortcuts are declared in the Startmenu, and on the Desktop for all users. If you don't like the desktop shortcut, edit the file 'mozilla.wxs' and remove that entry. This file is extremely difficult to set up, but the existing file is sufficiently self-explanatory to easily find the right place.
Collecting the registry settings works like this:
The contents of the file Firefox-setup.exe are extracted with 7zip.
This delivers most files that later end up in the program directory,
plus a setup program in the file 'setup.exe'.
The command 'setup.exe -ms' is run from within RegFromApp,
and the created registry keys are saved in the file regkeys1.reg.
Next the command 'helper.exe /SetAsDefaultAppGlobal' is run from within RegFromApp,
and the created registry keys are saved in the file regkeys2.reg.
These two reg files are cleaned of excess and problematic keys,
and then converted to the required XML structure with the
WiX tool 'heat.exe'. In these files the absolute paths
containing %ProgramFiles% are replaced with a installer variable,
that windows installer will later expand to whatever is the default path
on the destination machine.
The icon for ARP was extracted from the executable with Icon Extractor. Please note that Mozilla does not permit to distribute custom created installers that use their original program name and/or icon, see their trademarks policy.
More on registry keys:
Capturing the registry keys written by helper.exe will work only when helper.exe is run for the first time. Consecutive executions of the same command will cause less registry keys from being written. Thus Firefox must be uninstalled and re-installed before running the capture again.
The tools strxchg.exe and clrregfile.exe were written by myself. They allow to automate the process of cleaning up the extracted registry keys. Source code is included (FreePascal) for both. The tool StrXchg (String Exchange) can replace every occurence of a text in a file with another text. ClrRegFile (Clear Registry-File) can remove single values or whole keys from a reg-file (if the registry file was saved in format version 4, or was at least converted to ansi encoding).
The removed registry keys are: CurrentVersion\Uninstall, FirefoxInstallerTest, Windows\CurrentVersion\Explorer, and everything in HKEY_CURRENT_USER (MountPoints2 and Shell Folders). Removing the uninstall key prevents a duplicate ARP-entry (windows-installer automatically adds one as well). FirefoxInstallerTest is only a temporary test key, the removal of which WiX doesn't understand. MountPoints2 and Shell Folders are not necessary, and they are set in HKCU, but the MSI is made to be installed per machine, thus this would trigger a warning from WiX.
How to make these scripts run savely in Windows 7?
I plan to rewrite my registry cleanup tool to make it do whitelisting instead of blacklisting.
Then potentially harmful registry keys cannot creep into the registry files, regardless of any more hickups
that the RegFromApp tool might have in Windows 7.
Will you offer firefox.msi for download?
No, Mozilla does not allow this.
Do these MSI-files have disadvantages compared with using the original setup.exe?
Yes: uninstalling will not restore Internet Explorer as default browser.
This is a shortcoming of Windows Installer: it removes registry entries, instead of restoring them
to the previous state. Working around this would require to use a Custom Action, but I refuse to dig
any further into WiX, especially regarding Custom Actions. You can put a shortcut to Internet Explorer
on the desktop, the program will ask to make itself default when run. Also it would be easy to make an MSI-file that
sets the required registry keys.
Do the MSI-files include the Mozilla Auto-Updater Service?
No. The files for this service are installed into a different directory,
thus they are not collected. Also the registry keys for that service are set by a different setup program,
so they are not collected either. I don't plan to ever include them, because if you deploy software,
you should also deploy the updates yourself, and then any other automatic updater would only cause problems.
Why is the MSI-file bigger than the original installer by Mozilla?
Mozilla uses 7zip compression, whereas Windows installer uses an older
and less efficient compression method.
Why the conversion from unicode to ansi and back to unicode?
heat.exe would garble umlaut characters like ä when reading files
with ansi character encoding (like registry files in file format 4),
but my tools StrXchg and ClrRegFile wouldn't work with unicode files
(because FreePascal 2.6 doesn't support it, will be added in 2.8).
What is 'ARP'?
Short for 'Add- or Remove Programs',
the control that comes up when you choose to remove software,
can also be started by running the command 'appwiz.cpl'.
Also see mike.kaply.com/2012/03/16/customizing-firefox-autoconfig-files
last modifications: