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

installer: fix the scalar reconfigure --all invocation #569

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

dscho
Copy link
Member

@dscho dscho commented Jul 13, 2024

When running the installer of microsoft/git v2.45.2.vfs.0.2, it is possible to run into this error:

Line 3401: Could not reconfigure Scalar enlistment.

The most likely reason is a recent change in InnoSetup (and therefore affects both microsoft/git and regular Git for Windows), concretely: this one.

Essentially, when creating a safe directory, InnoSetup now protects it via reduced permissions (e.g. allowing the original user who started the installer only to read, but not write into the directory) if it is in a temporary directory on a local drive.

This is affects e.g. the ExecSilentlyAsOriginalUser() function which wants to write stdout and stderr into two files in the temporary directory that is created by InnoSetup.

Earlier, this was possible because the safe directory still allowed the original user to write into it, but now that is no longer the case.

As a work-around, let's write those two files directly into the %TEMP% directory of the original user (where the account has write permissions). To do that, we use the fact that {tmp} refers to a subdirectory, and by appending some unique suffix we can construct a path to such a file.

This fixes git-for-windows/git#5038.

When running the installer of `microsoft/git` v2.45.2.vfs.0.2, it is
possible to run into this error:

	Line 3401: Could not reconfigure Scalar enlistment.

The most likely reason is a recent change in InnoSetup (and therefore
affects both `microsoft/git` and regular Git for Windows), concretely:
jrsoftware/issrc@ba9bded#diff-ba50e25972bfa9da0e0159b1fae6c5921f46440eebc624cb9401093c1bc32804R181

Essentially, when creating a safe directory, InnoSetup now protects it
via reduced permissions (e.g. allowing the original user who started the
installer only to read, but not write into the directory) if it is in a
temporary directory on a local drive.

This is affects e.g. the `ExecSilentlyAsOriginalUser()` function which
wants to write `stdout` and `stderr` into two files in the temporary
directory that is created by InnoSetup.

Earlier, this was possible because the safe directory still allowed the
original user to write into it, but now that is no longer the case.

As a work-around, let's write those two files directly into the `%TEMP%`
directory of the original user (where the account has write
permissions). To do that, we use the fact that `{tmp}` refers to a
subdirectory, and by appending some unique suffix we can construct a
path to such a file.

This fixes git-for-windows/git#5038.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Jul 13, 2024
@dscho dscho merged commit a469d4f into git-for-windows:main Jul 15, 2024
6 checks passed
@dscho dscho deleted the fix-installer-scalar-reconfigure branch July 15, 2024 06:01
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.

Error: Scalar Reconfiguration
1 participant