简体   繁体   中英

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

  • 1 + 2 indicating that Mono 64 bit is installed
  • 3 where the Mono lib folder is
  • 4 where Mono config folder is and
  • 5 where the mono-2.0-sgen.dll is located.

I am asking because

  1. I did not find this documented on the Mono website (eg Mono FAQ: Technical , Install Mono on Windows , Mono Runtime Documentation , Mono Runtime Documentation )
  2. Perhaps there is a better / alternative approach. (eg the GAC ... I'm not keen on the GAC but perhaps ...)

(I assume that anything under Computer\\HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node would be 32 bit and would not indicate 64bit mono.)


Update I've asked on Mono-Github and here's their answer: 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. 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

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.

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