Making an MSI installer for your projects

Posted in: General vb.NET
By dePoPo
Aug 24, 2009 - 6:42:08 PM

setup-1.jpg


Adding the installation project
  1. Open your project you want to add the installer to
  2. Choose File, Add, New project
    choose as type "Other Projects"
    choose the Setup project
  3. Name the project installer

setup-2.jpg


Setting the basic propertys
  1. Set the basic propertys for your project,
    - Author
    - Manufacturer
    - Manufacturer URL
    - Title
  2. Set the product name. This is the name of the installed product, so not the name of your installer.
    Also, Set "Remove Previous Version" to true, if you want the installer to automaticaly upgrade current versions on your system.
    !Increase the version number property on your setup project to indicate a changes version, a simple rebuild is not enough to trigger the update process.
    (The version number is the bottom property on this image)

setup-3.jpg


Setting the destination
  1. Choose View, and then property pages
  2. Change to "All configurations", if needed you can specify seperate builds later
  3. Set a destination and name for the installer package

setup-4.jpg


setup-5.jpg


Select what to install
  1. Choose Project, Add, and Project Output. Select the primary output from the application you want to deploy. This will add the main executable to your project. Add any other content or assembly's you need deployed in the same manner. Most of the time Visual Studio will detect the dependency's  for you, and list them automaticaly.

setup-6.jpg


Creating a desktop Icon
  1. Choose User's Desktop, rightclik in the right pane and choose "Create new shortcut"
  2. Set the target to be the primary output from the main project
  3. Edit the icon
  4. Choose the primary output as the source for the icon
  5. Choose the application icon
  6. Change the name to the name you want the icon to have (typicaly your project's name)

setup-7.jpg


Creating the programm menu icon

  1. Choose User's Programm menu, and add any sub folders you want to appear in the menu
  2. Add a shortcut to the primary output (basicaly the same as with the desktop icon)
  3. Set the name to appear in the programm menu
  4. Set the icon

Finaly, Choose build, and build the installer. On the location you specified an MSI will be placed containing everything you need.


build-1.jpg
build-2.jpg
build-3.jpg


Tips & Tricks

If you build a new version of the application, the installer isnt rebuild by default. To change this take the following steps:
  • Rightclick the solution and choose 'configuration manager' (image 1)
  • Tag the setup project to be included (image 2)
  • Now you can build the solution and have all components rebuild (image 3)
    (you still need to update the version number on the installer if you enabled updating)




Visitor Comments