【发布时间】:2020-05-07 12:24:54
【问题描述】:
我使用这个方法:Check if application is installed in registry 查找“Sql Server 2019”。
问题是当我使用活动解决方案平台运行程序时:任何 CPU。
string registryKey64 = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
string registryKey32 = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall";
RegistryKey key64 = Registry.LocalMachine.OpenSubKey(registryKey64);
RegistryKey key32 = Registry.LocalMachine.OpenSubKey(registryKey32);
然后key64 == key32。这导致它找不到 64 位 sql server。问题不会发生在相反的方向。
我不想为 64 位平台运行程序。如何进入 64 位寄存器?
【问题讨论】: