jberezanski / ChocolateyPackages

Chocolatey packages maintained by me
MIT License
83 stars 51 forks source link

visualstudio2022buildtools Installs to x86 Directory #126

Closed danyeaw closed 2 years ago

danyeaw commented 2 years ago

With the Visual Studio 2022 installer from Microsoft, it now installs to C:\Program Files instead of C:\Program Files (x86). Visualstudio2022buildtools is still installing to the 32-bit location. Could we please update it to the new 64-bit location?

jberezanski commented 2 years ago

The package does not specify the install location in any way. In fact, you can review the exact command line passed to the Build Tools executable in the Chocolatey log ($Env:ChocolateyInstall\Logs\chocolatey.log) or on the console by passing -dv to choco.exe. If no package parameters are specified, you should see something like:

Elevating Permissions and running ["C:\Users\VssAdministrator\AppData\Local\Temp\chocolatey\visualstudio2022buildtools\117.1.2.0\vs_BuildTools.exe" --quiet --norestart --wait]. This may take a while, depending on the statements.

I wonder if the behavior of the VS installer could somehow depend on existing state of the machine.

jberezanski commented 2 years ago

I performed some testing and, to my surprise, it appears the default installation path differs between VS 2022 products!

Here are the install locations for all VS 2022 17.1.2 products installed one after another on the same machine:

C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
C:\Program Files\Microsoft Visual Studio\2022\Community
C:\Program Files\Microsoft Visual Studio\2022\Enterprise
C:\Program Files\Microsoft Visual Studio\2022\Professional
C:\Program Files\Microsoft Visual Studio\2022\TeamExplorer
C:\Program Files (x86)\Microsoft Visual Studio\2022\TestAgent
C:\Program Files (x86)\Microsoft Visual Studio\2022\TestController

It looks as if IDE-based products install to Program Files, whereas the command-line products get installed to Program Files (x86) (by default).

Note that you can control the installation path using package parameters:

choco install visualstudio2022buildtools --package-parameters "--installPath D:\My VS location\Build Tools 2022"
danyeaw commented 2 years ago

Thanks @jberezanski ! It doesn't sound like this is an issue with the packages, just the default install locations from Microsoft are a little inconsistent.