I can use the registry to detect the instance just fine.  Unfortunately,
that doesn't handle all the situations.

Sometimes the user has uninstalled the software, and SQL doesn't always
clean the registry up completely, so the instance still appears to be there
when it isn't.  Sometimes, the user has ran the desktop cleanup wizard and
the default options in that compress files that haven't been accessed
recently.  Our software is used about once a year by many of our customers,
so many times, that causes the sql data files to be compressed.  SQL then
will not start because the files are compressed but doesn't give any
relevant information.

What I want my custom code to do is to try and find the service, start it
and capture/analyze any errors to see if I can handle them.  If I can't,
then I want to set the variable that it's not there and run/rerun the
installation so it can install/repair itself.

I hope this clarifies what I'm trying to accomplish a little better.

Thanks so far!

Chad


Date: Wed, 14 Nov 2012 18:31:52 +0000
From: Steven Ogilvie <steven.ogil...@titus.com>
Subject: Re: [WiX-users] Help?
To: General discussion for Windows Installer XML toolset.
        <wix-users@lists.sourceforge.net>
Message-ID:
        <DC3C9A45880F4440BEE778A52B0C876FF7252E@E10MB3.tituscorp.local>
Content-Type: text/plain; charset="us-ascii"

I am using SQLExpress 2012 and this works for me - I have been using the
same logic for SQL2005 and 2008 so I am fairly sure it works.

Neil

-----Original Message-----
From: Steven Ogilvie [mailto:Steven.Ogilvie@...] 
Sent: 14 November 2012 18:32
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Help?

I have SQL Express 2012 installed and there isn't a \InstanceNames\ in the
registry so that would fail for SQL EXPRESS

 -----Original Message-----
From: Neil Sleightholm [mailto:neil@...]
Sent: November-14-12 11:45 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Help?

Here is the code to detect whether your instance is installed:

    <?define InstanceName = "TEMP" ?>

    <!-- Read SQL Server keys to find current instance and version -->
    <util:RegistrySearch
      Id="SqlInstanceFound"
      Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance
Names\SQL" Value="$(var.InstanceName)"
      Result="exists" Variable="SqlInstanceFound" />

    <util:RegistrySearch
      Id="SqlInstanceKey"
      Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance
Names\SQL" Value="$(var.InstanceName)"
      Variable="SqlInstanceKey" After="SqlInstanceFound"
Condition="SqlInstanceFound" />
    <util:RegistrySearch
      Id="SqlVersion"
      Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL
Server\[SqlInstanceKey]\Setup" Value="Version"
      Variable="SqlVersion" After="SqlInstanceKey"
Condition="SqlInstanceFound" />

This will set two variables SqlInstanceFound if the instance is present and
SqlVersion is the SQL version of the instance (you might not need the second
one but it is useful if you want to upgrade existing instances. Note: this
detects the 32 but instances if you want 64 bit you would need to set the
Win64 attribute.

To install SQL can use if the SqlInstanceFound variable in your ExePackage
element e.g. ExePackage/@DetectCondition="SqlInstanceFound" 

Neil

-----Original Message-----
From: Hoover, Jacob [mailto:Jacob.Hoover@...]
Sent: 14 November 2012 16:17
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Help?

I would suggest starting with WixStdBA. You should be able to configure the
bundle with a few DirectorySearch/FileSearch/RegistrySearch/ProductSearch
elements and then use the InstallCondition to tell the Exe/Msi package to
install and mark it as Permanent so that uninstalling doesn't remove it.



-----Original Message-----
From: Chad McCune [mailto:chad@...]
Sent: Wednesday, November 14, 2012 9:59 AM
To: wix-users@...
Subject: [WiX-users] Help?

I'm new to WiX, started playing with it last week.  

 

Our current software installer works, but has issues.  We are going to be
moving to VS2012 soon, and the MS Setup Project is no longer available, so I
was going to take this opportunity to update and improve it.

 

Scenario: Like most software, we have pre-requisites.  We require .NET
Framework for one.  We currently also depend on a SQL Server Express
instance to be installed and configured. We're also investingating using the
new SqlLocalDB option from 2012 for users using a supported OS.

 

I've got my basic installer created (product.wxs) and it checks for the
prerequisite of .NET.  This basic MSI works fine.

 

I've got a basic Bootstrapper project setup that will install .NET and then
my MSI.  This basic bootsrapper works fine.

 

Where I've ran into a huge roadblock, is how to conditionally install SQL.  

 

I only want to install SQL if the instance is not already installed, or for
some reason, the service won't start (ie. the user ran the desktop cleanup
wizard that compressed their program files).  This is also where I'm trying
to decide between using SQL Express and SQLLocalDB.

 

To do this, do I have to create a custom BA?  Can I use a wix extension
instead?

 

I've tried both, but I think the extension was not the right way to go.
However, screwing around with the BA, I can get it to compile and my BA
starts, but it just seems to hang.   

 

 

       public class CustomBA : BootstrapperApplication

    {

              protected override void Run()

              {

                     this.Engine.Log( LogLevel.Verbose, "Running the
CustomBA." );

                     Threading.Dispatcher.Run();

 

                     MessageBox.Show( "Dispatcher Run has finished." );

                     

                     this.Engine.Quit( 0 );

              

              }

    }

 

I see the entry "Running the CustomBA" in my log file, but nothing else
after that.

 

What all do I have to do to create my own BA?  Do I have to completely
recreate the entire UI experience? 

 

Short version, I just want to create some custom conditionals that I can use
in my "DetectCondition" attribute, ie. <ExePackage blablabla
DetectCondition="IDONTHAVESQL" />.  What is the "best" way to accomplish
this.

 

Please Help!


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to