installer: let it work on 32-bit Windows again#5266
Merged
bk2204 merged 1 commit intogit-lfs:mainfrom Jan 27, 2023
Merged
Conversation
As reported in git-lfs#5231, there was a regression in running the Git LFS installer on 32-bit Windows. Concretely, it throws a Runtime error: Internal error: Cannot expand `commonp64` constant on this version of Windows. The reason is that we introduced code in 865d6ee (installer: handle `BashOnly` Git for Windows gracefully, 2022-06-16) that unconditionally expands `commonpf64`. However, the documentation at https://jrsoftware.org/ishelp/topic_consts.htm is very clear: {commonpf64} 64-bit Windows only: 64-bit Program Files. The path of the system's 64-bit Program Files directory, typically "C:\Program Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows. The idea is to figure out whether a given path starts with either the 32-bit or the 64-bit version of `Program Files`. But if the latter is not even available, we cannot search for it. Let's just re-use the value of the `commonpf32` constant. (Using an empty value for `PFiles64` would not work, as that variable is used to match a certain prefix, and the empty string would match, but we don't want that.) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
c42ba21 to
0a0311d
Compare
bk2204
approved these changes
Jan 27, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #5231.