Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

.NET Framework Cleanup Tool User's Guide

.NET Framework Cleanup Tool User's Guide

Rate This

.NET Framework Cleanup Tool User's Guide

Introduction

This .NET Framework cleanup tool is designed to automatically perform a set of steps to remove selected versions of the .NET Framework from a computer.  It will remove files, directories, registry keys and values and Windows Installer product registration information for the .NET Framework.  The tool is intended primarily to return your system to a known (relatively clean) state in case you are encountering .NET Framework installation, uninstallation, repair or patching errors so that you can try to install again.

There are a couple of very important caveats that you should review before using this tool to remove any version of the .NET Framework from your system:

  • This tool is designed as a last resort for cases where install, uninstall, repair or patch installation did not succeed for unusual reasons.  It is not a substitute for the standard uninstall procedure.  You should try the .NET Framework Repair Tool and then try the steps listed in this blog post before using this cleanup tool.
  • This cleanup tool will delete shared files and registry keys used by other versions of the .NET Framework.  If you run the cleanup tool, you will need to perform a repair/re-install for all other versions of the .NET Framework that are on your computer or they will not work correctly afterwards.
  • Additional support can be obtained by visiting the .NET Framework setup forum at http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/threads.

Download location

The .NET Framework cleanup tool is available for download at the following locations:

The .zip file that contains the tool also contains a file named history.txt that lists when the most recent version of the tool was published and what changes have been made to the tool over time.

Supported products

The .NET Framework cleanup tool supports removing the following products:

  • .NET Framework - All Versions
  • .NET Framework - All Versions (Tablet PC and Media Center)
  • .NET Framework - All Versions (Windows Server 2003)
  • .NET Framework - All Versions (Windows Vista and Windows Server 2008)
  • .NET Framework - All Versions (Windows 7)
  • .NET Framework 1.0
  • .NET Framework 1.1
  • .NET Framework 2.0
  • .NET Framework 3.0
  • .NET Framework 3.5
  • .NET Framework 4
  • .NET Framework 4.5
  • .NET Framework 4.5.1
  • .NET Framework 4.5.2

Not all of the above products will appear in the UI for the .NET Framework cleanup tool on every operating system.  The cleanup tool contains logic so that if it is run on an OS version that includes the .NET Framework as an OS component, it will not offer the option to clean it up.  This means that running the cleanup tool on Windows XP Media Center Edition or Tablet PC Edition will not offer the option to clean up the .NET Framework 1.0, running it on Windows Server 2003 will not offer the option to clean up the .NET Framework 1.1 and running it on Windows Vista or Windows Server 2008 will not offer the option to clean up the .NET Framework 2.0 or the .NET Framework 3.0.

When choosing to remove any of the above versions of the .NET Framework, the cleanup tool will also remove any associated hotfixes and service packs.  You do not need to run any separate steps to remove the service pack(s) for a version of the .NET Framework.

Silent installation mode

The .NET Framework cleanup tool supports running in silent mode.  In this mode, the tool will run without showing any UI, and the user must pass in a version of the .NET Framework to remove as a command line parameter.  To run the cleanup tool in silent mode, you need to download the cleanup tool, extract the file cleanup_tool.exe from the zip file, and then run it using syntax like the following:

cleanup_tool.exe /q:a /c:"cleanup.exe /p <name of product to remove>"

The value that you pass with the /p switch to replace <name of product to remove> in this example must exactly match one of the products listed in the Supported products section above.  For example, if you would like to run the cleanup tool in silent mode and remove the .NET Framework 1.1, you would use a command line like the following:

cleanup_tool.exe /q:a /c:"cleanup.exe /p .NET Framework 1.1"

One important note – as indicated above, the cleanup tool will not allow you to remove a version of the .NET Framework that is installed as part of the OS it is running on.  That means that even if you try this example command line on Windows Server 2003, the tool will exit with a failure return code and not allow you to remove the .NET Framework 1.1 because it is a part of that OS.

Similarly, you cannot use the cleanup tool to remove the .NET Framework 1.0 from Windows XP Media Center Edition or Windows XP Tablet PC Edition or remove the .NET Framework 2.0 or 3.0 from Windows Vista or Windows Server 2008.  In addition, if you run the cleanup tool on an OS that has any edition of the .NET Framework installed as a part of the OS, it will prevent you from using the .NET Framework - All Versions option because there is at least one version that it cannot remove.

If you are planning to run the cleanup tool in silent mode, you need to make sure to detect what OS it is running on and not pass in a version of the .NET Framework with the /p switch that is a part of the OS or make sure that you know how to handle the failure exit code that you will get back from the cleanup tool in that type of scenario.

Unattended installation mode

The .NET Framework cleanup tool supports running in silent mode.  In this mode, the tool will run and only show a progress dialog during removal, but will require no user interaction.  Unattended mode requires the user to pass in a version of the .NET Framework to remove as a command line parameter.  To run the cleanup tool in unattended mode, you need to download the cleanup tool, extract the file cleanup_tool.exe from the zip file, and then run it using syntax like the following:

