locked
custom action not firing to remove registry keys during uninstall RRS feed

  • Question

  •  I have an msi which creates couple of registry key entries while installation. I have created a console application which removes all the registry key entries during uninstall. I have added this console application as a custion action.

    My problem is, the custom action is not triggered during uninstall and the registy key entries still visible.

    I am not able to understand where I am going wrong!

    Tuesday, August 17, 2010 5:49 PM

Answers

  • Hi Krishna09,

    How did your console application remove all the registry key when uninstall? The problem lies on it.

    We try to help based on what I can see right now though. So could you post a snippet of relevant code so we can see what might be wrong?

    Since you do the uninstallation all manually, you have to do the remove the registry key by yourself which is highly not recommand!  To add and delete registry keys, you can refer to the following articles:
                  How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file  
                  How to Add a Registry Key
                  How To Delete Registry Keys in Windows XP

     

     

    Looking forward to your update.

     

    Sincerely,
    Helen Zhou

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    • Marked as answer by Helen Zhou Friday, August 27, 2010 6:54 AM
    Thursday, August 26, 2010 3:52 AM

All replies

  • First thing, I'm wondering why you're running custom actions instead of just using the registry view in the IDE to add your items to the registry, then we wouldn't be here.

    Anyway, you have an uninstall custom action on the uninstall node of the custom action view, right?  Did you add any conditions to the custom action call? If there are no conditions you added, it's highly unlikely that the custom action is not being called. I've never seen that issue in this forum. I assume you are seeing the registry entries remaining after the uninstall and you're thinking that your code did not get called. The most likely scenario is that your custom action is running but not doing what you expect it to do. Try putting a MessageBox call in it as the first line of code and see what happens, then we'd see if it's getting that far. Is it C++? C#?


    Phil Wilson
    Tuesday, August 17, 2010 6:16 PM
  • Wilson, Thanks for the reply!

     I am totally new to the msi's.

    This CA is in C#, and the reason why I am using a CA instead of IDE registry view is, while installation I have to add a registry key OPEN for the Excel addin. I have to check if there is already a OPEN key for excel in the HKCU, if it exists I need to add my registry key as OPEN1. In order to get this dynamic action for checking OPEN1 OPEN2 .... I used C# code. Similarly I need to remove all these entries while uninstall. That is the reason why i had to use another custom action while uninstall.

    I found something in your reply which I didn't do, that is adding a conditon to the CA. What condition do I need to put to make the CA console app run while uninstalling?

    Tuesday, August 17, 2010 7:02 PM
  • You don't need a condition on your uninstall custom action.  The reason I mentioned it is that one reason why your unstall custom action might not be called is because you added a condition to it that you got wrong. You don't *need* a condition.

    The most likely situation is that your code isn't working. Look at it this way - people use thousands of uninstall custom actions every day and they all get called fine. Why is it more likely that this is all broken rather than your code not being correct?


    Phil Wilson
    Wednesday, August 18, 2010 6:37 PM
  • Hi Krishna09,

    How did your console application remove all the registry key when uninstall? The problem lies on it.

    We try to help based on what I can see right now though. So could you post a snippet of relevant code so we can see what might be wrong?

    Since you do the uninstallation all manually, you have to do the remove the registry key by yourself which is highly not recommand!  To add and delete registry keys, you can refer to the following articles:
                  How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file  
                  How to Add a Registry Key
                  How To Delete Registry Keys in Windows XP

     

     

    Looking forward to your update.

     

    Sincerely,
    Helen Zhou

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    • Marked as answer by Helen Zhou Friday, August 27, 2010 6:54 AM
    Thursday, August 26, 2010 3:52 AM
  • Hello Krishna09,

    If you feel the solution I gave doesn’t real answer your question, please feel free to unmark it and update the thread.

    Best wishes,
    Helen Zhou


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Friday, August 27, 2010 6:54 AM