1

I have Windows running in a VMware VM, to which I connect via SSH. I can run a Command Prompt or a PowerShell. I'm trying to follow the instructions to install Visual Studio 2017 Build Tools from a command line. I download the installer from https://aka.ms/vs/15/release/vs_buildtools.exe and name it vsbt2017.exe, the "installation channel" from https://aka.ms/vs/15/release/channel and name it vs2017.chman, and I create an empty directory for the installation at C:\vs2017.

When I try this command in Command Prompt, it does not return immediately, waits a few seconds, then returns. My install path remains empty. No error message is printed to the terminal. %ERRORLEVEL% is 1.

start /wait .\vsbt2017.exe --quiet --wait --norestart --nocache --installPath C:\vs2017 --channelUri C:\vs2017.chman --installChannelUri C:\vs2017.chman --add "Microsoft.VisualStudio.Workload.VCTools;includeRecommended"

When I try this command in PowerShell, I get the same results. The analog of this command works for me for VSBT 2019, so it's really puzzling why it doesn't work for 2017.

Start-Process -FilePath C:\vsbt2017.exe -ArgumentList "--quiet --wait --norestart --nocache --installPath C:\vs2017 --channelUri C:\vs2017.chman --installChannelUri C:\vs2017.chman --add Microsoft.VisualStudio.Workload.VCTools;includeRecommended" -Wait -PassThru

If it makes a difference, I already have VSBT 2019 installed on this VM, but I've read in Microsoft's documentation that multiple versions can be installed simultaneously.

Almost two years ago, I asked a similar question about the 2019 Build Tools installer. This time, I need to install the 2017 Build Tools. The reason is that I need to figure out why someone else's installation of Visual Studio 2017 doesn't work, so I need to test with their version. "Just install Visual Studio 2019" is not an acceptable answer to this question.

John Freeman
  • 2,552
  • 1
  • 27
  • 34
  • What happens when you try it without the `--quiet` option? – Compo Apr 27 '21 at 00:06
  • `--quiet` is not there to suppress console output. `--quiet` is there to keep the program from trying to open a window. In other words, removing `--quiet` makes the program hang, while printing nothing to console. – John Freeman Apr 27 '21 at 00:07
  • Are you saying that there is no command line output with either option then? Also if the program is hanging, without the `--quiet` option, would it not be logical to assume it will be hanging with it too? Why are you using the `start` command? – Compo Apr 27 '21 at 00:12
  • 1
    Yes, there is no console output either way. Please read the instructions I linked in my question. It explains the options. It links to examples that explain the necessity of `start` or `Start-Process`. You can see in the answer to my other linked question an explanation for it too. I don't understand why Microsoft does it this way. – John Freeman Apr 27 '21 at 02:41
  • I do not think that the `start /wait` should be necessary, If you start a GUI executable, from the command line, it will only return to the prompt once that executable process is closed. If the executable is a stub, then it will not, but in that case the `/wait` would only work until the stub launches its payload, and return to the prompt whilst that payload is progressing. Are you running this elevated? Most Windows versions protect the root of the system drive, which means that you may not have permission to create and install to `C:\vs2017`. Have you checked the installation logs? – Compo Apr 27 '21 at 10:36
  • If you read the answer to my similar question that I linked, you'll see them saying that `start /wait` _is_ necessary. I am running this in a shell started by SSH, which is elevated, yes. Like I said, the same exact command works for the 2019 installer. Where are the installation logs? If you're referring to the archive compiled by Microsoft's collect.exe, that has like 100 files in it. Which one has the error? – John Freeman Apr 28 '21 at 19:45
  • I'm simply explaining to you my experience of using the `start` command, the advice of somebody else does not concern me, and TBF, will not fix your issue. It appears to me as if you'd prefer to argue about unimportant things, instead of dealing with the main thing, which is determining what is hanging your installation process. Even if you do not know which of your event logs contains the required information, surely it wouldn't take too long to find those which were modified around the date and time of your installation. You could use `find.exe` or `findstr.exe`, to help you to locate it. – Compo Apr 28 '21 at 22:55
  • That's not "the main thing" because Microsoft, in their documentation, say `--quiet` is required to not display a GUI and `start /wait` is required to make it return after and not before finishing the installation. I already explained to you it is hanging because it is trying to open an interactive window that I can't interact with from the shell. I don't prefer to argue, but you clearly didn't even read my original question because all this is explained in the resources I linked in it. – John Freeman Apr 29 '21 at 10:56

0 Answers0