Uninstall path for the 'Remove' button in Add/Remove programs

Posted on 2007-03-29
Last Modified: 2010-05-18
I have written a custom installer application that executes an MSI file to register some dlls and copy the program files to the users machine. When the MSI runs it adds the program name to the Add/Remove programs list in the control panel. I want to modify the path of the program that the 'Remove' button executes so that it executes my custom installer program, not the MSI that is packaged with my installer. Can anyone please shed some light on this? I have looked through the registry, but have not been successful, it seems no matter what I change in the registry, the 'Remove' button always executes the MSI.

Question by:asmyatt
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Accepted Solution

kingtam2000 earned 500 total points
ID: 18820418
The problem is that MSI installations override the UninstallString key in the registry.  The key WindowsInstaller, when set to 1, automatically uses the msiexec /x to uninstall, ignoring the UninstallString key.  In order to use the UninstallString key, set WindowsInstaller to 0 to make the add/remove programs use the UninstallString key, which you can set to your custom installer, to uninstall the program.

If that doesn't work or if any problems occur, just post a comment.

Author Comment

ID: 18820686
that worked great!


Author Comment

ID: 18822848
Can you tell me why it adds two entries in the Add/Remove programs list. When the 'Remove' button is clicked for the first entry it executes my installer, but when the 'Remove' button is clicked for the second entry it executes the MSI. Is there another key that I need to change so that the second entry does not show up.


Expert Comment

ID: 18825213
Yeah, sorry about that, I just had a search and realised that method was incomplete.  In order to do it without a second entry showing up, you need to create your own entry, which could just be a copy of the key, but with the WindowsInstaller set to 0 and the UninstallString pointing to your own installer, and set ARPSYSTEMCOMPONENT in the Windows Installer properties to 1.  This prevents the windows installer version from showing up on Add/Remove programs by setting SystemComponent in the registry to be 1.  I got this information off

Author Comment

ID: 18825399
thank you

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
linq, c# 8 52
Need to sort columns in DataGridView 4 64
insert an Jpeg/bmp image onto the visio drawing using VBA/C# 5 70
Convert VB web project to C# 3 67
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question