[英]How do I programmatically determine if and where Mono 64 bit is installed in Windows?
I found these registry settings 我发现了这些注册表设置
Assuming the user installed the Mono 64 bit MSI, can I in C# code read the registry and rely on 假设用户安装了Mono 64位MSI,我可以用C#代码读取注册表并依靠
mono-2.0-sgen.dll
is located. mono-2.0-sgen.dll
所在的位置。 I am asking because 我问是因为
(I assume that anything under Computer\\HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node would be 32 bit and would not indicate 64bit mono.) (我假设Computer \\ HKEY_LOCAL_MACHINE \\ SOFTWARE \\ WOW6432Node下的任何内容都是32位,并且不会表示64位单声道。)
Update I've asked on Mono-Github and here's their answer: https://github.com/mono/mono/issues/10535 更新我在Mono-Github上问过了,这是他们的答案: https : //github.com/mono/mono/issues/10535
.NET provides a series of classes for reading registry entry Here is an example of how to do that. .NET提供了一系列用于读取注册表项的类, 这是如何执行此操作的示例。 Another example is here
另一个例子在这里
In your case, the key location is number 1 from picture posted, the key is "Architecture" and it's "x64" and so on 在您的情况下,关键位置是发布的图片中的数字1,关键是“体系结构”和“ x64”,依此类推
Try that code from the above link and see if works. 从上面的链接尝试该代码,看看是否可行。 Some adaptation needs to be done.
需要进行一些调整。
If you get an error regarding administrative rights try to run Visual Studio as administrator. 如果遇到有关管理权限的错误,请尝试以管理员身份运行Visual Studio。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.