Visual Studio Build Tools Silent Install

Prakash mishra 21 Reputation points
2020-12-09T13:55:12.7+00:00

How to install Visual Studio build tools 2019 and its workload silently. Is there any way to provide log file path to log activities the installer does during the deployment ? installation using UI is happening but failing in case of silent and I could not figure out the issue with the installation.
I found two ways of deployment

  1. using chocolaty packages.
    https://chocolatey.org/packages/visualstudio2019buildtools#install

But this requires sme prereqs and looks like it is installing many things other than the required ones and also is failing in between.

  1. Using ms commandline
    https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2019

This is throwing error when trying to install from powershell in quiet mode.

Also how to handle the uninstall and modify operations.

Developer technologies | Visual Studio | Setup
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2020-12-10T04:27:03.12+00:00

    Hi @Prakash mishra ,

    Thank you for reporting it in Microsoft Q&A.

    If you want to install the Visual Studio Build Tools 2019 without needing to launch the installer UI, please try the following command line to perform a silent installation of C++ build tools workload.
    vs_buildtools.exe --quiet --add Microsoft.VisualStudio.Workload.VCTools

    In addition, about the activity logs, you can find it under %temp% folder.

    If it persists, could you share us more details about the error in order for us to investigate it further?
    Please download and run this collect.exe tool, go to %temp% folder and find the vslogs.zip file, upload it to https://onedrive.live.com/ and share the link here.

    Sincerely,
    Anna

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Prakash mishra 21 Reputation points
    2020-12-14T16:21:18.637+00:00

    Created the below script which worked. I am not sure if --passive and --quiet both goes together(imo it does not).
    This waits for the execution and installs the required workloads.
    The only thing I do not like here is the passing of log file explicitly for getting the status of the installation or any errors.

    PS Script:

    function install-VS19BuildTools{

    $AllArgs = "--quiet --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.WebBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools --add Microsoft.VisualStudio.Component.Windows10SDK.18362 --add Microsoft.Net.Component.4.7.TargetingPack --includeRecommended --wait"

    $scriptRootPath = $PSScriptRoot
    $vsToolsPath = Join-Path $scriptRootPath "vs19_buildtools.exe"

    $Result = Start-Process $vsToolsPath -ArgumentList $AllArgs -Wait
    return $Result
    }

    install-VS19BuildTools

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.