Detecting if SQL Server Compact Edition 3.5 SP2 x64 is installed?

与世无争的帅哥 提交于 2019-12-21 04:58:10

问题


I am building an installer and I want to bootstrap SQL Server Compact Edition 3.5 SP2. The problem is that I am looking for the registry key HKLM\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU\DesktopRuntimeVersion. The reason that is a problem is that for 64-bit machines SQL CE requires that both the 32-bit and 64-bit installers are run. You can't install the 64-bit version until the 32-bit version is installed.

As soon as the 32-bit version is installed the registry key is populated and my bootstrapper, dotNetInstaller detects that the registry key is there and the x64 version is never installed.

Any ideas on how to tell if the x64 version is installed even if the x32 is installed?


回答1:


x64 system with only x86 runtime installed:

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

x64 system with both x86 and x64 installed:

[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"



回答2:


Some code test whether SQL CE 3.5 SP2 is installed using MSBuild:

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

I'm not sure how many of the registry values need to be checked. For example should the Wow6432Node DesktopRuntimeServicePackLevel value be checked in addition to the above?



来源:https://stackoverflow.com/questions/2923218/detecting-if-sql-server-compact-edition-3-5-sp2-x64-is-installed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!