dotnet / install-scripts

MIT License
133 stars 72 forks source link

Question: is dotnet-install script is 100% equivalent of the installer #416

Closed maxcherednik closed 9 months ago

maxcherednik commented 10 months ago

Context:

Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:

  • The SDK needs to be installed without user interaction and without admin rights.
  • The SDK installation doesn't need to persist across multiple CI runs. To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

We are following the docs of the .net platform. dotnet-install script for the CI activities. Installers for the dev environments.

More to that we have a lot of different repositories(and/or branches) where the version of the .net sdk is pinned with the global.json. As you can guess they are all targeting different versions. .net platform supports side-by side installations, but...

According to this blog it started to remove this previously installed version(when installed with the installer). https://devblogs.microsoft.com/dotnet/improving-net-core-installation-in-visual-studio-and-on-windows/

So we end up in a situation where IDEs can not pick up the pinned version cause it is actually removed from the Program Files.

Question: Assuming we know that we are installing the SDK for the development environment. It is a conscious decision and we have all the admin rights.

Is this line absolute equivalent of the installer or installer does more things to make it a development environment?

dotnet-install.ps1 -Version 6.0.414 -InstallDir "C:\Program Files\dotnet"
YuliiaKovalova commented 10 months ago

Hi @leecow, Could you answer this from installer's perspective or redirect it to the proper person? I don't know if the installer does any additional environment configuration/installs other components.

leecow commented 10 months ago

Given the context, I assume we're talking about the Windows installer. I'm not aware of anything beyond updating path information.

@marcpopMSFT and @NikolaMilosavljevic - are you aware of anything environment related other than the path and previous install removal that the Windows installer is doing?

baronfel commented 10 months ago

For reference, here is the packaging MSBuild logic that generates the windows MSIs. When you use the MSIs to install you get side-by-side feature band behavior - which means that older SDKs in the same feature band are removed. For example, installing 7.0.404 will remove 7.0.403 and lower from the 7.0.4xx series, but will leave 7.0.3xx SDKs untouched. There are other files related to workload management that are different between the zip-based deploy and the MSI-based installation of the SDK, if you mix and match your different SDKs may not consistently manage workload versions correctly, and you may get unsupported/unexpected behaviors between the CLI and VS as a result.

We do not suggest using the install-scripts to install into the conventionally-globally-installed locations.