确定是否安装了 Google 地球(在 Windows 上)
我有一个 VB.NET 应用程序,可以生成 KML 以在 Google 地球中显示。我只是对创建的 .KML 文件执行 Process.Start 。问题显然是“如果没有安装谷歌地球怎么办”,这就是我想避免的。
在 Windows 中(不是网络)有没有办法确定是否安装了 Google 地球?如果没有,我会提示他们这是必需的,如果是的话,我将继续该过程。
谢谢。
I have a VB.NET app that generates KML to show within Google Earth. I simply do a Process.Start on the .KML file created. The problem is obviously "what if Google Earth isn't installed" and that's what I want to avoid.
Is there a way, in Windows, (not web) to determine if Google Earth is installed? If not, I'll prompt them that it's required, if so, I'll proceed with the process.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
检查注册表中的 HKEY_CURRENT_USER\Software\Google\Google Earth Plus\
...我自己从未这样做过,但这似乎合乎逻辑。
Check the registry for HKEY_CURRENT_USER\Software\Google\Google Earth Plus\
...never done this myself but it seems logical.
查看 Google 地球是否是 .kml 文件的处理程序:
C#
See if Google Earth is the handler for .kml files:
C#
检查 %program files%/Google Earth 文件夹是否存在。
Check if %program files%/Google Earth folder exists.
查看是否可以找到 Google 地球在安装时创建的一些注册表项(并在卸载时删除)。如果它们存在,该程序很可能也存在。与文件或文件夹相比,用户篡改注册表的可能性要小得多......
See if you can find some registry entries that Google Earth creates upon installation (and removes when un-installed). If they exist, the program most likely does too. And the users are much less likely to tamper with the registry than with files or folders...
安装程序时,要求用户导航到 Google Earth .exe 所在的文件夹。
如果他们在您的应用程序之后安装 Google 地球并尝试启动 KML 文件,则在您启动 KML 之前提示用户导航到其 Google 地球文件夹。不过,不要要求他们安装 Google 地球,因为他们可能有另一个与他们想要使用的 KML 关联的应用程序。
On install of your program, ask the user to navigate to the folder where the Google Earth .exe is located.
If they install Google Earth after your app and try to launch a KML file, then prompt the user to navigate to their Google Earth folder before you launch the KML. Don't require them to have Google Earth installed, though, as they may have another app associated with KMLs that they want to use.