Partilhar via


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>

Comments

  • Anonymous
    February 19, 2008
    You've been kicked (a good thing) - Trackback from DotNetKicks.com

  • Anonymous
    February 19, 2008
    PingBack from http://msdnrss.thecoderblogs.com/2008/02/19/how-to-perform-a-silent-repair-and-uninstall-of-the-net-framework-20-sp1-and-30-sp1/

  • Anonymous
    February 19, 2008
    Silent repair and uninstall of the .NET Framework 2.0 SP1 and 3.0 SP1

  • Anonymous
    February 19, 2008
    Aaron, Normally, a "/i" won't repair, because REINSTALL isn't (or shouldn't be!) set in the Property table. From the log, it looks like there's a CA that sets REINSTALL. Is that just to make repair the default?

  • Anonymous
    February 19, 2008
    The comment has been removed

  • Anonymous
    March 20, 2008
    The comment has been removed

  • Anonymous
    March 20, 2008
    Hi Rbinnington - I'm not sure I understand your scenario.  You can use the uninstall command lines listed above from your application's setup code if you want to invoke the uninstall. However, I strongly discourage you from attempting to uninstall the .NET Framework as a part of your application's uninstall process, even if the user has a choice.  The problem is that many applications on a user's machine can depend on the .NET Framework, and uninstalling it will cause those other applications to not work.  Users will likely not even be aware that they have other applications that depend on the .NET Framework when you present this choice to them during your uninstall UI, but they will find out the hard way if they choose to uninstall it and then go to try to run the other applications on their system that depend on .NET.

  • Anonymous
    March 21, 2008
    The comment has been removed

  • Anonymous
    March 21, 2008
    The comment has been removed

  • Anonymous
    June 26, 2008
    Question: A while back, you posted a set of instructions that can be used to perform silent or unattended

  • Anonymous
    December 29, 2008
    I tried uninstalling the .NET Fx 2.0 SP1 silently, successfully, but, it also uninstalled the Fx 2.0 along with the SP1. Is it normal? or is there a workaround to just rip off the service pack and not the base installation of Fx 2.0?

  • Anonymous
    January 04, 2009
    Hi NarenS - The .NET Framework 2.0 SP1 is a slipstream package that installs both the .NET Framework 2.0 and the service pack updates.  As a result, there is not a way to uninstall only the service pack and leave the original package.  If you need to keep the .NET Framework 2.0 on your system in this scenario, you'll need to uninstall 2.0 SP1 then re-install 2.0.

  • Anonymous
    February 11, 2009
    A while back, I wrote a blog post about how to perform silent repairs and uninstalls for the .NET Framework

  • Anonymous
    February 18, 2009
    The comment has been removed

  • Anonymous
    March 04, 2009
    Question: I have seen your blog posts that describe how to silently repair and uninstall the following