[Installer] Is it possible to automate the entire download/installation process of the .net runtime? #108786
-
Hey, I'm building a self-contained installer for an application that does require the .net runtime. Is there a(n official) way to automatically install the latest version of a specific major version? I have tried using the direct download link for the installers (from |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I also got rate limited after only a few downloads, so that's fun. |
Beta Was this translation helpful? Give feedback.
-
Common URLs for latest versions:
Preview builds: https://aka.ms/dotnet/6.0/preview/dotnet-sdk-win-x64.exe Of course you can also use any other major (like 7 or 8) in there. Not sure about .NET 9 though since it's in RC, but at least preview should work for it. |
Beta Was this translation helpful? Give feedback.
-
I don't know what you tried and why it didn't work, but it's a simple HTTP download that doesn't require any trickery, no special treatment nor any special requests headers or cookies set.
using |
Beta Was this translation helpful? Give feedback.
-
The simplest way is to use dotnet-install scripts, e.g. Windows: Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 && .\dotnet-install.ps1 -Channel "8.0" -InstallDir LocalDotnet9 Linux: wget https://dot.net/v1/dotnet-install.sh && chmod +x dotnet-install.sh && ./dotnet-install.sh -Channel "8.0" -InstallDir LocalDotnet9 You can also use different parameters to get the latest/lts/whatever version you want |
Beta Was this translation helpful? Give feedback.
Common URLs for latest versions:
Preview builds: https://aka.ms/dotnet/6.0/preview/dotnet-sdk-win-x64.exe
Daily builds: https://aka.ms/dotnet/6.0/daily/dotnet-sdk-win-x64.exe
Specific builds: https://aka.ms/dotnet/6.0.100/dotnet-sdk-win-x64.exe
Of course you can also use any other major (like 7 or 8) in there. N…