Red Gate forums :: View topic - Creating a database through Windows Installer (WIX)
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Packager 6
SQL Packager 6 forum

Creating a database through Windows Installer (WIX)

Search in SQL Packager 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6668

PostPosted: Wed Nov 12, 2008 2:26 pm    Post subject: Creating a database through Windows Installer (WIX) Reply with quote

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!
Back to top
View user's profile Send private message
cfieldhouse



Joined: 12 Jun 2009
Posts: 2
Location: Portsmouth UK

PostPosted: Fri Jun 12, 2009 5:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6668

PostPosted: Mon Jun 15, 2009 11:26 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
cfieldhouse



Joined: 12 Jun 2009
Posts: 2
Location: Portsmouth UK

PostPosted: Mon Jun 15, 2009 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6668

PostPosted: Mon Jun 15, 2009 2:31 pm    Post subject: Reply with quote

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>   
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group