I previously wrote a blog post listing the silent install, repair and uninstall command line parameters for the .NET Framework 4. Since then, I’ve gotten questions from a few folks who are trying to deploy the .NET Framework 4 in ways that require them to run the MSIs directly instead of using the setup executable (for example, via Group Policy or WMI). Here are some steps you can use to extract the .NET Framework 4 setup package and create administrative install points for the MSIs that are a part of the .NET Framework 4:
- Download the .NET Framework 4 standalone installer and save it to your hard drive
- Run the following command to extract the contents of the .NET Framework 4 installer: dotNetFx40_Full_x86_x64.exe /x:c:\dotnetfx4
- Run the following command to create an administrative install point for the .NET Framework 4 core x86: msiexec /a c:\dotnetfx4\netfx_Core_x86.msi EXTUI=1 TARGETDIR=c:\dotnetfx4\AIP\netfx_core_x86
- Run the following command to create an administrative install point for the .NET Framework 4 core x64: msiexec /a c:\dotnetfx4\netfx_Core_x64.msi EXTUI=1 TARGETDIR=c:\dotnetfx4\AIP\netfx_core_x64
- Run the following command to create an administrative install point for the .NET Framework 4 extended x86: msiexec /a c:\dotnetfx4\netfx_Extended_x86.msi EXTUI=1 TARGETDIR=c:\dotnetfx4\AIP\netfx_extended_x86
- Run the following command to create an administrative install point for the .NET Framework 4 extended x64: msiexec /a c:\dotnetfx4\netfx_Extended_x64.msi EXTUI=1 TARGETDIR=c:\dotnetfx4\AIP\netfx_extended_x64
Once you’ve created the administrative install points described above, you should be able to install the MSIs in the administrative install point folders directly or use steps like the ones previously published for the .NET Framework 2.0 to create Group Policy objects to deploy the .NET Framework 4. When doing this, you will need to apply an additional transform to each of the MSI files to prevent the installation from blocking you and telling you to run setup.exe instead. I have created an example transform that you can download from here for this scenario. This transform changes the condition for CA_BlockDirectInstall to False so it will not be run during the installation process.
Important note: when creating administrative install points and installing the .NET Framework 4 MSIs directly, it is your responsibility to install all of the prerequisites for these MSIs onto the target computer prior to attempting to install the MSIs. This includes the OS prerequisites listed here plus the OS update (.msu) files that are packaged with the .NET Framework 4 if you are running setup on Windows Vista or higher. If you do not install these prerequisites, then installing the MSIs will fail.
<update date=”6/17/2010″> Added a link to a transform that can be used to bypass the custom actions in the .NET Framework 4 MSIs that prevent installing the MSI drectly and tell you to run setup.exe instead. </update>
<update date=”9/18/2014″> Fixed broken link to the transform. </update>