jberezanski / ChocolateyPackages

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

[visualstudio2017-workload-vctools] Installing on Windows Server 2022 container fails with docker build #120

Closed dd-mozdemir closed 1 year ago

dd-mozdemir commented 2 years ago

Hi everyone,

I was trying to install this on a Windows Server 2022 docker container mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022 using docker build and it appears that the script gets stuck here indefinitely:

Running 'Start-VSServicingOperation' for visualstudio2017-workload-vctools with silentArgs:'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" --includeRecommended --norestart --quiet --add Microsoft.VisualStudio.Workload.VCTools', file:'C:\Program
Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe', logFilePath:', operationTexts:'installed installing installation', assumeNewVS2017Installer:'True'
[20211103 08:47:56.653] Looking for still running VS installer processes
Did not find any running VS installer processes.
[20211103 08:47:56.688] Looking for vs_installer.windows.exe processes spawned by the uninstaller
Did not find any running vs_installer.windows.exe processes.

Running 'Start-VSChocolateyProcessAsAdmin' with exeToRun:'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe', statements:'modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" --includeRecommended --norestart --quiet --add Microsoft.VisualStudio.Workload.VCTools', minimized:False, noSleep:False, validExitCodes:'0 3010 -2147185721 -2147205120 -2147172352'
Elevating Permissions and running ["C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" --includeRecommended --norestart --quiet --add Microsoft.VisualStudio.Workload.VCTools]. This may take a while, depending on the statements.
Setting RunAs for elevation

The culprit appears to be at this line.

The odd thing is that if I run that container with docker run and install it manually it works fine, it only gets stuck when installed with docker build like it is waiting for something.

This issue does not happen at all on windows server 2019-based images.

jberezanski commented 2 years ago

The line you point to is simply calling the actual the VS installation program.

The official VS 2017 system requirements page does not list Server 2022 as supported, so we may be in uncharted territory there. (Although it does work on Server 2019, even though this version is also not listed.)

I suggest you examine the numerous log files the VS installer generates in $Env:TEMP\chocolatey (named dd_*.log). There you will be able to see what the installer was doing and there may be some clues as to what it may be waiting for.

jberezanski commented 1 year ago

Closing due to inactivity.