How to define WIX agent requirement in TeamCity? - msbuild

I have add a WIX installer project to solution in Visual Studio 2013. The project is built with every commit on TeamCity. There are several build agents connected to TeamCity cloud, but only some have WIX installed.
Usually I would add the build agent requirement, so only the computer with WIX installed is selected for automated build.
What requirement should I select? Is there some environment variable I could use after WIX is installed?
I know I can set the environment variable manually on every computer I install WIX, but this is not nice solution for me.

There's a system environment variable called 'WIX', which holds the path WiX Toolset is installed to. It is created during WiX Toolset installation.
However, there might be a better way that avoids setting up any build agent requirements. Take a look at this article that explains how to integrate WiX into daily builds. Basically, it suggests committing the required binaries along with the source code of your app.
Both approaches have pros and cons, it's your choice.
The agent need to be restarted after installing WIX. Then there will be
env.WIX
requirment in the Teamcity.

Related

Building an installer, to install dlls to the gac, with MSBuild

I have a dll project which I need to install into the GAC, on our Production machines.
(I wish I didn't have to use the GAC but SSIS insists)
gacutil.exe is not available on the target machines and using "Enterprise.Services" from PowerShell does not work (I don't know why)
My understanding is I should created a msi installer project.
However after installing the Setup and Deploy Extension to Visual Studio (2015 soon to be 2017), I discovered those projects cannot be built by our Build Server because it uses MSBuild, and MSBuild can't build vdproj project files.
What is the correct way, using a CI build pipeline (MSBuild), to create build artifacts, which can install dlls to the GAC, of a Production Environment?
Note: there are several partial answers on SO, but I could not find any, which were up to date/answer my whole question. Please keep that in mind when answering.
You need to break this down into several user stories. You aren't finding partial answers, you are finding actual answers for specific questions. What you ask is more like an epic.
In general I would create an MSI using Windows Installer XML. WiX/MSI can install files to the GAC without using GACUTIL. If you use the WiX Visual Studio extension "Votive" you can create a .SLN / .WIXPROJ / .WXS that can be built using MSBuild. You can then put this into a source control system such as Git/TFVC/Subversion and use a build system such as VSTS V.Next Build, XAML Build, Concourse, Jenkins to automation the pipeline to build the MSI.

installshield - how to let user add files to program files folder in the install

I am trying to create an installer that will get the project to install from my server. The project will be chosen dynamically by the user (the user has access to the server), so I can't copy the files to the installer when I create it.
I want that the files will add to to ProgramFilesFolder in the installer.
How can I do this?
Not entirely sure what you want to do. Do you want to automatically add files to a project that they select and then build and MSI? Installshield can be run via automation (i.e via VBScript, VB, C# etc...), and you can achieve what you want using this approach. To work with a project you start from the ISWiProject Object. See this answer: Installshield Build Automation. And for C#: Getting Started with InstallShield Automation and C#.
Personally I would use Wix instead and automate via the Heat.exe tool and standard XML editing via code.
See how Installshield compares to other setup tools: What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc
Learn about Wix:
Windows Installer and the creation of WiX
MSI vs nuget packages: which are is better for continuous delivery?
Newer answer on automation

How do you make a WiX project build when dependent files have changes?

I've adopted a Visual Studio solution that contains a number WiX projects. We build the solution from an MsBuild script to generate the product's installer msi.
The problem I'm experiencing is that if I build (and don't rebuild), even if exe's and dll's get updated that need to be put in the installer, the WiX build system doesn't seem to detect this and skips building the installer as it thinks it's already up to date.
How do I work out what the dependencies are that are needed to build a WiX project, and how do I tell the Wix build system to watch out for them changing so it knows to build instead of skip?
Thanks.
This facility was added to WiX 3.6 with little fanfare - in the WiX 3.6 release notes it simply says ".wixproj MSBuild projects support incremental build."
The WiX MSBuild targets don't currently support payloads as inputs into the build process, so nothing tells MSBuild that the WiX targets need to be called. Feel free to file a feature request at wix.sf.net; a couple of us have been talking about ways to do it.
If you can include the projects that create the exe's and dll's into the solution containing the wix projects, you can add project references from the wix projects to the appropriate application projects. Then wix should properly perform incremental builds.
I configure my wix projects to only be included in the release configuration so that the apps can be quickly built and run without creating the install in the debug configuration.

Problems with WiX and Visual Studio web deployment project

We want to create an .MSI package from a web deployment project in Visual Studio 2008.
Now we want to use continuous integration and we would need the .MSI package build in the nightly builds.
Till now we used standard Visual Studio Web Setup project, but this is not compatible with the MSBuild. So we decided to use WiX.
The problem is that I have not found any good tutorial/documentation about this.
Is there a way to do a WiX installer package from a web deployment project? If yes, how?
Also, I tried to use heat.exe to create the XML for the WiX project .wxs file, but it seems that heat.exe doesn't recognize the web deployment project format.
Thank you for your responses.
Regards,
V.
I wrote a blog post about this recently - http://www.chrissurfleet.co.uk/post/2011/07/01/Using-Packaged-Project-Output-in-WiX-and-Visual-Studio.aspx
In short, its fairly easy to use msbuild to package up your web app and then pass it to heat to generate your installer from.
Hope this helps.
You've probably long since found a solution for this, but to elaborate on Tom Cabanski's answer, you can invoke Visual Studio to build the msi on the command line using "devenv.com" via an external process from within your build. It's not a pretty as using msbuild, but it gets the job done. Below is an example of how to invoke Visual Studio:
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com" your.sln /build Release
Where your.sln is the solution file for the solution you wish to build, and Release is the configuration you wish to build, ensuring that the configuration you choose actually builds the vdproj project.
Following the successful execution, you can grab the msi from the appropriate configuration's bin, and do what you want with it.
I'd appreciate your response to this with your findings/approach, as I'm trying to decide whether to adopt WiX or InstallShield as the approach to building msi's for Web Applications within TFS Build, or to continue with the approach I just described. I haven't had to opportunity to try WiX out, and my very limited exposure to InstallShield suggests that this is far to involved for my need, which is to produce a simple deployment aid for some relatively straight-forward web applications to the company intranet via TFS Build.
We used WIX on the installers for our last couple of projects and ended up regretting it. I would stick with the VS built-in projects and just invoke the VS IDE from the command line in the CI build.

Integrating Wix with MSBuild

we are looking to automate an MSI generation for a product we are developing. Currently we have MSBuild building out the source to a network location, this is fine for testing but when it comes to releasing the software we will need to wrap it in an MSI.
The software is all .Net bar 1 COM component that will need registered on each machine it gets installed to.
What I was wondering was how to integrate Wix with MSBuild so that a new wix script will get generated along with an MSI that is able to handle fresh and upgrade installs.
Any help with this is very much appreciated.
Thanks,
Brendan
Sure, there are tasks in MS Build that can do all you need to build an MSI from WiX. Can you integrate this on a build / integration server?
Newer builds of Wix actually include a file called "wix.targets", which should get you started.
Also check out these fine articles on the topic:
Building with Wix.Targets (by Heath Stewart)
Wix Target for MSBuild (by Willem Meints)
Automate Releases With MSBuild And Windows Installer XML (by Sayed Ibrahim Hashimi) (Web archive link for archived msdn magazine)
They cover the topic in much more detail and are extremely helpful to get started.
You should download and install Votive. This will create a Visual Studio project file which you can use with MSBuild to create a WiX-based MSI.
There is also a topic in the WiX manual about how to integrate with MSBuild called Using WiX with MSBuild.