What are the options to build an installer on a build-server without Visual Studio - msbuild

It seems like it's still not possible to build .vdproj on a build-server without having Visual Studio installed. However, using Wix seems to be a lot more complicated.
Are there any other options to do the following task:
Visual Studio 2010 Solution with multiple projects (.csproj)
Many loose content files (not inside assemblies)
Installer must be built on Build-server without Visual Studio on it (devenv.exe / devenv.com)
Installer must create Registry keys
Installer must associate file extensions with installed product
Installer must support upgrades (version upgrades)
Installer should be able to register COM components
Installer should be able to pre-JIT assemblies
My goal is:
Effort to maintain installer is low
Minimal changes if new project (assembly) is added to solution
Ideal: no changes if new content files are added to any of the projects
Maybe I just did not get the point with Wix, but including project output (like in .vdproj) seems very complicated.
Any suggestions very much appreciated!

OK I decided to go with Wix. Found out that using Votive it's possible to include project output like in .vdproj (Binaries, Content, Symbols and even Source Code).
If I run into more complicated situations where this isn't sufficient, I could fall back to some kind of harvester (Heat, Paraffin).
See some more Links in comments below (too little reputation to post more than 1 link in this post).

Check out InstallShield 2010 Limited Edition ( Free for Visual Studio 2010 users ). It has pretty much all the functionality that VDPROJ ( being retired btw ) has and supports silent builds. You can get one license for your dev box and one license for your build machine pretty easily.

Related

Visual studio create installer

I am creating an installation file using VS2019 which creates two files setup.exe and install.msi. Is it possible to bundle them together for easier distribution into one setup file. Previously I used iexpress to bundle them together and using custom.bat file to execute setup after extracting. Though this is an very old technique, Is their any more innovative way we can use directly from VS2019 ?
I found this guide which makes use of Advanced Installer through a Visual Studio extension. I was able to take two projects in a solution and package them into one .msi, which installs both of the project executables when ran.
You will need to download the "Advanced Installer" Visual Studio extension (see the "Extensions" menu item in Visual Studio), as well as install Advanced Installer itself, which can be found here (the extension will prompt you to download Advanced Installer if you attempt to use it without having it installed). All the extension does is make use of the Advanced Installer software, but through Visual Studio. Once you have it all configured, all you need to do is perform a build on the Advanced Installer project that you will need to add to your solution.

How to find the Windows Installer XML node in Visual Studio 2019 after toolset and extension installation?

I am trying to create an installer with Wix and Visual Studio 2019. I am a Wix newbie so I just started to get something really simple working, from scratch. Therefore, I read this explanation. I use Windows 10 build 19042.
Creating the winforms project does work fine for me but the next project does not. This is because of this step.
Choose the Windows Installer XML node in the Project types tree,
then select Setup Project
I can find Wix projects.
And I installed the Wix toolset.
So creating a very simple installer should be very simple. But in fact, it is not as I fail to do one tutorial step referring to a project type I cannot find.
You can help in these ways:
Tell me what to do the make sure the Windows Installer XML node
becomes visible.
Provide the step to do the same without the Windows Installer XML node.
And logically, I double checked if the Windows Installer XML node is really not there. And it really is not.
VS2017 vs VS2019: I guess that explanation was written for Visual Studio 2017 - which is quite different for the "New Project" dialog. You can select "WiX" in the drop down button that says "All languages" in that dialog
WiX Project Types: Just double click the "Setup Project for WiX v3" - this is the project type that creates an MSI. The "Bootstrapper Project for WiX v3" is for making setup.exe bundles.
WiX Downloads: For the record, make sure you have installed both WiX itself and the WiX Visual Studio Extension. It looks like you already have (just mentioned for others who see this).
WiX Training: I have a few answers on WiX crash course and training material:
Short WiX sample links
Long WiX Tips and Tricks and samples links
A few selected examples from github (there are more WiX projects at the root level):
https://github.com/glytzhkof/WiXDefaultDialogsSample
https://github.com/glytzhkof/WiXLaunchConditionTest

How to create .msi installer with WiX

