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

Reply via email to