What is the most reliable way to test your Firefox installation?

I am creating software bundled with the firefox extension. In my script installation, I want to tell the weather of the user that he wants to install. But for this I need:

  • A way to find out if firefox is installed or not.
  • A way to find out which version of firefox is installed

How can I do these two things in InnoSetup or C #? I tried manually checking the path to the default firefox installation file, or checking the deletion of registry entries. I think these methods are not reliable at all.

+4
source share
3 answers

The recommended way to check for the key is HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox . For each installed version there will be a subsection. If you are paranoid, you can also check the value of HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\<version>\Main\PathToExe - if this file exists, Firefox is indeed installed and you are not looking at the obsolete registry key.

Please note that you can only detect a Firefox installation if the installer has been installed. You can always “install” Firefox manually by simply unzipping the executable installation file using 7zip - to any directory. Nightly builds are also available as regular mail files, which are easier to unpack. This will work fine, but will not add registry keys that will allow you to find this installation.

+6
source

I think that the key HKLM\SOFTWARE\Clients\StartMenuInternet\FIREFOX.EXE does not depend on the OS bit, so I suggest this.

+3
source

Here is an abbreviated list of generated keys (for installing Firefox 27.0.1)

 HKLM\SOFTWARE\Classes\FirefoxHTML\ HKLM\SOFTWARE\Classes\FirefoxURL\ HKLM\SOFTWARE\Clients\StartMenuInternet\FIREFOX.EXE\ HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe\ HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe\Path HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Mozilla Firefox 27.0.1 (x86 en-US)\ HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe\ HKLM\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\27.0.1 (en-US)\ HKLM\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox 27.0.1\ HKLM\SOFTWARE\Wow6432Node\Clients\StartMenuInternet\FIREFOX.EXE\ 

One of our customers did not have a “Delete”, so we will use the other from this list. I am going to use: "firefox installs when at least one of the following keys exists:"

 HKLM\SOFTWARE\Mozilla\Mozilla Firefox\ HKLM\SOFTWARE\Clients\StartMenuInternet\FIREFOX.EXE\ HKLM\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\ HKLM\SOFTWARE\Wow6432Node\Clients\StartMenuInternet\FIREFOX.EXE\ 
+3
source

All Articles