I received a question from a customer about how to perform a sequential unattended install of the .NET Framework 2.0 redistributable package and SDK. I have written a couple of different posts in the past about the various command line parameters available for the .NET Framework 2.0 setup and some of the options for silent installs (for example, the posts here, here and here). However, I realized that I've been sort of scattering this information across multiple blog posts and not providing simple, easy to understand examples of real world scenarios like this unattended install, so I'm going to try to start addressing that with this post.
Here are example command lines you can use to perform unattended installations for the .NET Framework 2.0 redistributable and SDK.
These command lines will run the .NET Framework 2.0 redist and SDK setups in fully silent mode. The setup package will extract to a temporary location and installation will begin with no user interaction and no visible UI. The user will see no visible indication that setup is running.
- dotnetfx.exe /q:a /c:"install.exe /q"
- setup.exe /q:a /c:"install.exe /q"
Standard unattended installation
These command lines will run the .NET Framework 2.0 redist and SDK setups in standard unattended mode. The setup package will extract to a temporary location and installation will begin with no user interaction. A progress dialog will appear on the screen during installation, and it will disappear when setup is complete. Errors encountered during installation might pop up message boxes during installation if they occur.
- dotnetfx.exe /q:a /c:"install.exe /qb"
- setup.exe /q:a /c:"install.exe /qb"
Unattended installation with no cancel button available in the UI
These command lines will run the .NET Framework 2.0 redist and SDK setups in unattended mode with no cancel button. The behavior of setup is the same as with the command lines above except the cancel button will be hidden on the progress page during installation. This allows the user to know that a setup is in progress but prevent them from cancelling it (unless they kill the process in Task Manager).
- dotnetfx.exe /q:a /c:"install.exe /qb!"
- setup.exe /q:a /c:"install.exe /qb!"
Important notes to consider
- The .NET Framework 2.0 has 3 versions - a 32-bit version, an Intel 64-bit version and an AMD64 version. You will need to select the correct versions of the setup packages for the .NET Framework 2.0 redist and SDK to install on your system using these command lines
- The .NET Framework 2.0 SDK requires that the redistributable is already installed. Your unattended installation script will need to start the redistributable setup, wait for it to complete, and check the return code to determine whether or not it installed successfully before trying to run the SDK setup. A return code of 0 means success with no reboot required, 3010 means success with a reboot required and any other return code means failure