views:

183

answers:

2

Background:

I always try to ensure the following tenent in my projects:

After a fresh checkout a developer should be able to do all project related tasks with solely the contents of the combined folders.

Obviously, this isn't always possible (e.g. Visual Studio for Windows development). However, I really dislike having to install any third-party libraries or tools that are specific a project like log4net, NHibernate, NUnit, etc. There are number of reasons for this including:

  • For a given development machine, you may work on several different projects, all which leverage different versions of the same third-party library or tool.
  • Minimizing the environment setup requirements makes setting up new developers or machines much easier
  • Facilitates easier maintenance of automated builds

Assumptions/Contraints

  • I am currently using WiX 3 beta, but if there is way for either 2.0 or 3.0 please respond
  • I am using Visual Studio 2005
  • The IDE syntax highlighting is not a requirement.

Question:

Is it possible to avoid local installation of the WiX toolset and use flat files instead? If so, please explain how.

See Also:

+2  A: 

I know with WiX 2, you can just download the executable files and the dll's to whatever directory your project is in. Then you create a .bat file to run candle.exe and light.exe with the parameters you need to build your installer.

That way, all your projects can have their own version of WiX with a disk drive hit of only about 4 megs each.

I'm not positive, but I think you can do the same with WiX 3.

Grant
I'm going to try this out and see if it works. I'll get back with the results. Thanks Grant!
Burly
Yep, you are able to do it. Antik gave a detailed explanation of it so I accepted his answer but thank you for the assist!
Burly
+5  A: 

First, build your WiX installer:

  • Create a new WiX Installer Project in Visual Studio 2005.
  • Build your WiX XML accordingly.

Now, to integrate the WiX toolkit into your source tree:

  • Copy c:\Program Files\Windows Installer XML v3\bin to a sub-directory in your source tree. I used WiX\bin relative to my .wixproj file.
  • Copy c:\Program Files\MSBuild\WiX\v3.0\ to a subdirectory in your source tree. I used WiX\v3.0 relative to my .wixproj file.
  • Either add the following code or replace the line that follows:

<WixTargetsPath Condition=" '$(WixTargetsPath)' == ''>$(MSBuildExtensionsPath)\Microsoft\WiX\v3.0\Wix.targets</WixTargetsPath>

With the following lines:

<WixToolPath>$(MSBuildProjectDirectory)\WiX\bin\</WixToolPath> <WixTasksPath>$(MSBuildProjectDirectory)\WiX\v3.0\WixTasks.dll</WixTasksPath> <WixTargetsPath>$(MSBuildProjectDirectory)\WiX\v3.0\Wix.targets</WixTargetsPath>

As you can see, the WixToolPath, WixTasksPath and WixTargetsPath directives reflect the location of the folders I've instructed you to copy.

  • Rename your .wixproj to .csproj. This ensures that Visual Studio does not get confused by the .wixproj file but because the .wixproj is a valid MSBuild project, Visual Studio will be able to work with it.

Using this method, the WiX directory as described is about 9MB large.

antik
Sweeeeet. Thanks for the detailed instructions, this worked like a charm.
Burly
You could at least have referenced your source, namely the "Integrating WiX Projects Into Daily Builds" topic in the CHM file that comes with wix.
Wim Coenen
@wcoenen: Is that in the CHM? I actually winged it by reading Wix.targets, finding the compile instruction, determining what the variable was called, and defined them in my parent XML file.Thanks for the reference though: it's good to know I didn't have to do it the hard way if I'd read the docs.
antik
RTFM, wins again .....
CheGueVerra