Visual Studio: Add Uninstall to Your Application


First let me send a shout out to my reference for this little tidbit of information:  How to add a Uninstall option in Visual Studio Setup project without writing code GoGoToTo created a very nice article on this.  I simply expanded it further to include getting your application “registered” so within BigFix it will show up as one of the registered apps.

First View your File System so we can add the special folder “System”

Uninstall and Register 1

If your application is x86, then we’ll want to add the msiexec.exe from the c:\windows\SysWow64 folder.

Uninstall and Register 2

Uninstall and Register 3

Left click to highlight the msiexec.exe file and in the properties window, adjust as indicated in the following image:

Uninstall and Register 4

Next we’ll need to add a shortcut to the “User’s Program Menu”.  In my example, I’ve created a sub-folder named after my application.  Click that folder and in the right window, right-click and create a shortcut.

Uninstall and Register 5

Navigate to the System Folder and select the msiexe.exe file.

Uninstall and Register 6

Uninstall and Register 7

Before we modify the shortcut’s properties, we’ll need to copy the ProductCode from the Setup Application Properties.

Uninstall and Register 8

Using that ProductCode, modify the shortcut’s properties as follows:

Uninstall 8a

Now we get to register our application… Open the Registry View.

Uninstall and Register 9

Under HKEY_LOCAL_MACHINE add the following sub-keys:

Microsoft\Windows\CurrentVersion\App Paths\[name of your exe]

Remember to specify the last key to “DeleteAtUninstall” = True

Add the following 2 string values with the values as shown.

Uninstall and Register 10

 

That’s it.  You now have an uninstall link that will be created upon installation of your app.  You will also have your application properly “registered” so BigFix can properly detect it.

About these ads
Tagged with: , , , , , , , ,
Posted in BigFix, Installation, Microsoft, Programming, Software, Visual Studio
4 comments on “Visual Studio: Add Uninstall to Your Application
  1. [...] Comments « Visual Studio: Add Uninstall to Your Application [...]

  2. [...] I have recently wrote a c# application and want to have it automatically installed across my infrastructure.  When new systems come on-line, I want my application to automatically be installed once it is properly linked into my BigFix infrastructure.  One note to be made when writing your own applications… be sure to properly register your application so you can easily detect that software on your endpoints.  I wrote an article which will show you how to properly register your app when creating your Visual Studio Setup application. [...]

  3. Ashwini says:

    Hi, I have followed the procedure and trying to install the application but facing “could not write value Microsoft\Windows\CurrentVersion\App Paths\ to key \new. verify that you have sufficient access to that key, or contact your support personnel. “

  4. DanielHeth says:

    This sounds like a permissions issue. Run the install as an administrator.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Flickr Photos
SetLocationWindows2

SetLocationWindows1

SetLocationMacLinux2

SetLocationMacLinux1

More Photos
Clicky
Follow

Get every new post delivered to your Inbox.

Join 194 other followers

%d bloggers like this: