Note: Installing Firefox on a Fresh Windows Install without using IE

It’s no big secret that Microsoft’s Internet Explorer and it’s closely related cousin, Edge, are not the world’s favourite browsers. They’re not even my favourite and for a number of good reasons.

In the battle for market share, Microsoft has pushed Edge upon the users of Windows 10 by giving it default placement, by captioning it as the “recommended” candidate, by resetting defaults occasionally after updates to favour it and by putting pop-ups that remind users that performance and battery life is “better” under Edge. Unfortunately, these reasons are not enough … and their validity is a little questionable.

But for better or worse, we will fire up either IE or Edge just once, to download our favourite browser. Kind of like what this popular comic by “Merryweathery” shows.

But to do that will lead to a barrage of advertising for the browser. I’d rather avoid confronting IE or Edge altogether.

Putting IE out of business

The problem is that it’s a bit of a chicken and egg issue. How does one get a new browser without using the only supplied browser? Unfortunately, there is always a dependency somewhere – you need at least some prior knowledge to make this happen.

In the old days, you could just fire up a command prompt terminal, open up FTP (which comes included in Windows), connect anonymously to a download server and initiate a transfer of an installer that way. Unfortunately, it seems like FTP mirrors are a bit of a dying breed as FTP is not a particularly secure protocol.  Even Mozilla’s ftp.mozilla.org no longer works, which is a shame, as that would have been an “easy” and familiar way to avoid IE-chan all together.

Instead, we must do our downloading through HTTPS. Under Linux, there are always tools available – wget comes as standard. Under Windows, the tools are lesser known and sometimes need to be slightly abused to meet our goals.

You also need some prior knowledge – i.e. where the installer file is located (i.e. its URI). Unfortunately, determining this is not as simple as it could otherwise be, due to the script-heavy nature of the websites and tracking involved nowadays. The URI can also change when versions change, so it’s best to find an official URI that is a “metalink” to the latest version of a given browser.

My favourite browser is Firefox. After some work, I determined the best URI to use is:

https://download.mozilla.org/?product=firefox-stub

This is a metalink that will download the latest stub – this is an installer that then goes to download the newest version and finally install the browser. Unfortunately, trying to determine the same address for Google Chrome led me to understand that they seem to be generating “tracked” unique links with customised binaries to track installs – so no such luck there.

This isn’t particularly easy to remember, so there might be a temptation to shorten it. Unfortunately, the risk of doing that is to introduce a security issue where you might be misled to download another installer and get some malware instead. Best to stick with the proper URI – perhaps print it out, write it down on the installer CD, save it into a text file or download one of the scripts linked later onto your installation medium.

Method 1: Windows PowerShell

For later versions of Windows, PowerShell may be installed and available for use. This seems to provide the neatest way of performing the download, through the Invoke-WebRequest call:

Invoke-WebRequest -OutFile "Firefox Installer.exe" -Uri https://download.mozilla.org/?product=firefox-stub

Running this call will result in a pale-blue PowerShell window appearing for a short while as the file is downloaded, before exiting.

Method 2: Abusing certutil

If you don’t have access to PowerShell, the next best solution seems to be to abuse certutil to act as a downloader. The upside to this is that you don’t need administrative privileges to run – it can be run in a standard command prompt.

certutil -urlcache -split -f "https://download.mozilla.org/?product=firefox-stub" "Firefox Installer.exe"

The downside seems that it doesn’t print much progress status before exiting, but it does the job just fine.

Method 3: Using BITSADMIN

The third method, in case you can’t seem to use certutil, is to use BITSADMIN. This is apparently a depreciated method, but it uses the Background Intelligent Transfer Service (BITS) as used by Windows Update and other services to download the file. BITSADMIN appears to require administrative privileges to operate, otherwise you will get an error 0x80070005.

If you run the command as administrator, it will download the file into C:\ (as it requires a full path).

bitsadmin /transfer GetFirefox /download /priority normal https://download.mozilla.org/?product=firefox-stub "C:\Firefox Installer.exe"

It does show some status during downloading, but it also seems to be slower as it tries not to monopolise bandwidth.

After using one of the above three methods, we are rewarded with our precious stub installer file, which we can then execute and fully install the browser.

If you want to just download the scripts as a ZIP file, you can get them here.

Method 4: Get a Linux Live CD

I’m actually a strong advocate of having a Linux Live CD or USB stick around, as Linux is very useful and can “save your bacon” in many cases. This is equivalent to having a full operating system you can boot as an alternative to Windows. You can use whatever tools and browsers are in your Live CD and use that to download the browser of choice to a storage medium to install under Windows.

It’s like getting a jackhammer to crack a peanut … but it works … and I suspect you can get Chrome this way as well. But seeing as you’ve come so far, maybe it’s time to ditch Windows altogether or at least dual-boot?

