views:

790

answers:

3

I want to create an installer for my project, primarily to handle the external dependencies which are starting to grow in number.

The problem is most of these components seem to be distributed in different manners, so I need an installer that can cope with all the following. Ive looked at various things around, however many dont seem to cover all the things I need (like how to install directX using a Visual Studio setup project...), or dont even create a proper windows installer (eg .msi).

  • Copy all my apps files to the target directory
  • Create start menu and desktop shortcuts
  • Install direct x (ie call dxsetup.exe /silent)
  • Install the VC9 CRT redist (seems to be a "merge module" looking at msdn whatever that is...)
  • Only requires administrative rights if one of the following is true
    • DirectX and/or the VC9 CRT is not already present, or needs updating
    • Installing for all users
    • Installing to a directory the user doesnt have write permission for
  • Can roll back everything if installation is aborted before completion
  • Generates an uninstaller as well as an installer
  • Ensures the user accepts all required EULA's (my one, VC9 Redist, DirectX, etc)

For example I got the VS2008 Setp Project working for my app files and the VC9 CRT, however I dont see anyway to tell it to just run dxsetup.exe with the /silent argument and NOT extract it and all the other dx installer to the app directory or something...

EDIT:

Also it would be really nice if I could have a unified installer for x86 and x86-64, which installers the correct components (eg myapp_x86.exe or myapp_x64.exe) depending on if the OS is 64bit or not.

EDIT2:

Forgot to mention but either a free or low cost solution would be welcome as well, since I need a solution for some of my smaller personal stuff as well.

+4  A: 

WiX is what you want. You'll want to read through the v3 documentation and examples, as it is not a simple thing to use. Once you get going, you'll have follow-up questions which you should post as new questions.

See also the WiX tutorial, but keep in mind it refers to v2, and a lot of it is out-of-date or obsolete in v3.

jeffamaphone
Looks good, ill definitely give WIX a try :)
Fire Lancer
+1  A: 

Follow these STeps

joe
Looks good, ill definitely give WIX a try :)
Fire Lancer
+2  A: 

If you can afford it, Installshield does all this very well and professionally. It will include the merge file and seamlessly install as well. Installshield has its quirks, but it is incredibly easy to use and robust. Once you write your app, you don't want to think a lot about the installer.

Some nice features I liked

  • Creates patch installs by diff'ing the source so you can distribute patches with a small size.
  • Create upgrades that update the registry and version number of your app. Prevents older versions from being installed.
  • Creates an nice uninstaller.
  • It's Easy to add merge modules.
  • Scriptible if you need it to be, GUI if not (most of the time you don't need to script a thing).

If you can't afford that, go with NSIS. It is very powerful and well used, but prepared to write code in a text editor.

Byron Whitlock