简体   繁体   English

如何在Windows上的C ++中获取firefox及其变体版本?

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

Firefox has a lot of variants, like Waterfox, Palemoon, etc. Firefox有很多变体,例如Waterfox,Palemoon等。

How can I get the version number of all Firefox and it's variant browsers present on a system? 如何获得系统中存在的所有Firefox及其变体浏览器的版本号?

Using C++ and Win32 SDK. 使用C ++和Win32 SDK。

Another related question, how do I know if a browser is derived off Firefox or Chrome (like Comodo)? 另一个相关的问题,我如何知道浏览器是从Firefox还是Chrome衍生而来(例如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 ). 所有浏览器(甚至是便携式浏览器)都应该在其中注册自己( source )。 Then you lookup command subkey for the browser's main executable path. 然后,您查找浏览器的主要可执行路径的command子项。 For example, my portable Chromium is found here: 例如,可以在以下位置找到我的便携式Chromium:

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? 之后,您可以直接从.exe中提取浏览器版本- 如何以编程方式获取DLL或EXE文件的版本? . You can check this version information in GUI as well - go to file Properties (via right-click Context Menu), then Details tab. 您也可以在GUI中检查此版本信息-转到文件属性(通过右键单击上下文菜单),然后转到详细信息选项卡。

It worked for me for portable Chromium, but didn't try it on other non-standard browsers. 它对我来说适用于便携式Chromium,但没有在其他非标准浏览器上尝试过。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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