For x64 system with SQL Compact, it is required that both the x86 and x64 runtimes are installed, see this KB for more info.
So how can your installer detect if any of these versions are installed: by looking in the registry.
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"
and
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU]
"DesktopRuntimeVersion"="3.5.8080.0"
"DesktopRuntimeServicePackLevel"="2"
x64 system with only x64 runtime installed:
This is not possible with SQL Compact 3.5 SP2, attempting this will result in the following blocking error:
Detection
So depending on the target platform (“x86”, “x64” or “AnyCPU”) of your installer, you can detect as follows:
- x86 based installer:
Both these keys must be present and have proper values in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU
(x86 platform reads the Wow6432Node as if it was the “normal” HKLM\Software node).
"DesktopRuntimeVersion"="3.5.8080.0" (x86 runtime installed)
"DesktopRuntimeVersion_x64"="3.5.8080.0" (x64 runtime installed)
- x64 and AnyCPU based installer:
If the key below is present and have proper values, all is well:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU]
"DesktopRuntimeVersion"="3.5.8080.0" (x64 and x86 runtimes installed)
If not, you must check the key below in HKEY_LOCAL_MACHINE\Wow6432Node\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5\ENU
(to avoid reinstalling the x86 runtime);
"DesktopRuntimeVersion"="3.5.8080.0" (x86 runtime installed)
0 comments:
Post a Comment