5

I have a program that is used to create other program and compile it from *.cs source file

      using System.CodeDom.Compiler;

I would like to create an installer too for the compiled program but i am wondering if i can do that programmatically, so when i click the Build Now button in my main application, a new installer will appear on a chosen destination.

Is there someway to create an msi installer for the compiled program ( the program that i have built ) with a button click.

I don't want to use InstallShield everytime i want to create an installer for my compiled programs.

Any help would be highly appreciated

Rafik Bari
  • 4,473
  • 17
  • 61
  • 121
  • If you have things working with InstallShield, there's always its automation interface and/or command-line build support. – Michael Urman Jun 18 '12 at 11:34

2 Answers2

9

I recommend you use WiX. It is a very powerful installer building tool. You can use it to create the install files using the command line tools, which can be used from your build program.

Amirshk
  • 7,772
  • 2
  • 30
  • 61
  • Agree with @Amirshk. WIX is definitely the way to go. Beats the binary efforts like Wise all ends up. – Tony Hopkinson Jun 17 '12 at 19:03
  • Some more info. Pros and Cons: [What installation product to use? **InstallShield**, **WIX**, **Wise**, **Advanced Installer**, etc](http://stackoverflow.com/questions/1544292/what-installation-product-to-use-installshield-wix-wise-advanced-installer/1546941#1546941). – Stein Åsmul Apr 20 '15 at 00:05
3

WiX is now integrated with Deployment Tools Foundation, a complete wrapper around the Windows Installer API. When you install WiX, you'll get DTF too.This should allow you to address any MSI related scenario programmatically. There's some documentation too, but you'll need a fairly rigorous understanding of MSI databases to get to grips with the API. I'd avoid this if possible and go with the WiX route.

As vdproj setup projects are being killed off in VS11, learning WiX is a considerably better investment in time than getting to grips with some of the other options VS tries to steer you towards.

spender
  • 106,080
  • 28
  • 202
  • 324