Lately I've become uncomfortable with the setup project that comes with Visual Studio 2005. We've been using it to deploy a web application and a windows service, and we hit all sorts of snags.
For instance:
- You can only build it inside Visual Studio, so our build server can't produce MSI's for us.
- You can't attach .bat files to the installation actions, only .vbs files. I really can't understand why.
- CustomAction parameters syntax is not the prettiest thing.
But our latest issue with the setup project had me really puzzled for a while. It involved the deployment of the windows service I mentioned - specifically, its app.config. For some reason, the setup project regarded the actual app.config file as that project's output, instead of the service.exe.config that is generated by MsBuild. In order to deploy that service to different environments we change the .exe.config according to the current build configuration, by using an MsBuild task called XmlMassUpdate. We change the .exe.config file directly, not the app.config, since the latter is usually protected by source control, and therefore marked as read-only. Anyway, it makes a lot of sense for us to change only the output the build produces and not the source.
Thing is, you can't change the setup project view of what the output is (at least we couldn't find a way to do this, even by manually editing the project file), and since it decided that app.config is it, it left us with no choice but to change that source file directly.
I really think the output should simply be regarded as the entire /bin/debug or /bin/release directories, and not just the .exe + app.config files. Go figure.