다음을 통해 공유


New tool that will be integrated into the VS 2005 cleanup tool - your feedback requested

We have seen some cases where the new VS 2005 cleanup tool fails to fully remove previous VS 2005 beta products. Behind the scenes, the cleanup tool searches for a list of known previous beta product codes, and if it is found, it will try to run msiexec /x for each product code that is found to be installed on the machine. However, there are some cases where msiexec /x fails to uninstall the product and additional steps need to be taken.

In order to address this set of scenarios, I have been working on a standalone tool that can be run as an action by the cleanup tool or as a standalone tool. There is a version of this tool, called smartmsizap, that can be downloaded from this location. In order to use the tool, you can run smartmsizap.exe /p {product_code}. It uses msiexec /x and msizap behind the scenes.

I'm interested in getting feedback from anyone reading this regarding the logic behind the scenes for this tool. Here is a rough outline of what it does behind the scenes:

  1. Takes the product code passed in with the /p switch and call MsiQueryProductState
  2. If MsiQueryProductState is equal to INSTALLSTATE_UNKNOWN or equal to INSTALLSTATE_INVALIDARG, then return without doing anything
  3. Call MsiGetProductInfo with the INSTALLPROPERTY_LOCALPACKAGE parameter to retrieve the locally cached MSI package
  4. Check to see if the locally cached MSI package exists in the expected location
  5. If it does not exist, run msizap TP {product_code} and then return
  6. If it does exist, try to run msiexec /x {product_code} /qn REBOOT=REALLYSUPPRESS and check the return code
  7. If msiexec /x returns success, then return
  8. If msiexec /x fails, run msizap TP {product_code} and then return

I'm still testing this out in various scenarios as I run into weird dirty machine states. But I'm curious if there are any holes in this logics that I've missed so far. Let me know what you think by posting comments or contacting me.

Once we get some additional testing, we'll get this exe integrated into a later version of the cleanup tool to make it able to cleanup additional scenarios that it currently can't resolve because it does not run msizap.exe currently.

<update date="4/1/2009"> Fixed broken link to smartmsizap tool. </update>

Comments

  • Anonymous
    September 30, 2005
    dear Friend How I Can Obtain the Product_ID of .Net FrameWork .NET 2.0 Beta 2, I See more than one Version for this product


    Regards Santiago

  • Anonymous
    September 30, 2005
    Hi Santiago - I'm not sure what you mean by a product ID for the .NET Framework 2.0. You do not have to enter a product key of any kind during .NET Framework 2.0 setup. Can you provide more information about what versions you are referring to and where it is asking you for a product key?

    Thanks!

  • Anonymous
    October 12, 2005
    The comment has been removed

  • Anonymous
    October 12, 2005
    Hi Taraxacum - you need to know the MSI product code for the product you want to uninstall in order to use this tool. You can use the steps at http://blogs.msdn.com/astebner/archive/2005/07/01/434814.aspx to figure out the product code.

    However, in the case of VS 2005, I would suggest using the automated cleanup tool that is linked to at the top of the uninstall instructions page at http://lab.msdn.microsoft.com/vs2005/uninstall/preRTMuninstall/default.aspx.

    Hope this helps...

  • Anonymous
    October 31, 2005
    The comment has been removed

  • Anonymous
    November 21, 2006
    I cannot get the link to the smartmsizap tool to load.  Have you got it somewhere else?

  • Anonymous
    November 21, 2006
    Hi Crawfr - Unfortunately, the file server I have been using is down and I don't have an ETA for when they're going to fix it.  For now, I can send you a copy of the tool via email if you contact me using http://blogs.msdn.com/astebner/contact.aspx.  I'm sorry for the hassles.

  • Anonymous
    January 31, 2008
    One of the questions I commonly receive from customers is how to uninstall a product when there is no