检测是否安装了SQL Server Compact Edition 3.5 SP2 x64?

时间:2010-05-27 17:06:32

标签: sql-server-2005 installer windows-installer

我正在构建安装程序,我想引导SQL Server Compact Edition 3.5 SP2。问题是我正在寻找注册表项HKLM\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU\DesktopRuntimeVersion。问题的原因是对于64位计算机,SQL CE要求运行32位和64位安装程序。在安装32位版本之前,无法安装64位版本。

一旦安装了32位版本,就会填充注册表项,并且我的引导程序dotNetInstaller检测到注册表项存在,并且永远不会安装x64版本。

即使安装了x32,如何判断是否安装了x64版本的任何想法?

2 个答案:

答案 0 :(得分:8)

仅安装了x86运行时的x64系统:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU]
"DesktopRuntimeVersion"="3.5.8080.0"
"DesktopRuntimeServicePackLevel"="2"

安装了x86和x64的x64系统:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU]
"DesktopRuntimeVersion"="3.5.8080.0"
"DesktopRuntimeServicePackLevel"="2"
"DesktopRuntimeVersion_x64"="3.5.8080.0"

答案 1 :(得分:1)

某些代码测试是否使用MSBuild安装SQL CE 3.5 SP2:

<PropertyGroup>
    <SSCE35sp2Installed Condition="'$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU@DesktopRuntimeVersion)' == '3.5.8080.0' And '$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU@DesktopRuntimeServicePackLevel)' == '2'">true</SSCE35sp2Installed>
    <SSCE35sp264Installed Condition="'$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU@DesktopRuntimeVersion_x64)' == '3.5.8080.0'">true</SSCE35sp264Installed>
</PropertyGroup>

我不确定需要检查多少个注册表值。例如,除了上面的内容之外,还应该检查Wow6432Node DesktopRuntimeServicePackLevel值吗?