Can someone help me understand how WiX works? I have a directory structure which I would like to create an installer for. I have generated the for the directory structure with heat.exe and when I build the setup project it generates an .msi file but I don't think it installs anything.
Maybe someone can walk me through the steps of generating a .msi installer.
Any advise is appreciated,
Thank you
If you're using Visual Studio:
Install the WiX Toolset V3 Visual Studio plugin.
Install the Wax interactive editor.
Build your project if you haven't already.
Add a new project to the solution containing the project you want to create an installer for.
Choose the template Setup Project for WiX v3.
Name the installer. A personal convention is the name of the project plus ".Setup"
A Product.wxs file will open up. Change the Manufacturer="" value to something like your company name or your name. Keep the file open.
Go to Tools -> WiX Setup Editor
On the left under Root Directory choose InstallFolder
Under Projects to install, choose the project you want to install.
In the red area to the right, you'll see a list of files. These are the output results of your build from step 3.
Click the plus sign next to files you want to copy. They should turn white and change to a Resolved state.
This might look daunting, but you're just telling it what to copy--which would be your project's executable, configs, dll libraries, and images it's dependent upon.
You typically want to copy everything. If there are dll's you know you don't need, it's better to remove them as a dependency from the Visual Studio.
Notice the Product.wxs has changed. It now has the files you checked off in the Setup Editor GUI added to the <Wix><Fragment><ComponentGroup> section. Save that file.
Close the Setup Editor.
Build the setup project you just configured.
Open Windows explorer and go to that project's bin/Debug or bin/Release folder, depending on what mode you built in. There you'll see the .msi that you can copy to where you need.
To make an update, make the necessary changes and then change the version number in that project's Properties -> Application -> Assembly Information. Then also change it in Product.wxs <Wix><Product.Version>. Then just build your setup project again.
Good tutorial here:
http://wix.tramontana.co.hu/
http://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with
They should get you started.
If you learn something about the MSI log that will also help - install the MSI with a command line that includes /L*vx
And "doesn't install anything" should be easy to check - are there are any files installed, or did it create an entry in Programs&Features?
WiX is a language (XML/XSD) that serves as a way of authoring (compiling) Windows Installer (.MSI) databases. WiX doesn't install anything, MSI does.
I maintain an open source project called IsWiX. The concept is simple. IsWiX provides additional WiX project templates (scaffolding) and graphical designers to assist you in creating installer. Then as you gain knowledge of WiX and MSI you can make additional tweaks of the WiX XML by hand and go beyond what IsWiX currently knows how to author.
Here's a video showing how to author, build and test an MSI to deploy an IIS website in a mere 3 minutes.
Update: IsWiX has tutorials now.
After a few 'false starts' trying to learn WiX from online tutorials I noticed that on http://wixtoolset.org/ there is a link to the book "WiX 3.6: A Developer's Guide to Windows Installer XML". You can buy it pretty inexpensively in E-book form from Packt, or also Amazon if you like the easy interface with Kindle.
I found this book to be VERY helpful with every little step regarding the .msi creation process. The book will guide you to create your first .msi in the very 1st chapter! Granted, you have to continue a little more to have a fully functioning .msi, but given the complexity of Wix, this book is terrific. It may not be for the gurus among us, but for those of us who need a little more help to understand the material it's wonderful. I've seen many posts speak to the 'steep learning curve' regarding WiX and it is a complicated process to create a valid .msi, but this book goes a long way toward making that learning curve very bearable.
If you are using the build system 'cmake', then you can use cpack to generate .msi file by setting the cpack generator to wix.
What worked for me best, was this fantastic tutorial video: https://www.youtube.com/watch?v=6Yf-eDsRrnM
Its best selling points for me was
independent of visual studio version
it describes deploying a .NET (Core) app also
it focuses on what an average app's installer should be capable of (including heat, icon, background image and banner)
you don't have to learn another layer on wix
it gives you good practices on easy package generation and future maintenance
it gives an installer project template which you can reuse: https://github.com/angelsix/youtube/tree/cecd38ea3d5eea11cc75fc0123297ffc3b5e662b/C%23%20General/Windows%20Installer%20Wix%20DotNet%20Core/ConsoleApp1.Installer

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.

Is it possible to avoid local installation and use flat files for WiX?

Background:
I always try to ensure the following tenet 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:
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.
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.