How To Integrate In Exisiting Setup Project Of Visual Studio

<< Back to the Setup Toolkit Installer page

This tutorial explains how to add the Grouplab Toolbox Installer to your own MSI setup projects. For an overview of the Toolbox Installer, just read the recipe How to use the Toolbox Installer.

Step 1. Open your setup project or create a new one

  • If you haven't created your own setup project, you can follow the tutorial steps of the Hello World setup project tutorial
  • Of course your project must contain at least one DLL file that contains .NET components; otherwise you can not use the Toolbox Installer (if you select invalid files, the Toolbox Installer maybe crashes and the complete setup fails)

Step 2. Add the Toolbox Installer executable to your project.

  • In the Solution Explorer do a right-click on your setup project name, select 'View' and 'File System'
  • In the opened window double-click the entry 'Application Folder'
  • In the right-click context menu select 'Add' and then 'File...'
  • Choose the location of the file GrouplabToolboxInstaller.exe (if you haven't downloaded the file yet: do it right now) and add the file

Step 3. Create a custom action to execute the installer.

  • The Toolbox Installer executable must be opened in the install and uninstall setup process, so we add custom actions
  • In the Solution Explorer do a right-click on your setup project name, select 'View' and 'Custom Actions'
  • Right-click on 'Commit' and choose 'Add custom action...'
  • Double-click 'Application Folder', select GrouplabToolboxInstaller.exe and click 'OK'
  • Repeat the last two steps with the entries 'Rollback' and 'Uninstall'
  • After these steps, the window should look like this screen:
  • Then select the entry GrouplabToolboxInstaller.exe of the 'Commit' entry
  • Look to the 'Properties' window of Visual Studio and select the 'Arguments' property
  • Add the following arguments: -i "Hello World" "[TARGETDIR]helloworld.dll"
  • Of course, you can replace "Hello World" with the toolbox name you like, and helloworld.dll with the DLL file you have in your setup project (you can also add multiple DLL files by adding the other files as additional parameters, but don't forget [TARGETDIR]\ before each file entry).
  • Then you must set the 'InstallerClass' property to false:
  • Then select the entry GrouplabToolboxInstaller.exe of the 'Rollback' entry
  • Select again the 'Arguments' property
  • Add the following arguments: -u "Hello World" (and of course you also have to change the toolbox name here if you use a different name for your project)
  • Change the 'InstallerClass' property to false
  • Repeat the last four steps for the entry GrouplabToolboxInstaller.exe of the 'Uninstall' entry

Step 4. Test.

  • Now you can rebuild your setup programm and test the installer.
  • Please note: Visual Studio has to be closed when running the Toolbox installer. Therefore you have to close your Visual Studio IDE to test the setup.