10

In an attempt to streamline my Virtual Environment setup, I'm using Chocolatey to automate my VM.

Since I can run the cinst command to install Visual Studio

c:\> cinst VisualStudio2012Professional

I'm wondering if after it's installed, is there a command line switch to check for (and subsequently "install") updates within Visual Studio?

Something along the lines of...

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /InstallUpdates

This should also extend to any extensions that are installed along side VS.

3 Answers 3

12

There is a way to check but it is not at all straight forward. Visual Studio Updates are published via an ATOM feed that is currently hosted here:

http://go.microsoft.com/fwlink/?LinkID=251032

This URL can be located in:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Platform\Shell\Microsoft.VisualStudio.ExtensionManager.Implementation.pkgdef

Under the [$RootKey$\ExtensionManager\Repositories{52943709-1abb-4abe-b413-41e8bb6d0462}] key.

The above URL should not change for any version of Visual studio BUT that is not a guarantee. If you examine the response of http://go.microsoft.com/fwlink/?LinkID=290886, you will currently get this response:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text"></title>
  <id>uuid:99B94631-1B1A-45A0-9C34-54F75988DD54;id=1</id>
  <updated>2013-02-12T20:00:00-07:00</updated>  
  <entry>
    <id>8EAF6C8E-1283-4EEE-AB6E-F0F087BFCBFF</id>
    <title type="text">Visual Studio 2012 Update 3</title>
    <summary type="text">Includes security updates, other critical updates, hotfixes, and feature packs that have been issued since the product was released.</summary>
    <published>2012-12-01T21:00:00-07:00</published>
    <updated>2012-12-01T21:00:00-07:00</updated>
    <author>
      <name>Microsoft Corp.</name>
    </author>
    <link rel="alternate" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=257044&amp;clcid=0x409"/>
    <link rel="releasenotes" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=257045&amp;clcid=0x409"/>
    <link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=302339"/>
    <!-- icon should be 32 x 32 pixels -->
    <link rel="icon" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_32x.png"/>
    <!-- preview image should be 200 x 200 pixels -->
    <link rel="previewimage" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_200x.png"/>
    <Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
      <Id>8EAF6C8E-1283-4EEE-AB6E-F0F087BFCBFD</Id>
      <Version>11.0.60610.01</Version>
      <References />
    </Vsix>
  </entry>
  <entry>
    <id>28743233-1A36-4e67-8747-F072F8C76D1F</id>
    <title type="text">Visual Studio Extensions for Windows Library for JavaScript</title>
    <summary type="text">This release updates the development resources for the controls, CSS styles, and helper functions that are included in the Windows Library for JavaScript.</summary>
    <published>2013-08-08T20:00:00-07:00</published>
    <updated>2013-08-08T20:00:00-07:00</updated>
    <author>
      <name>Microsoft Corp.</name>
    </author>
    <link rel="alternate" type="text/html" href="http://go.microsoft.com/fwlink/?LinkId=260891&amp;clcid=0x409"/>
    <link rel="releasenotes" type="text/html" href="http://go.microsoft.com/fwlink/?LinkID=260892&amp;clcid=0x409"/>
    <link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=260893"/>
    <link rel="icon" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_32x.png"/>
    <link rel="previewimage" type="text" href="http://visualstudiogallery.msdn.microsoft.com/Content/VisualStudio/VSDownload_200x.png"/>
    <Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
      <Id>Microsoft.WinJS</Id>
      <Version>1.0.9200.20789</Version>
      <References />
    </Vsix>
  </entry>
</feed>

Note that there are two entries in this feed and the one you are interested in is the one with a title beginning with "Visual Studio 2012 Update."

If the Version specified in this file (11.0.60610.01 here) is greater than the version you have on disk:

(Get-Item "${env:ProgramFiles(x86)}\Microsoft Visual Studio 11.0\common7\ide\devenv.exe").VersionInfo.ProductVersion

Then you would want to download and install the url in the Link/@Update node:

<link rel="update" type="text" href="http://go.microsoft.com/fwlink/?LinkID=302339"/>

That Url should redirect to an MSI that has the update.

2
  • this is a good, but hacky way to solve the problem. Who/where would one send a feature request to include all of this in the devenv.exe command line switches? If it's one of those "never gunna happen" situations, I might just look at building an EXE to do just that, and pushing it to #Chocolatey. Commented Sep 1, 2013 at 20:24
  • 1
    Yeah. Probably not the API you were hoping for :) there is a uservoice site somewhere for submitting vs feature requests but I doubt it would lie high on the backlog. I too was thinking tlit would be cool to create a chocolate self-updater.while you can find choco packages for the updates. Its a pain both for the package producer and consumer to keep up.
    – Matt Wrock
    Commented Sep 1, 2013 at 21:18
1

Based on the information located in the Devenv Command Line Switches MSDN documentation. There is currently no way to call a command line swtich in order to check for / install updates to Visual Studio.

however Matt Wrock shows a nice workaround in his answer.

0

The answer from @Matt is outdated. For VS2019 follow this way:

  1. Download file at https://aka.ms/vs/16/release/channel (it will be plain JSON file 'VisualStudio.16.Release.chman')
  2. Check node: info->productDisplayVersion (or buildVersion) - they give enough info.
1
  • I've updated the tags to reflect that the question was asked re: visual studio 2012 Commented Jan 30, 2020 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.