Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visualstudio2017: defend against Chocolatey AutoUninstaller #6

Closed
jberezanski opened this issue Apr 19, 2017 · 14 comments
Closed

visualstudio2017: defend against Chocolatey AutoUninstaller #6

jberezanski opened this issue Apr 19, 2017 · 14 comments

Comments

@jberezanski
Copy link
Owner

When uninstalling the first VS 2017 product package installed on the machine, the Chocolatey AutoUninstaller will remove the VS Installer, removing all other VS 2017 products.

Until chocolatey/choco#1257 is resolved, the packages need to work around this behavior.

@ferventcoder
Copy link

What are all of the other VS 2017 products?

@ferventcoder
Copy link

Just trying to determine why if I uninstall VS 2017 that I would not want to remove everything?

@jberezanski
Copy link
Owner Author

Here is the full list of VS 2017 products:
Build Tools
Community
Enterprise
Feedback Client
Professional
Team Explorer
Test Agent
Test Controller
Test Professional

Each of these products can be installed and uninstalled independently, side-by-side with others. You can even install multiple instances of the same product in different directories (perhaps to test an untrustworthy extension?). None of the products appear in Programs and Features, only the Visual Studio Installer (which manages all instances of all products installed on the machine) does.

This differs radically from the installation model of VS 2015 and earlier, where generally there was only one instance of the given Visual Studio major version on the system (the "integrated shell") and installing various Visual Studio products either added functionality to that instance (for example, augmenting Professional by installing Test Professional) or replaced it (Enterprise).

With VS 2017, the user can, for example:

  1. install VS 2017 Feedback Client <-- this installs the VS Installer
  2. install VS 2017 Community
  3. install VS 2017 Professional
  4. uninstall VS 2017 Community
  5. install VS 2017 Test Controller
  6. uninstall VS 2017 Feedback Client

Currently, during step 6) the AutoUninstaller will attempt to remove the VS Installer, while it clearly should be left intact (there are other VS products still installed: Professional and Feedback Client).

@jberezanski
Copy link
Owner Author

@heaths I've noticed your comment which seems to imply it is possible to install the VS Installer only, without installing any VS product. Could you please confirm that one could, for instance, download the Feedback Client bootstrapper and invoke it as such:

vs_FeedbackClient.exe --update --quiet

and it will install just the VS Installer (on a machine which does not contain any VS 2017 bits)?

(I don't see the --update switch mentioned in the documentation. There is the update command, but its description only mentions updating an already installed product.)

If there was a way (supported and/or documented) to install just the VS Installer, it would allow me to sidestep the issue with the over-eager Chocolatey AutoUninstaller - the visualstudio2017-installer package would actually install the Installer.

@heaths
Copy link

heaths commented Apr 21, 2017

We are updating documentation currently and it should be out soon. The update command actually updates an instance. The bootstrapper passes most command line arguments through to the installer, but some like --update are handled explicitly.

@jberezanski
Copy link
Owner Author

Great! Does it support updating the installer to a specific version, perhaps by providing a specific, local channel manifest file? I'd like to achieve fully repeatable and deterministic installs, if possible.

@heaths
Copy link

heaths commented Apr 24, 2017

It will update to the latest version across all channels.

@jberezanski
Copy link
Owner Author

Tested: --quiet --update works (--update --quiet did not - exit code 5005) - it installs the installer on the machine if it wasn't present before. However, it does not register with Programs and Features, so unfortunately it won't help with the AutoUninstaller problem (but it will help with update scenarios).

jberezanski added a commit that referenced this issue Jun 5, 2017
- skip VS 2017 product installation if the product is already installed
  (prevents upgrade, but also avoids problems with upgrade, such as
  broken VS Installer or installation still running after Chocolatey
  exits) (#7, #8)
- warn the user to disallow running the Chocolatey Auto Uninstaller (#6)
jberezanski added a commit that referenced this issue Jun 5, 2017
- skip VS 2017 product installation if the product is already installed
  (prevents upgrade, but also avoids problems with upgrade, such as
  broken VS Installer or installation still running after Chocolatey
  exits) (#7, #8)
- warn the user to disallow running the Chocolatey Auto Uninstaller (#6)
@jberezanski
Copy link
Owner Author

jberezanski commented Sep 2, 2017

chocolatey/choco#1257 (comment)

Adding a .skipAutoUninstall file will fix this.

@jberezanski
Copy link
Owner Author

@heaths I have been trying to update the VS Installer from an offline layout (prepared earlier using --layout). I have established, by trial and error, that the following example command line accomplishes this:

X:\Path\vs_FeedbackClient.exe --quiet --offline X:\Path\vs_installer.opc --update

Can you confirm this is the correct way? (I could not find this parameter documented anywhere.)

@heaths
Copy link

heaths commented Sep 8, 2017

Why are you trying to update the OPC from an offline layout? We specifically designed the Visual Studio Installer to be "evergreen" so we can fix any issues necessary blocking updates. In fact, some product updates will require newer installers. You shouldn't try to control the version of the installer yourself.

But yes, that is confirmed correct.

Also, the --update --quiet ordering issue is known.

@jberezanski
Copy link
Owner Author

jberezanski commented Oct 6, 2017

I need to do this on machines without Internet connectivity, because --quiet --update fails otherwise (it always tries to download the update from the net). And I would like the installer update to be a separate step from product update/installation, because I've seen cases where updating the installer as part of product update made the process unreliable (#7, #8).

@heaths
Copy link

heaths commented Oct 7, 2017

@MikeMarlowe, are these issues fixed in more recent builds? I thought they were.

@MikeMarlowe
Copy link

Yes, updating your layout will update the version of the Visual Studio Installer it contains.
When you update your instance of Visual Studio that was installed from this layout, the Visual Studio Install will be updated.

https://docs.microsoft.com/en-us/visualstudio/install/update-a-network-installation-of-visual-studio
has more details and shows examples of the commands to run

jberezanski added a commit that referenced this issue May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants