Skip to content

Conversation

@dscho
Copy link
Contributor

@dscho dscho commented Jan 27, 2023

This fixes #5231.

@dscho dscho requested a review from a team as a code owner January 27, 2023 11:42
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 <[email protected]>
@dscho dscho force-pushed the handle-32-bit-windows-gracefully branch from c42ba21 to 0a0311d Compare January 27, 2023 13:16
@bk2204 bk2204 merged commit b4cf181 into git-lfs:main Jan 27, 2023
@dscho dscho deleted the handle-32-bit-windows-gracefully branch January 28, 2023 18:34
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

Successfully merging this pull request may close these issues.

Git LFS 3.2.0 and 3.3.0 not installing on 32bit OS

2 participants