I'd like to automatically update my Visual Studio 2017 installation from a script (running this script at session login).
vs_installer
shows a bunch of command line arguments (using /?
). So I tried :
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" update --passive --norestart
However, nothing happens. I see the process in the task manager for a few seconds, but the product is not updated.
How to update my VS installation ? Is is possible to handle the installer update ?
PS: if possible, I'd to have a passive update, not an invisible update. I'd prefer seeing the product being updated to avoid launching a new instance while the update is in progress.
If you have already installed VS code, go to the terminal and type two different commands: sudo apt update. sudo apt-get upgrade code.
You can also manually check for updates by running Help > Check for Updates on Linux and Windows or running Code > Check for Updates on macOS. Note: You can disable auto-update if you prefer to update VS Code on your own schedule.
Open Visual Studio. On the menu bar, select Tools > Command Line > Developer Command Prompt or Developer PowerShell.
I found partially the answer. I have to specify the install path of visual studio to let the installer knows what to update:
& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" update --passive --norestart --installpath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"
(assuming default path).
I still have to look for updates of the installer itself, but since I've the latest version, I've to wait for a new release.
[Edit 04/10/2019] The update process is similar with VS 2019 (at least from 16.0 to 16.0.1). I can update both version using :
Start-Process -Wait -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"""
Start-Process -Wait -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"""
I use Start-Process
with -Wait
to avoid returning control before the end of the update.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With