-
Notifications
You must be signed in to change notification settings - Fork 52
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
visualstudio2022buildtools Fails to Install - Version Mismatch? #134
Comments
This check should only be relevant in an upgrade scenario (if you already have an older VS 2022 Build Tools version installed and the package upgrades it to the latest).
(which, according to VS release history, is "display version" 17.3.2) The package always installs the latest published VS version and expects that the version detected on the machine after the setup process completes matches the version specified in the manifest file. If the version on the machine is lower, the package assumes the upgrade process has failed for some reason even though the VS install process did not return an error code (I have seen it happen in various cases, in particular with older versions of the VS Installer; it was caused by the VS Installer failing to download the current manifest file and thinking no update was needed). Now, there is a complication, regarding very minor VS updates. But first, please confirm: did you actually have Build Tools installed on the system before invoking that |
I might as well describe the complication already: This, in fact, seems to be what has happened recently in VS 2022. Version 17.3.1 exibits the same behavior:
Fortunately, 17.3.2 (released yesterday) behaves reasonably and does update the Build Tools. So you should no longer encounter the problem. |
Thanks a lot for the response! I'm building a docker image, but I'm actually not a 100% sure what the base image is already shipping with. But if the base image already ships with the build tools, then your explanation can totally make sense. Wonder if there's a workaround for this issue though, as it kind of breaks the installation process. Just test the installation process again and this time it succeeded, as such it's even more of an indication that it was caused by the "complication". 😄 Unfortunately I don't have the log, as I've removed the "failed" docker image build. From my point of view the issue can be closed, unless you want to keep it open to discuss potential solutions for the "complication". |
Are you using a publicly available base image? If yes, can you share the link? As for inspecting the existing state, there are two easy ways:
The way the VS choco packages currently work is they always install (or upgrade to) the latest VS version published by MS (regardless of package version: you can run There is, however, a way to reliably install a specific VS version. The scripts used internally in the packages support it already; I've been thinking about publishing such "deterministic" packages, but never had the time and sufficient motivation. But you can do this:
(the choco package version is set in this command only as a way of improving the repeatability of the image build; it does not affect the VS version being installed - the specific bootstrapper does that)
By the way, the
Yes, I'll keep it open as a reminder. Previously, when I had seen the problem only in VS 2017, I didn't really feel the need to act upon it, but now that it has appeared in 2022 it might become a nuisance and require some action. |
I'm having this problem right now again when upgrading from 17.8.0.0 to 17.8.1.0. Is there any kind of logic to what kind of build tools version increment will actually cause the component to receive an update? If so would it be possible to have the version match check be a little more lenient so that upgrades wont just error out when the succeed with Microsoft's expected behavior? |
Unfortunately, I haven't been able to find any reliable source of that information, short of actually attempting the upgrade on a test machine and seeing what happens (and doing that for each new version is out of the question due to the workload and costs involved). Perhaps this is somehow buried in the channel manifest (https://aka.ms/vs/17/release/channel), or the component manifest referenced by it, but so far nothing stood out for me. This whole problem seems to me like a bug/design flaw of the Visual Studio Installer, because if Build Tools is installed on a clean machine, it will have the correct (latest) version number. Only the upgrade process fails to update the version. Now, approaching from another angle: the whole intent of the version check in the package scripts was to detect cases when the upgrade process failed. This is important when other packages depend on a minimum version of Visual Studio (such as some workload packages). However, I think it would be okay to change the version check to accomodate both needs: raise an error when the minor version (second part) is lower than expected, but tolerate a difference in the patch version (third part) and just log a warning. |
Thanks a lot for maintaining this package!
When I run the following install command it fails to install with the following error:
I don't fully understand where the "desired version" comes from and why it's apparently higher than the actually installed version.
Is there a workaround for this?
The text was updated successfully, but these errors were encountered: