Creating a database through Windows Installer (WIX)

Packages and compresses schema and contents of SQL Server databases

Moderators: JonathanWatts, Chris Auckland, David Atkinson, david connell, Anu Deshpande, Michelle Taylor, james.billings, Marianne

Creating a database through Windows Installer (WIX)

Postby Brian Donahue » Wed Nov 12, 2008 2:26 pm

Hi all,

Since SQL Packager is meant to ease the process of creating a database by creating a copy on different servers, it makes sense to want to embed a SQL Packager "package" as part of a Windows Installer (MSI) file. Unfortunately, we have not been so enthusiastic about creating examples demonstrating how you could do this, so I have created a WiX-based installer that will install a database created using SQL Packager.

The example WiX project contains all of the WiX XML files and a sample database. A customized user interface is demonstrated, showing a form where the installer can collect information about the destination server and database name, and ultimately save these values to the registry so they can be re-used at uninstall (or upgrade) time.

Please feel free to have a look at my blog, and post any comments to this forum.

I hope that you all get some useful information from this!
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby cfieldhouse » Fri Jun 12, 2009 5:03 pm

Hi,

I'm my companies installer guy. I'm trying to run a package made with redgate packager 5 as part of an installation using an msi made from WiX. I've tried a few ways of invoking the .msi including the one you posted on your blog, but whenever I run the package I get the following error:

CAQuietExec: File or assembly name redgatepackage.exe, or one of its dependencies, was not found.

The package works fine if I run it from command line or just double click it in windows.

This error does not occur if I exchange the redgatepackage.exe with another .net .exe keeping everything else the same so I'm fairly sure the .exe is being invoked correctly, but for some reason the redgate package doesn't like being invoked indirectly like this.

Any ideas?

Chris.
cfieldhouse
 
Posts: 2
Joined: Fri Jun 12, 2009 4:46 pm
Location: Portsmouth UK

Postby Brian Donahue » Mon Jun 15, 2009 11:26 am

Hi,

I'm sure that this is a WIX issue. I think that, if you want to use CAQuietExec in this way, that you need to ensure that you use Execute="deferred" and Return="check". You may want to use filemon or process explorer to make sure that your package file is extracted before the custom action runs.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby cfieldhouse » Mon Jun 15, 2009 11:54 am

Yes it was a wix issue to do with the command line used to run redgatepackage.exe.

It seems to be a working directory issue.

Value=""[SQLPACKAGEFOLDER]SQLPackagerBaseline.exe" /server:[SERVERNAME] /database:[DATABASENAME] /quiet /makedatabase"

did not work for me as the working directory was the defualt C:\\WINNT\\System32. I've come up with a way to change this and redgatepackage.exe runs fine.

Thanks.
cfieldhouse
 
Posts: 2
Joined: Fri Jun 12, 2009 4:46 pm
Location: Portsmouth UK

Postby Brian Donahue » Mon Jun 15, 2009 2:31 pm

I see, you need to specify the installation directory. In the example, I put it inside "Program Files" like this:
Code: Select all
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="SQLPACKAGEFOLDER" Name="SQLPACK" LongName="SQL Packager Example">
...
</Directory>
</Directory>
</Directory>   
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Packager 6

Who is online

Users browsing this forum: No registered users and 1 guest