How do I install .NET 4 on Windows Server 2008 R2 from the command line or PowerShell?

This post shows how to do it for .NET 3.5 using dism.exe and PowerShell. I am guessing that, since the .NET 4.0 binaries need to be downloaded first, these instructions do not work for .NET 4.

link|improve this question
Do you mean 2008 R2? Or do you actually mean RC2 as in a release candidate? – Ryan Bolger May 31 '11 at 16:20
R2 - sorry about that – house9 Jun 1 '11 at 20:55
1  
Your question might get more views if you edit it to fix the mistake. You should also probably update your windows-server-2008 tag to windows-server-2008-r2. – Ryan Bolger Jun 1 '11 at 23:39
feedback

2 Answers

I have done the following in Powershell:

((new-object net.webclient).DownloadFile("http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe","dotNetFx40_Full_x86_x64.exe")) 
& .\dotNetFx40_Full_x86_x64.exe /q

There are other command line options than /q (for quiet). You can see those by doing:

& .\dotNetFx40_Full_x86_x64.exe /?

link|improve this answer
feedback

This isn't specific to powershell, but might be of help. After installing .NET3.5 we follow up using the full install binaries, simply running a silent install. Depending on what and how you install this may require a reboot.

This how I've run silent installs of .NET4 in build/update scripts on 2003-2008R2 servers using the full install package:

  • dotNetFx40_Full_x86_x64.exe /q

If you've not already stumbled across these, you might find them useful:

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.