views:

211

answers:

3

I need to create an install for my app that executes the following actions:

  1. Copies files
  2. Writes registry settings
  3. Registers a windows service
  4. Writes an XML app.config file (based on user supplied info during install--a connection string)
  5. Executes SQL scripts against a remote database (connection info obtained in #4)
  6. Installs and registers a COM dll
  7. Adds entry to Control Panel>Add/Remove programs for uninstall

I don't need any fancy logic to allow the user to customize these steps--I can hard-code them with user-supplied info injected where appropriate.

I looked at Wix but found the documentation and examples don't line up well with recent releases.

I also looked at NSIS but found support for writing XML to be too limited (the plugin for this can only handle strings up to 64 bytes).

I initially brushed off the VS2005 built in Setup project as incapable of handling these tasks but I'm ready to reconsider after stumbling with what I thought were better options.

Any suggestions?

+1  A: 

A Visual Studio Installer project can do whatever custom code you want; wouldn't see why any of your requirements would be a problem.

routeNpingme
It looks like this is what I'll have to do. Thanks for the nudge.
Michael Haren
A: 

I have used Visual Studio (2005) and Wise and can recommend both. You didn't mention if the tool had to be free, and if so that rules out Wise. Nevertheless Wise has a dead easy learning curve and is very powerful and well documented. I have had a few weird things happen to me with Visual Studio. One time I had to delete my project and start over (possibly due to stupidity on my part - never figured it out), but overall I have been using it for a couple years at my current job and it works for me.

Andrew Cowenhoven
+2  A: 

I would still recommend looking into WiX a bit more. We use it to do everything but #6 on that list and while there is a small learning curve. We've been using WiX v3 for almost 3 years, and I haven't found too many places where the docs/tutorial is that far out of place. And usually where it is its because they cleaned up the syntax and made it better.

Also, as of the next release of Visual Studio (2010/Rosario) WiX is being build directly into Visual Studio, I'm not sure if in parallel with the current Setup Projects or replacing them completely.

Rob McCready
How do you write XML files with WIX? Is there a way to do this that isn't a hack?
Michael Haren
Use the WixUtilities namespace to update the value in say your web.config file<util:XmlFile Action="setValue" File="web.config" ElementPath="//configuration/connectionStrings/add[\[]@name='OurConfigString'[\]]" Name="connectionString" Value="[SQL_CONNECTION]" Permanent="yes" />
Rob McCready
Also since writing custom code was mentioned in the other answer. WiX now has a project called the Deployment Tools Foundation (DTF) which makes writing MSI custom actions in C# easy.
Rob McCready