| Author |
Message |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Wed Nov 12, 2008 2:26 pm Post subject: Creating a database through Windows Installer (WIX) |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
cfieldhouse
Joined: 12 Jun 2009 Posts: 2 Location: Portsmouth UK
|
Posted: Fri Jun 12, 2009 5:03 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Mon Jun 15, 2009 11:26 am Post subject: |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
cfieldhouse
Joined: 12 Jun 2009 Posts: 2 Location: Portsmouth UK
|
Posted: Mon Jun 15, 2009 11:54 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Mon Jun 15, 2009 2:31 pm Post subject: |
|
|
I see, you need to specify the installation directory. In the example, I put it inside "Program Files" like this:
| Code: |
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="SQLPACKAGEFOLDER" Name="SQLPACK" LongName="SQL Packager Example">
...
</Directory>
</Directory>
</Directory> |
_________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|