How To Determine Silverlight version on x64 machin

2019-08-26 17:18发布

According to the latest silverlight deployment guide, I can determine what version of silverlight is installed by

-Querying the: “HKLM\Software\Microsoft\Silverlight\Version” registry key

This works great on my 32 bit dev machine. But on a couple of 64 bit machines, HKLM\Software\Microsoft\Silverlight doesn't exist.

Where is it on x64 machines?

3条回答
Anthone
2楼-- · 2019-08-26 17:30

I know this has been answered but you can use 'RegistryKey' with .Net 4. This allow's your 32 bit program to access the 64 bit registry as it would be normally viewed on your 64 bit machine. The code:

using Microsoft.Win32;

RegistryKey registryBase = Registry.LocalMachine; // This would give you the standard Registry if you were using your own machine. Not needed for this example.

registryBase = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); // This will allow your 32 bit program to view the 64 bit registry.

RegistryKey getKey = registryBase.OpenSubKey("HKLM\Software\Microsoft\Silverlight\Version", true); // Set to true or false to allow write permissions.

getKey.SetValue("VersionKey", "0", RegistryValueKind.DWord); //Allow's you to edit the exact key type. Just change DWord etc...

Hope this is useful. I use this as sometimes you cannot view all keys required in 'Wow6432Node'.

查看更多
劳资没心,怎么记你
3楼-- · 2019-08-26 17:32

Look in HKLM\Software\Wow6432Node, the home for registry keys that 32-bit programs can see.

查看更多
放我归山
4楼-- · 2019-08-26 17:51

Searching through my registry, I found this:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Silverlight

Can anyone confirm that this is a safe place to look?

查看更多
登录 后发表回答