No unfortunately the cancel is for the whole installer.

Just re-read the original message, and I think you can make your scenario work.

Have two components and a non component SqlDatabase locator:
- the first component has the SqlDatabase element and SqlString elements for 
the MSI to create the database.  Only put the things in here that matter when 
the database is created.
- the second component has the SqlString elements to be run when there is a 
pre-existing database or when the MSI creates the database - so anything that 
is common to both scenarios.   Link each of the SqlString elements here to the 
non component SqlDatabase locator.    You can put a condition on this component 
so that if you are not creating the database at all the component is not 
installed.

Use the sequence number to ensure the order of the scripts is correct - the 
sequence number is universal so seq=1 in Component B runs before seq=2 in 
Component A.   

The MSI will do the database creation step first before any SqlString elements 
are run - it is that smart.

This assumes that both SqlDatabase elements resolve to the same database.

Hope this helps 

Michael


-----Original Message-----
From: Mike Menaker [mailto:mi...@voicebox.com] 
Sent: Tuesday, 12 April 2011 9:47 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] SqlDatabase install optional and SqlString execute

The cancel will apply to only the DB creation, not to the whole
installer, right?

-----Original Message-----
From: Michael Osmond [mailto:mosm...@baytech.com.au] 
Sent: Monday, April 11, 2011 3:46 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] SqlDatabase install optional and SqlString
execute

Mike,

 SqlDatabase has an option ConfirmOverwrite, if set to yes the installer
will prompt if it finds a database already created, and allows you to
cancel or continue.   Using this option the installer only needs to deal
with option 1 and you get 2 for free.

If you want to be defensive against the pre-existing database actually
having objects in it, then in one of your SqlStrings check for a
table(s) existing and then use RAISERROR to cause the installer to fail
and complain that the pre-existing database is populated already.  This
can be important in restore scenarios.

Michael

-----Original Message-----
From: Mike Menaker [mailto:mi...@voicebox.com] 
Sent: Tuesday, 12 April 2011 3:24 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] SqlDatabase install optional and SqlString execute

Hi,

 

I want to adjust my installer to have 2 different modes:

 

1.       User wants to create database and then I run a set of SqlString

2.       User uses preexisting database and then I run the same set of
SqlString

 

Right now I have a SqlDatabase element in a component that creates the
db (only when a certain feature is selected).

 

And I have a SqlDatabase element in a feature that is just a locator
(that will be evaluated always).

 

However I'm not sure how to make the non component SqlDatabase locator
not error when the msi is run if we are in db creation mode. Or would it
be execute after the SqlDatabase is created?

 

Also is wix smart enough to only run SqlString elements after a
SqlDatabase is created?

 

Thanks,

Mike

------------------------------------------------------------------------
------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------
------
Forrester Wave Report - Recovery time is now measured in hours and
minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report
as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and
vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to