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

A while back, I wrote a blog post about how to perform silent repairs and uninstalls for the .NET Framework 2.0 SP1 and 3.0 SP1.  When the .NET Framework 3.5 SP1was released last fall, it included the .NET Framework 2.0 SP2 and 3.0 SP2 behind the scenes as prerequisites.  Those packages are both slipstream updates for the 2.0 SP1 and 3.0 SP1 versions, and because of that, the command lines used to repair or uninstall them have changed.

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

.NET Framework 2.0 SP2 - silent repair

msiexec /fpecmsu {C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F} REINSTALL=ALL REBOOT=ReallySuppress /l*v %temp%\netfx20sp2_repair_log.txt /qn

.NET Framework 2.0 SP2 - silent uninstall

msiexec /x {C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F} REBOOT=ReallySuppress /l*v %temp%\netfx20sp2_uninstall_log.txt /qn

.NET Framework 3.0 SP2 - silent repair

msiexec /fpecmsu {A3051CD0-2F64-3813-A88D-B8DCCDE8F8C7} REINSTALL=ALL REBOOT=ReallySuppress /l*v %temp%\netfx30sp2_repair_log.txt /qn

.NET Framework 3.0 SP2 - silent uninstall

msiexec /x {A3051CD0-2F64-3813-A88D-B8DCCDE8F8C7} REBOOT=ReallySuppress /l*v %temp%\netfx30sp2_uninstall_log.txt /qn

Important notes:

  • The .NET Framework 2.0 and 3.0 are installed as OS components on Windows Vista, Windows Server 2008 and Windows 7.  As a result, the MSI-based versions cannot be installed on these OS's, and the above command lines will not work on these OS's.  If you need to repair the .NET Framework 2.0 SP2 or 3.0 SP2 on these OS's, you will need to use instructions like the ones in this blog post.
  • The .NET Framework 3.5 SP1 requires the .NET Framework 3.0 SP2 and 2.0 SP2 to be installed, so if you have the .NET Framework 3.5 SP1 installed, the above uninstall command lines will fail until you first uninstall the .NET Framework 3.5 SP1.
  • Similarly, the .NET Framework 3.0 SP2 requires the .NET Framework 2.0 SP2 to be installed, so if you have the .NET Framework 3.0 SP2 installed, the above uninstall command line for the .NET Framework 2.0 SP2 will fail until you first uninstall the .NET Framework 3.0 SP2.
  • 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 SP2 and herefor 3.0 SP2).
  • 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="1/11/2012"> Added the REBOOT=ReallySuppress property to each command line so that the computer will not automatically reboot when running these command lines if the repair or uninstall process requires a reboot. </update>