简体   繁体   中英

How to get the firefox and it's variants version in C++ on Windows?

Firefox has a lot of variants, like Waterfox, Palemoon, etc.

How can I get the version number of all Firefox and it's variant browsers present on a system?

Using C++ and Win32 SDK.

Another related question, how do I know if a browser is derived off Firefox or Chrome (like Comodo)?

You could try this registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Clients\StartMenuInternet   // <-- x64 only

where all the browsers (even portable ones) should registers themselves ( source ). Then you lookup command subkey for the browser's main executable path. For example, my portable Chromium is found here:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Clients\StartMenuInternet\Chromium.Y75GGO62VNIN4R2QLYJDH66X4I\shell\open\command

After that you can pull browser version from .exe directly - How do I programatically get the version of a DLL or EXE file? . You can check this version information in GUI as well - go to file Properties (via right-click Context Menu), then Details tab.

It worked for me for portable Chromium, but didn't try it on other non-standard browsers.

您可以尝试使用以下注册表项:HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Mozilla \\ Mozilla Firefox \\ CurrentVersion

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM