jberezanski / ChocolateyPackages

Chocolatey packages maintained by me
MIT License
86 stars 52 forks source link

Evergreen LTSC installation and upgrade scenario #149

Open pglusmc opened 8 months ago

pglusmc commented 8 months ago

Hi @jberezanski, when specifying a channelID and channelURI for the Evergreen LTSC bootstrappers in the installation command line parameters, a new installation of the package works as expected. However, when attempting to upgrade from a prior version to a new version, there's an error stating "No previous catalog found at C:\Programdata\Microsoft\VisualStudio\Packages_Instances\\catalog.previous.json".
I understand now that the VS extensions were built to support only "current channel", so the result makes sense as it's assuming current channel during an upgrade scenario.

While I have a workaround to forcefully change the channel URI from LTSC to "current channel" of the existing instance before kicking off the package install to upgrade to the new LTSC channel, how heavy of a lift would it be to retrieve the channel in use by the existing instance and upgrade it?

I am pursuing potentially modifying the VS extensions for my own scenario, but I'm concerned about a ripple effect for your whole design. Alternatively, I could just do an uninstall and reinstall.

jberezanski commented 4 months ago

there's an error stating "No previous catalog found at C:\Programdata\Microsoft\VisualStudio\Packages_Instances\catalog.previous.json".

This seems to be a problem inside the Visual Studio Installer itself. The choco extension does not touch that path.

In my personal tests, I encountered several problems and inconsistent behavior when attempting to upgrade an existing VS instance across different channels, even when using the VS Installer interactively, without any automation. In the end, I decided it was unreliable and not worth the effort. I recommend using separate installation paths for different channels (or uninstalling the old instance and installing from a new channel, if keeping a specific path is important).

As for the packages, my vision was for each package to be configured for a specific channel. This provides the option of creating separate packages for different channels and installing and updating them independently. The packages I publish on community.chocolatey.org are configured for the Current channel, but setting a different one is as easy as passing an additional parameter in chocolateyInstall.ps1. In fact, there are some proof-of-concept packages for other channels in this repository, such as visualstudio2022buildtools-ltsc17.2 (LTSC 17.2, evergreen) or visualstudio2022buildtools-ltsc17.2_fixed/17.2.12 (LTSC 17.2, installs specifically 17.2.12). However, I do not have plans at the moment to publish LTSC packages on community.chocolatey.org due to the effort needed to automate their updates and maintain them.

Alternatively, I could just do an uninstall and reinstall.

I think this might be the most reliable approach.