2011-03-15 16 views
0

根據最新的Silverlight部署指南,我能確定是由如何確定x64機器上的Silverlight版本?

安裝的是什麼版本的Silverlight -Querying的:「HKLM \ SOFTWARE \微軟\ Silverlight的\版本」註冊表項

這在我的32位開發機器上效果很好。但在幾臺64位機器上,HKLM \ Software \ Microsoft \ Silverlight不存在。

這是哪裏的x64機器上?

回答

1

查找在HKLM \ SOFTWARE \ Wow6432Node,家裏的註冊表項中的32位程序可以看到。

+0

我打你,但我還是給你的信用:) – 2011-03-15 20:34:05

+0

我懷疑這一點,我已經知道這井兩年多:) – 2011-03-15 20:36:11

+0

德勤............. – 2011-03-15 20:50:50

0

搜索通過我的註冊表,我發現這一點:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \微軟\的Silverlight

任何人都可以證實這是一個安全的地方看?

+1

Yupp。我能在那個地方找到它。 – 2011-03-15 20:33:35

0

我知道這已經回答了,但你可以使用「的RegistryKey」與.NET 4這使的你的32位程序來訪問64位註冊表,因爲它會在64位機器上正常觀看。代碼:

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... 

希望這是有用的。我使用這個,因爲有時你不能查看'Wow6432Node'中所需的所有密鑰。

相關問題