Bob Arnson wrote:
> W. Craig Trader wrote:
>> I have a legacy .Net 2.0 application (C# plus some C++ COM controls) 
>> that is currently deployed using a Visual Studio 2005 Setup project.  
>> The Setup project uses a Custom Action written in C# (a subclass of 
>> System.Configuration.Install.Installer) to install or upgrade a SQL 
>> Server MSDE database (with backup and rollbacks) depending upon 
>> version information in a table in the database. 
>
> Can you use the WiX SQL custom actions?
Bob, thanks for the interest.

In short: 

Not without modifying a LOT of SQL script, and even then it may not work.

In long: 

I have a set of scripts that get modified and added to over time.  One 
script (generated) will create a new database and populate it from 
scratch.  The other scripts have version and sequence numbers, and are 
used to upgrade any given database schema and data to the current 
schema.  Currently my C# custom action class checks to see if the 
database exists:  if not, it runs the create-populate script, otherwise 
it (1) backs up the database, (2) checks the database schema version, 
and (3) runs all of the scripts that are more recent than the database 
schema version.  If there are any problems, it fails the installation 
and rolls back.  During the rollback it will restore the database from 
the backup.  This will leave the database and application in a 
known-good state.

In looking over the WiX SqlExtension, it appears that I'd have to turn 
all of those scripts into one large script with a bunch of logic added.  
This is complicated by the fact that the bulk of the SQL scripts are 
machine generated (from multiple sources), with lots of short 
transactions.  Trying to pack all of that into a single 25,000 line 
script would be ... interesting.  To make matters worse, it appears 
(from the WiX Wiki) that the SqlExtension is broken for creating 
databases (http://www.wixwiki.com/index.php?title=SqlExtension), 
something that I need.


At this point it looks like the best thing to do will be to keep my 
existing custom action, and execute the InstallUtil.exe program for 
installs, upgrades, and rollbacks, so I'm looking for examples that do 
that.  Any pointers?

- Craig -

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to