views:

165

answers:

1

I'm using some custom actions to install plugins into Firefox in an Installer project.

Quickest path to ground thus far has been to use VBScript.

Currently, I've been assuming the FireFox installation directory is "%PROGRAMFILES%/Mozilla Firefox". Obviously, this needs to change to cope with people doing non-standard installs.

So, the question is, how can I get an installation path of an application (known by name, GUID, whatever) using VBScript*?

*If its downright impossible, using C# is also acceptable (and seems to be answered in a few places) but that will require I redo some of the installation process currently implemented in VBScript; so its less desirable

+1  A: 

There is an Install Directory string in the registry that will tell you where it's installed, however it's located in different places depending upon the version of Firefox is installed and the OS upon which it is installed. It will be in a key that looks like one of these:

Windows XP

HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.5.3 (en-US)\Main
HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.0.11 (en-US)\Main
HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.0.5 (en-US)\Main
...

Windows 7 x64

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\3.5.3 (en-US)\Main
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\3.0.11 (en-US)\Main
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\3.0.5 (en-US)\Main
...
raven
These keys don't exist for my FireFox installation (3.5.3) on Win7.
Kevin Montrose
On 64-bit Windows, the key is under Wow6432Node, e.g.: `HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\3.5.3 (en-GB)\Main`. So, on 64-bit OS the key path depends on whether your script is running under 32-bit or 64-bit version of Windows Script Host.
Helen