Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS with no warranties, and confer no rights. Additionally, views expressed herein are my own and not those of my employer, Microsoft.
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:
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:
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:
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:
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 http://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>
.NET 1.0 cannot be installed after 4.0 :(
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.