How to perform a silent repair and uninstall of the .NET Framework 2.0 SP1 and 3.0 SP1

Since the .NET Framework 2.0 SP1 and 3.0 SP1 shipped (as prerequisites for the .NET Framework 3.5 and as standalone packages), I have gotten questions from customers asking how to perform automated repairs and uninstalls for these packages.  Because of the architecture changes that were made to .NET Framework 2.0 SP1 and 3.0 SP1 setup, the command lines that must be used for repair and uninstall scenarios are different than the ones for the original releases of the .NET Framework 2.0 and 3.0.

The following list provides example command lines that can be used to repair and uninstall the .NET Framework 2.0 SP1 and 3.0 SP1 after they have been installed on the system:

.NET Framework 2.0 SP1 - silent repair

msiexec /i {B508B3F1-A24A-32C0-B310-85786919EF28} /l*v %temp%\netfx20sp1_repair_log.txt /qn

.NET Framework 2.0 SP1 - silent uninstall

msiexec /x {B508B3F1-A24A-32C0-B310-85786919EF28} /l*v %temp%\netfx20sp1_uninstall_log.txt /qn

.NET Framework 3.0 SP1 - silent repair

msiexec /i {2BA00471-0328-3743-93BD-FA813353A783} /l*v %temp%\netfx30sp1_repair_log.txt /qn

.NET Framework 3.0 SP1 - silent uninstall

msiexec /x {2BA00471-0328-3743-93BD-FA813353A783} /l*v %temp%\netfx30sp1_uninstall_log.txt /qn

Important notes:

  • The .NET Framework 3.5 requires the .NET Framework 3.0 SP1 and 2.0 SP1 to be installed, so if you have the .NET Framework 3.5 installed, the above uninstall command lines will fail until you uninstall the .NET Framework 3.5.
  • Similarly, the .NET Framework 3.0 SP1 requires the .NET Framework 2.0 SP1 to be installed, so if you have the .NET Framework 3.0 SP1 installed, the above uninstall command line for the .NET Framework 2.0 SP1 will fail until you uninstall the .NET Framework 3.0 SP1.
  • The above examples use msiexec.exe to perform the repair and uninstall in fully silent mode.  If you choose to, you can use other supported Windows Installer command line parameters (described here and here) to perform unattended repairs and uninstalls or provide additional command line parameters to the setup processes.
  • The above examples only demonstrate the command lines used for repair and uninstall.  For install scenarios, I recommend reviewing the content in the .NET Framework 3.5 deployment guides as well as the steps for creating administrative install points (here for 2.0 SP1 and here for 3.0 SP1).
  • The above msiexec command lines will return exit code 0 if the command completes successfully, 3010 if the command completes successfully and a reboot is required and some other numerical value if the command failed.  You can find a list of some standard Windows Installer return codes in this knowledge base article.

<update date="5/22/2008"> Added information about return codes from the command lines listed in this blog post. </update>