Sunday, January 16, 2011

Extending Visual Studio Setup Project – Part 1

One of the thing I hear all the time when companies talks for building reliable Windows Installer (MSI) for their product is –> Visual Studio Setup Project is not enough and we need much much more, my first response is – Wait, VS Setup project is not like Advanced Installer , InstallShield but still can do a lot more outside the box.

Setup projects are used to create Windows Installer (.msi) files, which are used to distribute your application for installation on another computer or Web server. There are two types of setup projects.

  • Standard setup projects create installers that install Windows applications on a target computer
  • Web setup projects create installers that install Web applications on a Web server.
In this article I’ll show how to extend your VS Setup Project and help to understand how VS Setup makes it easy for developers to build reliable Windows Installer (MSI) in Visual Studio. (All my screenshots will take from Visual Studio 2010.)

Getting Started With VS Setup Project
Adding New User Dialog and Deployments Conditions
Run External Application during Setup

Getting Started

Open Visual Studio and create new Setup Project called – “DemoSetup”, the Setup project item can be found under “Other Project Types”-> ”Setup and Deployment” –> “Visual Studio Installer”.
Also create a WPF application called – “DemoWpfApplication”, we need some project to work with.
Two things need to be done in order to get the MSI ready for deployment.

  1. On the DemoSetup project Add Project Output from DemoWPFApplication. – Setup will automatically find all related dependencies.
  2. Modify Setup Project properties (See Picture Below)
* The Version Property is very important for various MSI, in order to identify old installation and overwrite existing files with a newer version.

Read more: Shai Raiten