Visual Studio: Create An Uninstaller Shortcut In Your Installer Wizard

Creating a setup wizard within Visual Studio does not include an uninstall shortcut with it. The uninstalleasiest and quickest way would be to do the following. This post assumes you already know how to create a setup wizard.

Create a batch file (say name it uninstall.bat) with the contents below
@echo off
msiexec /x {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

Where {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} is the product code that is found in your setup project’s product code. Make sure you include the brackets as well.

Under Application Folder, right click, choose ADD, then FILE and browser to where uninstall.bat is located. Under User’s Program Menu, right click and create a shortcut. Then browser to Application Folder and choose the uninstall.bat file that you just added.

Rebuild your project and voila! Your uninstall shortcut is now included when the setup wizard installs your application.

Found this post useful? Donations appreciated. Every little $ helps.

Related Posts with Thumbnails

8 Responses to “Visual Studio: Create An Uninstaller Shortcut In Your Installer Wizard”

  1. 1
    Mya Says:

    thanks for this great read i enjoyed it

  2. 2
    tech Says:

    you are welcome :D

  3. 3
    Santosh Says:

    Thnks man that was great

  4. 4
    tech Says:

    welcome dude ;)

  5. 5
    Dripster82 Says:

    Simple & just what I needed.
    Thanks

  6. 6
    Leo Says:

    thanks a lot dude.
    but in my case the directory structures created by install application remain unhanded.
    would you tell me how to remove them too?

  7. 7
    tech Says:

    im sorry. what do you mean by unhanded?

  8. 8
    Peter Says:

    This is a valid way for uninstalling, however there is also ther ways. For example bu calling msiexec from within the application itself, an example of this can be seen here: http://endofstream.com/creating-uninstaller-in-a-visual-studio-project/

    Best reagads :)

Leave a Reply

Spam protection by WP Captcha-Free