开发者

Get Application Installation Directory

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 i开发者_如何转开发ts 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


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
...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