Conclusion

As it turns out, through Invoke-WebRequest, abusing certutil or using BITSADMIN, it’s possible to grab an alternative browser without having to fire up IE at all. But this is predicated on a few things – that you have the knowledge of the URI of the installer package and the syntax which is required to make use of the tools.

I’ve written a few simple scripts to do it, which can be saved to your installation media as a convenience – but you could just as easily print out the one-liners for reference. Of course, there are no guarantees that the URI won’t change – if it does, then the scripts will likely stop working … and either you use another computer/OS to find out the new URI or you parse HTML in Notepad with your eyes to try and determine the new URI.

Or … give in and fire up IE once more …

About lui_gough

I'm a bit of a nut for electronics, computing, photography, radio, satellite and other technical hobbies. Click for more about me!
This entry was posted in Computing and tagged , , , . Bookmark the permalink.

9 Responses to Note: Installing Firefox on a Fresh Windows Install without using IE

  1. I ran BITSADMIN and it took ~ 3 seconds!

    To digress: I run the Private Internet Access VPN and certain sites block me, sometime with no error msg. Apparently because the VPN server is persona non grata. So, penalized for better security.

    • lui_gough says:

      That’s not bad at all. I find it takes a little longer as it schedules a job and checks in on it every so often. BITS, as the name implies, tries to do the transfers in the background. As a result, if there is bandwidth congestion and you are using the network, it will back-off on its transfer rate accordingly to minimise disruption. Great for updates, but probably not ideal when it comes to trying to grab something “interactively”. In my experience, the PowerShell “InvokeWebRequest” version takes <1s even on my variable LTE link to download the 352kiB stub ... but as mentioned by another reader - Windows Subsystem for Linux is another way (along with my suggestion of Cygwin as an alternative).

      - Gough

  2. Robert Schaffrath says:

    If you have installed the optional Linux environment under Windows 10, then you have access to “bash” and can type:

    wget https://download.mozilla.org/?product=firefox-stub –output-document=firefox-installer.exe

    I often find myself going into the Linux shell to do things that Windows is missing. Until release 1803, I had to go there to do “ssh” and “sftp”. Thankfully they ported them natively to Windows 10.

    • lui_gough says:

      Indeed, using WSL is something that didn’t come to mind, primarily because I don’t use WSL myself. However, I’m glad to hear that you can install it simply by running a PowerShell command:

      Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

      It’s important to note that this will only work under Windows 10, and because I’ve always wanted/needed BASH scripting and other GNU/Linux tools, I’ve been a Cygwin user for a long time.

      So it’s probably just as good to try and install Cygwin by grabbing:
      http://cygwin.net/setup-x86_64.exe
      or
      http://cygwin.net/setup-x86.exe
      using the same means as noted before. Then, you can have access to the likes of wget, cURL, grep, sed, git, ssh, etc under Windows while also being compatible with older versions of Windows as well.

      – Gough

  3. zakius says:

    or you can just use edge since quantumfox is equally sueless

  4. Ever since discovering Ninite.com I’ve kept a copy of an installer setup for Chrome and various must-have first install tools (Putty, Notepad++, etc) available on a network share or private url. It’s vastly simplified the first steps in provisioning a new machine for me. The fact that a single exe generated a few years ago continues to automagically install the newest versions of multiple programs without any interaction on my behalf is a life saver.

    • lui_gough says:

      In the old days, I would do exactly the same and keep full-version installs lying about on my NAS. Being on a slow internet connection with a bandwidth quota was one motivation.

      Unfortunately, since versions keep rolling-around every few weeks, it seems more convenient to grab whatever is latest online. While you could store the installer stubs, occasionally they may fail to work as the back-end service changes or they discover a vulnerability in the download mechanism that could lead to unintended code download/execution. As a result, I’ve reverted to trying to grab the most recent installs online at all times (or a trusted full version installer, rather than the stub and then update from within the app if I’m lazy).

      – Gough

      • That’s exactly what Ninite.com automates. It’s a one-time stub that grabs the newest versions of whichever apps you’ve selected from a rather generous list of applications. The installer stub hovers around 300k, and then silently installs the most current version automatically skipping any ‘potentially unwanted’ parts of the install.

        • lui_gough says:

          It may do that, but trusting someone else to point you to the right version of an app could be quite a dangerous precedent, similarly to those Linux software installers which ask you to do a wget and pipe the output straight into the shell. Sometimes things can fall through the cracks – so I often prefer going straight to the source for that reason.

          More than that, I’m not a fan of the following either – from their privacy policy:
          – Some apps are tagged with a Ninite affiliate key. Ninite receives a commission when users upgrade those apps.
          – After installing apps non-identifying diagnostic information (OS version, language, machine architecture, failure status of installers) is reported back to Ninite so we can improve reliability.

          – Gough

Error: Comment is Missing!