SQL CE 4.0 as a InstallShield Prerequisite
Asked Answered
A

2

8

I'm making my own prq file to perform the SQL CE 4.0 installation with my WPF application installation. The installer keeps failing, and I'm not sure why. It looks like it attempts to run the CE exe, but then a Windows Installer help window comes up with all of these command line help options. I click OK, and then it says the installation of CE has failed. I don't how to determine what is going wrong.

Here's my prq file contents:

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
<conditions>
    <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v4.0\ENU" FileName="DesktopRuntimeVersion" ReturnValue="4.0.8482.1"></condition>
</conditions>
<files>
    <file LocalFile="&lt;ISProductFolder&gt;\SetupPrerequisites\SSCERuntime_x86-ENU.exe" URL="http://www.microsoft.com/download/en/details.aspx?id=17876" FileSize="0,0"></file>
</files>
<execute file="SSCERuntime_x86-ENU.exe" cmdline="/passive /norestart" cmdlinesilent="/passive /norestart"></execute>
<properties Id="{F7BF54C1-CA2C-4410-98DB-480769CE6547}" Description="This prerequisite installs the Microsoft SQL Server Compact 4.0."></properties>
</SetupPrereq>

Any help would be much appreciated.

Atheroma answered 7/2, 2012 at 17:47 Comment(3)
You might also want to consider the private deployment options that SQL CE provides. As I recall ( documented in an answer by me somewhere around here on SO ) it's a handful of DLL's and some settings in your App.Config. This allows you to do everything in a single MSI without needing to chain other MSI's.Rapping
I looked at the private deployment and it seemed too hairy. Lots of potential for doing something wrong. I ended up removing the cmdline options and the installer just fires up the CE installation prompt, so it's working fine that way.Atheroma
It actually works really well. In fact in the last couple of days I saw a new Question/Answer on here where the person said they did the private deployment and it was really simple and worked great. Either way, the choice is yours.Rapping
J
6

I was able to get it to work from what it seems like so

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
<conditions>
    <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v4.0\ENU" FileName="DesktopRuntimeVersion" ReturnValue="4.0.8482.1"></condition>
</conditions>
<files>
    <file LocalFile=".\SSCERuntime_x86-ENU.exe" URL="http://download.microsoft.com/download/0/5/D/05DCCDB5-57E0-4314-A016-874F228A8FAD/SSCERuntime_x86-ENU.exe" FileSize="0,0"></file>
</files>
<execute file="SSCERuntime_x86-ENU.exe" cmdline="/i /passive" cmdlinesilent="/i /passive"></execute>
<properties Id="{05DCCDB5-57E0-4314-A016-874F228A8FAD}" Description="This prerequisite installs the Microsoft SQL Server Compact 4.0 x86."></properties>
</SetupPrereq>

The x64 script

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
<conditions>
    <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v4.0\ENU" FileName="DesktopRuntimeVersion" ReturnValue="4.0.8482.1"></condition>
</conditions>
<files>
    <file LocalFile=".\SSCERuntime_x64-ENU.exe" URL="http://download.microsoft.com/download/0/5/D/05DCCDB5-57E0-4314-A016-874F228A8FAD/SSCERuntime_x64-ENU.exe" FileSize="0,0"></file>
</files>
<execute file="SSCERuntime_x64-ENU.exe" cmdline="/i /passive" cmdlinesilent="/i /passive"></execute>
<properties Id="{05DCCDB5-57E0-4314-A016-874F228A8FAD}" Description="This prerequisite installs the Microsoft SQL Server Compact 4.0 x64."></properties>
</SetupPrereq>
Janitajanith answered 19/4, 2012 at 9:12 Comment(1)
@Enzero: I have made 2 different PRQ files for x86 and x64. But while installation, it shows both files as required. How can I skip x86 file installation for a x64 terminal?Community
P
2

In response to the rishiJasapara's comment, I made scripts based on previous answer.

The idea is the same, to create two scripts, one for x86 and another for x64 platform. You have to select both prerequisities in your InstallShield project, but with scripts listed below in installation page on the target machine you'll see the only one that is corresponding to the machine's processor architecture.

Microsoft SQL CE 4.0 x86.prq:

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
    <conditions>
        <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v4.0\ENU" FileName="DesktopRuntimeVersion" ReturnValue="4.0.8482.1"></condition>
    </conditions>
    <operatingsystemconditions>
        <operatingsystemcondition CSDVersion="" Bits="1"></operatingsystemcondition>
    </operatingsystemconditions>
    <files>
        <file LocalFile=".\SSCERuntime_x86-ENU.exe" URL="http://download.microsoft.com/download/0/5/D/05DCCDB5-57E0-4314-A016-874F228A8FAD/SSCERuntime_x86-ENU.exe" CheckSum="0A55733CF406FBD05DFCFF5A27A0B4F7" FileSize="0,2379544"></file>
    </files>
    <execute file="SSCERuntime_x86-ENU.exe"></execute>
    <properties Id="{2754916B-119B-4428-9F94-DC9E45072CCC}"></properties>
    <behavior Failure="4" Reboot="2"></behavior>
</SetupPrereq>

Microsoft SQL CE 4.0 x64.prq:

<?xml version="1.0" encoding="UTF-8"?>
<SetupPrereq>
    <conditions>
        <condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v4.0\ENU" FileName="DesktopRuntimeVersion" ReturnValue="4.0.8482.1"></condition>
    </conditions>
    <operatingsystemconditions>
        <operatingsystemcondition CSDVersion="" Bits="2"></operatingsystemcondition>
    </operatingsystemconditions>
    <files>
        <file LocalFile=".\SSCERuntime_x64-ENU.exe" URL="http://download.microsoft.com/download/0/5/D/05DCCDB5-57E0-4314-A016-874F228A8FAD/SSCERuntime_x64-ENU.exe" CheckSum="A417082ECAEDD95AFB41F73DC140C350" FileSize="0,2621240"></file>
    </files>
    <execute file="SSCERuntime_x64-ENU.exe"></execute>
    <properties Id="{7CB7BE3C-614A-403F-94D9-5652285A3EDF}"></properties>
    <behavior Failure="4" Reboot="2"></behavior>
</SetupPrereq>

As you can see, the major difference is additional "operatingsystemconditions" on wich correct SQL CE installation package is determined.

I tested it on Windows 7 32- and 64- bit systems and it actually works fine.

Protagonist answered 3/12, 2013 at 13:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.