cleanup_tool.exe /q:a /c:"cleanup.exe /p <name of product to remove> /u"

For example, if you would like to run the cleanup tool in unattended mode and remove the .NET Framework 1.1, you would use a command line like the following:

cleanup_tool.exe /q:a /c:"cleanup.exe /p .NET Framework 1.1 /u" 

Exit codes

The cleanup tool can returns the following exit codes:

  • 0 - cleanup completed successfully for the specified product
  • 3010 - cleanup completed successfully for the specified product and a reboot is required to complete the cleanup process
  • 1 - cleanup tool requires administrative privileges on the machine
  • 2 - the required file cleanup.ini was not found in the same path as cleanup.exe
  • 3 - a product name was passed in that cannot be removed because it is a part of the OS on the system that the cleanup tool is running on
  • 4 - a product name was passed in that does not exist in cleanup.ini
  • 100 - cleanup was able to start but failed during the cleanup process
  • 1602 - cleanup was cancelled

Log files

The cleanup tool creates the following log files:

  • %temp%\cleanup_main.log - a log of all activity during each run of the cleanup tool; this is a superset of the logs listed below as well as some additional information
  • %temp%\cleanup_actions.log - a log of actions taken during removal of each product; it will list files that it finds and removes, product codes it tries to remove, registry entries it tries to remove, etc.
  • %temp%\cleanup_errors.log - a log of errors and warnings encountered during each run of the cleanup tool

 

Attachment: dotnetfx_cleanup_tool.zip
  • Hi Woodneyuk - I haven't heard of this, but I also haven't ever tried to run this tool in these conditions.  Does the tool get far enough to be able to create any log files in the cases where it fails?  Also, do you see any other errors or warnings in the application event logs?

  • Aaron, thank you very much for you software. It helps me with uninstall problem...

  • Hi!

    I Want to remove the .net framework 1.1 but .NET Framework Cleanup Tool doesn't remove it.

    I started the process about 10 hours ago and it says Removing Registry Information. The last log info is

    [04/03/12,10:07:52] Found entry HKLM,SOFTWARE\Classes\Installer\Products\DDE7F2BCF1D91C3409CFF425AE1E271A, performing action now

    [04/03/12,10:07:52] Deleting registry key 'SOFTWARE\Classes\Installer\Products\DDE7F2BCF1D91C3409CFF425AE1E271A'

    Help please

  • Hi Luke - There are a couple of cases that I've run into in the past where the cleanup tool got stuck while trying to delete registry keys due to permissions issues.  In this case, I think you'll need to kill the cleanup tool, run regedit.exe and manually delete the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\DDE7F2BCF1D91C3409CFF425AE1E271A

    Hopefully this helps unblock things for you.

  • It give me an error:

    "It's not possible delete DDE7F2BCF1D91C3409CFF425AE1E271A: error to delete the key"

  • Hi Luke - Does the error give you any more details about why it can't delete this key?  For example, are you getting an access denied error or something like that?

    What version of Windows do you have on this computer?  It might be possible to manually update permissions to take ownership of this key and then try to delete it again, but the steps to do that vary depending on what version of Windows is on this computer.  You can find instructions for how to do this by doing a web search for something like "registry take ownership" and following instructions that you can find there.

  • The problem is in the key HKEY_CLASSES_ROOT\Installer\Products\DDE7F2BCF1D91C3409CFF425AE1E271A\SourceList\Media i can' t see what is inside. I can't set administrator privileges to it.

    How can i delete it??

  • I'm using Windows 7 home premium

  • Even if i right-click regedit.exe and run as admin i can't see, delete, rename or anithing with the key

  • Hi Luke - Do the steps listed at www.howtogeek.com/.../take-ownership-of-or-assign-full-permission-for-a-registry-key-in-windows-7 help at all here?  If not, I'm not sure how to resolve this type issue.  It might be possible to revert to a previous checkpoint using the System Restore tool or something like that.  If that doesn't work either, then you may need to repair/re-install Windows to fix this type of issue.

  • Aaron, thank you for your post and app.

  • Aaron, I had a mess on my hands for a long time in my XP-NET-Visual Studio setup until I ran across this while searching after the latest constant failing update. Thanks much, this really took care of my problem. Cleaned the troubled .NET setup out, and I got a clean and good install afterward. Hooray!

  • Aaron,whwnever i start my computer i receive a blank dos window of vbc.exe and every time i need to close it

    plz help me out of this irrtating thing

    thnx

  • Hi Jay - It isn't the exact same issue, but I'd suggest taking a look at the steps at blogs.msdn.com/.../10288684.aspx to see if they help narrow down which application is causing this error message to appear.

  • I think this is my favourite part:

    [06/12/12,14:26:09] Launching process 'C:\WINDOWS\system32\msiexec.exe /x {##} /qn' now

    [06/12/12,14:26:09] Process successfully launched. Waiting 900 seconds for it to complete.

Page 22 of 35 (518 items) «2021222324»
Leave a Comment
  • Please add 3 and 8 and type the answer here:
  • Post