Aaron Stebner's WebLog

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

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

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

  • Comments 15

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>

 

  • You've been kicked (a good thing) - Trackback from DotNetKicks.com

  • 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/

  • Silent repair and uninstall of the .NET Framework 2.0 SP1 and 3.0 SP1

  • 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?

  • Hi Bobarnso - You're correct, there is a custom action in the .NET Framework 2.0 SP1 and 3.0 SP1 MSIs that sets REINSTALL=ALL for repair mode.  The main reason for this is that a standard omus repair will not end up rewriting registry keys/values unless the component keypath is older or missing on the system.  Specifically, we found some cases where the file mscoree.dll was not triggering a repair with the omus flags, but one or more of the registry values in the component that installs mscoree.dll were broken.  Adding the REINSTALL=ALL flag allowed that case to be handled.

    Another note here - the command line switches for repair that are listed above could use /fvecms instead of /i and it should end up giving the same results.

  • Aaron,

    I am trying to make it so that I can install my program and detect if the user needs the .Net Framework to install it.  That part I can do.  

    But what I would like to do is be able to uninstall  my program AND prompt to uninstall the framework. if the user says yes, how can I do an uninstall in the manner you have above.

    Thanks,

    Richard

  • 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.

  • Thanks for your quick reply.  I am not sure what the GUIDs for the non-SP1 installs are, or how to find them.  We use dotnetfx.exe to install the framework, so we aren't going to be installing the SPs for a demo.

    We have a product that this going onto servers in the back end on a very strict environment.  They know exactly what is on their machines and they don't want us leaving anything on them when we leave after our test.  

    I do understand your concern and I share it.  If we release the product to a wider audience we will probably change the install.

    Richard

  • Hi Rbinnington - I'm sorry, I didn't understand from your previous comment that you needed to uninstall the original version of the .NET Framework 2.0/3.0 and not SP1.

    For the .NET Framework 2.0, you can either use the command line listed at http://blogs.msdn.com/astebner/archive/2006/02/07/527219.aspx, or you can go to %windir%\Microsoft.NET\Framework\v2.0.50727\Microsoft .NET Framework 2.0 and run install.exe /u /q from there.  Note that the folder named v2.0.50727\Microsoft .NET Framework 2.0 and the file install.exe will not be installed on the system if you have 2.0 SP1, so in that case you need to use the msiexec command line listed above.

    For the .NET Framework 3.0, you can go to %windir%\Microsoft.NET\Framework\v3.0\Microsoft .NET Framework 3.0 and run setup.exe /q /remove from there.  Note that the folder named v3.0\Microsoft .NET Framework 3.0 and the file setup.exe will not be installed on the system if you have 3.0 SP1, so in that case you need to use the msiexec command line listed above.

    Thank you for your understanding about the scenario where uninstalling the .NET Framework can affect other applications.  I have seen some products attempt to do this in the past and I've been trying to help eliminate this type of practice when I see it.

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

  • 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?

  • 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.

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

  • Last week, I posted a set of command line parameters that can be used to repair or uninstall the .NET

  • Question: I have seen your blog posts that describe how to silently repair and uninstall the following

Page 1 of 1 (15 items)
Leave a Comment
  • Please add 3 and 2 and type the answer here:
  • Post