How InstallShield can verify if SQL Server 2005 (3.1) Compact Edition (CE) is installed

I am developing a Windows desktop application that requires the installation of SQL Server 2005 Compact Edition ( SQLServerCE31-EN.msi ). I use InstallShield 2011 to install this as a preview during the installation process.

To come up with a preliminary definition, I used Process Monitor to make sure that these registry locations are marked when SQLServerCE31-EN.msi is started manually (not through the installer):

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

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

In most cases, this check works, and InstallShield skips the preliminary request if it is already detected as installed. However, some of the machines (Windows 7 Ultimate 64-bit with SQL Server Compact Edition 3.5 are already installed) do not exist, although the Microsoft SQL Server 2005 Compact Edition [ENU] is listed in the "Programs and Features" section.

There is a registry key in both of the following places (on a 64-bit machine) that can be used to verify the installation of SQL Server Compact Edition 3.5, but does not 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 

I am pretty sure that it is possible to install both versions, and not 3.5 versions 3.1, although this is obviously a newer version.

How to check if SQL Server 2005 Compact Edition is installed?

For InstallShield users, 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> 

Is it possible to improve the preliminary file higher?

+2
source share
2 answers

Short answer:

Thanks to the help of Robbie Man at Microsoft, we found that checking this registry key is a reliable way to verify that a prerequisite is set:

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

You can use the product code in the HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Installer \ Products directory to verify that SQL Server CE 3.1 is installed.

For example, SQL CE 3.5 product code is {F0B430D1-B6AA-473D-9B06-AA3DD01FD0B8}

We will find below in the registry: (note that the code does some transfer) HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Installer \ Products \ 1D034B0FAA6BD374B960AAD30DF10D8B

SQL CE 3.1 product code can be found using the ORCA tool. Here are the detailed steps:

Launch ORCA software Open the SQL CE 3.1 msi file using ORCA. Click "Properties" and check the product code in the right pane.

Download: ORCA MSI Editor http://www.technipages.com/download-orca-msi-editor.html

Hope this helps ...

+2
source

Source: https://habr.com/ru/post/1411772/


All Articles