Why does the Visual Studio Build Tools installer return immediately without installing anything?
Asked Answered
S

1

9

I'm trying to follow the example for installing Visual Studio Build Tools in a container. I'm trying to figure out why the installation isn't working like I expect. I cannot even start the container that is "built" with the components I think I want; it fails to run, saying The system cannot find the path specified.. I want to start the base image and run the installer myself, so I can see what is going on. Here is what I start with:

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe

Then I try manually running the command in the example:

C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.VCTools

This command returns immediately without doing anything. What is going on?

Saville answered 6/7, 2019 at 22:0 Comment(0)
S
2

It's a window app so control returns immediately. That's why our example instructions at https://learn.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019 use "start /wait" (batch). Please let me know if those instructions don't work for you.

Scintillant answered 7/7, 2019 at 4:34 Comment(5)
I'm using the same --wait option that is in the instructions. There is no other mention of "wait" on that page. What do you mean by "start /wait" (batch)?Saville
Here's a sampling of commands I've tried while inside of a container started with docker run -it <name>: gist.github.com/thejohnfreeman/2a64c63f09847ce5ed338fb540dcfc02 One working example command that I can copy and paste might help me understand what I'm missing.Saville
I made some progress. It seems the --quiet argument is required. Is that true? Is it trying to open a GUI otherwise? Is there no way to get logs printed to the console?Saville
Yes, both --wait and --quiet are required, as is still using "start /wait" (batch) or "start-process -wait" (powershell). You need to wait for the EXE you call to complete, and --wait just tells the bootstrapper (what you're actually running) to wait for the setup application - both of which were designed for window operations primarily.Scintillant
The sample docs work. That's how we create many of the containers we use for building other tools. Did you check for any error logs?Scintillant

© 2022 - 2024 — McMap. All rights reserved.