InstallShield如何检查SQL Server 2005(3.1)Compact Edition(CE)是否已安装 [英] How can InstallShield check if SQL Server 2005 (3.1) Compact Edition (CE) is installed

查看:86
本文介绍了InstallShield如何检查SQL Server 2005(3.1)Compact Edition(CE)是否已安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Windows桌面应用程序,该应用程序需要 SQL Server 2005 Compact Edition (

I am developing a Windows desktop application which requires the SQL Server 2005 Compact Edition (SQLServerCE31-EN.msi) to be installed. I am using InstallShield 2011 to install this as a pre-requisite during the installation process.

为了提出先决条件定义,我使用了 Process Monitor ,以查看

In order to come up with the pre-requisite definition I used Process Monitor to see that these registry locations are checked when SQLServerCE31-EN.msi is run manually (not via the installer):

32位:HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server Compact Edition\v3.1

64位:HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Microsoft SQL Server Compact Edition\v3.1

在大多数情况下,此检查似乎有效,如果InstallShield已被检测为已安装,则会跳过先决条件.但是,一台机器(已安装 SQL Server Compact Edition 3.5 Windows 7 Ultimate 64位)即使该键是 Microsoft SQL Server 2005,也不存在该密钥. Compact Edition [ENU] 列在程序和功能下.

Most of the time, this check seems to work and InstallShield skips the pre-requisite if it's already detected as installed. However one some machines (Windows 7 Ultimate 64-bit with SQL Server Compact Edition 3.5 already installed) the key doesn't exist, even though Microsoft SQL Server 2005 Compact Edition [ENU] is listed under Programs and Features.

在以下两个位置(在64位计算机上)都有一个注册表项,可用于检查是否安装了 SQL Server Compact Edition 3.5 ,但是如果3.1是已安装.

There's a registry key at both of the following locations (on a 64-bit machine) which could be used to check that SQL Server Compact Edition 3.5 is installed, but nothing to show if 3.1 is installed.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.5
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server Compact Edition\v3.5

我相当确定可以同时安装两个版本,并且不是3.5升级3.1,即使它显然是较新的版本.

I am fairly certain that it is possible to have both versions installed and it's not that 3.5 upgrades 3.1, even though it is obviously a newer version.

如何检查是否已安装SQL Server 2005 Compact Edition?

对于在那里的InstallShield用户,这是我们当前正在使用的.prq文件:

For the InstallShield users out there, this is the .prq file we are currently using:

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
 <conditions>
  <condition Type="1" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v3.1" FileName="" ReturnValue="" Bits="2"></condition>
 </conditions>
 <files>
  <file LocalFile="&lt;ISProjectFolder&gt;\..\InstallShieldPreRequisites\Microsoft SQL Server 2005 Compact Edition\SQLServerCE31-EN.msi" URL="http://download.microsoft.com/download/f/5/4/f54529c6-e316-4637-a211-95818fcd4451/SQLServerCE31-EN.msi" CheckSum="54854BAC91E616BF8F71184C05AD0355" FileSize="0,1819136"></file>
 </files>
 <execute file="SQLServerCE31-EN.msi" cmdline="/passive /norestart" cmdlinesilent="/passive /norestart" requiresmsiengine="1"></execute>
 <properties Id="{51BB3FEE-3851-4ECC-909A-C9D8EAF83254}" Description="This prerequisite installs Microsoft SQL Server 2005 Compact Edition"></properties>
</SetupPrereq>

上面的必备文件是否可以改进?

Can the prerequisite file above be improved?

推荐答案

答案的简短版本:

感谢Microsoft的Robbie Meng的帮助,我们发现检查此注册表项是检查前提条件是否已安装的可靠方法:

Thanks to help from Robbie Meng at Microsoft, we have found that checking for this registry key is a reliable way of checking if the prerequisite is already installed:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\1D034B0FAA6BD374B960AAD30DF10D8B

这篇关于InstallShield如何检查SQL Server 2005(3.1)Compact Edition(CE)是否已安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