Aaron Stebner's WebLog

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

Mailbag: How to perform a silent repair and uninstall of the .NET Framework 3.5

Mailbag: How to perform a silent repair and uninstall of the .NET Framework 3.5

  • Comments 4

Question:

A while back, you posted a set of instructions that can be used to perform silent or unattended repairs and uninstalls for the .NET Framework 2.0 SP1 and the .NET Framework 3.0 SP1.  I would like to automate the repair and uninstall for the .NET Framework 3.5 as well.  How can I do that?

Answer:

The .NET Framework 3.5 installs a copy of its setup files to the folder %windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5, and this location is the one that is launched when you go to Add/Remove Programs and choose to repair or uninstall the .NET Framework 3.5.  The setup.exe in this location can also be called directly in order to automate the repair or uninstall of the .NET Framework 3.5.

The following command lines can be used to repair and uninstall the .NET Framework 3.5.  The silent option will perform the repair/uninstall with no UI displayed to the user.  The unattended option will perform the repair/uninstall with only a progress dialog, but with no user interaction required.

.NET Framework 3.5 - silent repair

"%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5\setup.exe" /q /norestart

.NET Framework 3.5 - unattended repair

"%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5\setup.exe" /qb /norestart

.NET Framework 3.5 - silent uninstall

"%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5\setup.exe" /q /uninstall /norestart

.NET Framework 3.5 - unattended uninstall

"%windir%\Microsoft.NET\Framework\v3.5\Microsoft .NET Framework 3.5\setup.exe" /qb /uninstall /norestart

Note:  There are a few things to keep in mind about the above instructions:

  • When calling .NET Framework 3.5 setup in silent or unattended mode, you should check the return code from the setup.exe process in order to determine success or failure.  Return code 0 means that the setup was successful, return code 3010 means that the setup was successful but a reboot is required to complete the setup and any other return code means that there was an error.
  • Log files will be created for the .NET Framework 3.5 repair and uninstall just like for the initial install.  You can find a list of .NET Framework 3.5 log files in this blog post.
  • The .NET Framework 3.5 repair process will chain the repair processes for the .NET Framework 2.0 SP1 and the .NET Framework 3.0 SP1, so there is no need to use separate steps to repair those products if you are going to repair the .NET Framework 3.5.
  • The .NET Framework 3.5 uninstall process will only uninstall the .NET Framework 3.5 MSI.  It will not uninstall the .NET Framework 2.0 SP1 or the .NET Framework 3.0 SP1 products because there may be other applications on the system that rely on those versions of the .NET Framework.  If you want to uninstall the .NET Framework 2.0 SP1 and 3.0 SP1, you must uninstall in the following order:  .NET Framework 3.5, then .NET Framework 3.0 SP1 then .NET Framework 2.0 SP1.
  • In my previous blog post , I described silent repair and uninstall command line switches that can be

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

  • For some reason setup.exe is not found in C:\Windows\Microsoft.NET\Framework\v3.5    

    How do I reinstall the 3.5 framework on Windows 7  ?   If setup.exe is missing from this folder, can it still be repaired?

  • Hi Jeff - The .NET Framework 3.5 SP1 is installed as an OS component on Windows 7, and as a result, the standalone installer will not allow you to install on that OS and you won't have a setup.exe to try to use for repair scenarios.  For versions of the .NET Framework that are installed as OS components, you will need to use steps like the ones described at blogs.msdn.com/.../how-to-repair-the-net-framework-2-0-and-3-0-on-windows-vista.aspx to repair them.

Page 1 of 1 (4 items)
Leave a Comment
  • Please add 5 and 5 and type the answer here:
  • Post