Partilhar via


Mailbag: How to manage reboots when installing multiple versions of the .NET Framework

Question:

I am planning a network deployment of the .NET Framework, and I need to deploy all versions from 1.0 through 3.5 SP1 if any are missing on each of the computers on the network.  I have 2 questions related to reboots:

  1. Is it possible to install all versions of the .NET Framework without any reboot being required?
  2. If it is not possible, can I ignore all reboot prompts and only reboot once after installing all versions of the .NET Framework?

Answer:

It is not possible to guarantee with 100% accuracy whether or not a reboot will be needed before running .NET Framework setup.  Reboots during .NET Framework setup are caused by files being in use that need to be updated during the installation process.  Whether or not a reboot will be needed depends on the state of the computer that .NET Framework setup is being run on.  If there are any .NET Framework applications or services running on the computer, then they can lead to reboots being needed during installation of the .NET Framework.

When deploying the .NET Framework, you should install in silent or unattended mode and rely on the exit codes from the installation processes to determine whether or not a reboot is needed.  All .NET Framework setup packages will return the following exit codes:

  • 0 – installation is successful and no reboot is needed
  • 3010 – installation is successful and a reboot is needed
  • Any other value – installation failed

If you receive a 3010 exit code from a .NET Framework installation process, you can safely defer the reboot until after you install all versions of the .NET Framework.  However, you must schedule a reboot at the end of the overall installation process if you receive a 3010 exit code from any of the .NET Framework installation processes.  You cannot safely defer a requested reboot if you also plan to install or run a .NET Framework application on the computer.  All .NET Framework applications require that the .NET Framework be fully installed before they will be able to run reliably, including completing any reboots that are requested.

If you plan to install all versions of the .NET Framework on a computer, you can minimize the number of reboot requests that you might get by doing the following:

  1. If possible, close any .NET Framework applications and stop any .NET Framework services that are running on the computer before running any .NET Framework setup.
  2. Create an administrative install point for the .NET Framework 1.1 + the latest service packs and updates if desired.
  3. Install the .NET Framework 4 if desired.
  4. Install the .NET Framework 3.5 SP1 (which will install the .NET Framework 2.0 SP2 and 3.0 SP2 behind the scenes).
  5. Install the .NET Framework 1.1 + the latest SP from the install point created in step 2.

Most programs do not specifically require the .NET Framework 1.0 so I didn't list it above.  If you do need the .NET Framework 1.0, you will have to install it before installing the .NET Framework 4 because .NET Framework 4 setup blocks future installation attempts for the .NET Framework 4.  If you need the .NET Framework 1.0, I recommend installing in this order:

If you plan to install all versions of the .NET Framework on a computer, you can minimize the number of reboot requests that you might get by doing the following:

  1. If possible, close any .NET Framework applications and stop any .NET Framework services that are running on the computer before running any .NET Framework setup.
  2. Create an administrative install point for the .NET Framework 1.1 + the latest service packs and updates if desired.
  3. Create an administrative install point for the .NET Framework 1.0 + the latest service packs and updates if desired.
  4. Install the .NET Framework 3.5 SP1 (which will install the .NET Framework 2.0 SP2 and 3.0 SP2 behind the scenes).
  5. Install the .NET Framework 1.1 + the latest SP from the install point created in step 2.
  6. Install the .NET Framework 1.0 + the latest SP from the install point created in step 3.
  7. Install the .NET Framework 4 if desired.

Installing the versions of the .NET Framework from newest to oldest will help ensure that the highest versions of any shared files are installed first.  That way, even if the files end up in use during the later installation processes, the .NET Framework setup program will not need to replace them because a higher version will already be installed.

There are example steps for creating the administrative install points described in steps 2 and 3 above in the blog post at https://blogs.msdn.com/astebner/archive/2005/03/05/385971.aspx.

<update date="2/8/2011"> Added a separate set of installation instructions for cases where the .NET Framework 1.0 is required because .NET Framework 4 setup prevents the .NET Framework 1.0 from being installed after it. </update>

Comments

  • Anonymous
    February 08, 2011
    .NET 1.0 cannot be installed after 4.0 :(

  • Anonymous
    February 08, 2011
    Hi Kinokijuf - I'm sorry about that.  I originally thought that this order of install was blocked during the .NET Framework 4 beta but would be unblocked in the final release of the .NET Framework 4, but it looks like that isn't the case.  I'll update this blog post with this information.