Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Fixes Git detection on 64-bit Windows machines with 32-bit Git installed #324

Closed
wants to merge 1 commit into from

Conversation

ammachado
Copy link

Git 32-bit is installed on C:\Program Files (x86)\Git instead of C:\Program Files\Git. Should shed some light on issues #226, #246, #295, #276 and #310.

@nerro
Copy link
Contributor

nerro commented Nov 26, 2015

+1

P.S. Is it possible to detect in which directory Git installed? If user changes default installation directory, e.g. D:\ProgramFiles\Git?

@jmorganca
Copy link
Contributor

Thanks for the PR, and sorry for the delay in getting back. This could help solve multiple issues with the Toolbox relating to Git.

Taking a look -

Result := not DirExists('C:\Program Files\Git') or not FileExists('C:\Program Files\Git\git-bash.exe')
GitRegKey := 'GitForWindows';

if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Wow6432Node\' + GitRegKey, 'InstallPath', GitInstallPath) and FileExists(GitInstallPath + '\git-bash.exe') then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Any way this function could return the git path (and optionally Null)? This could be used to detect where to point the Docker Quickstart Terminal to

@jmorganca
Copy link
Contributor

Just a small comment - this is huge! Thank you! Big sorry for the late follow up

@ammachado
Copy link
Author

Glad I could help.

@jmorganca
Copy link
Contributor

Thanks again! Could you squash & sign your commits before merging?

$ git rebase -i <master or hash before your first commit> # mark one commit as squash here
$ git commit --amend -s --no-edit 
$ git push -f

Signed-off-by: Adriano Marcondes Machado <adriano.m.machado@hotmail.com>
@ammachado
Copy link
Author

Done.

@jmorganca jmorganca force-pushed the master branch 2 times, most recently from 9cb5363 to 9927093 Compare January 16, 2016 23:26
@27Bslash6
Copy link

It seems hard-coding the git install path isn't going to work, there will need to be a way to find the git shell.

Today I reinstalled DockerToolbox-1.9.1i.exe and it uninstalled git, then reinstalled Git 2.5.0 with the Git Bash path being C:\Users\<username>\AppData\Local\Programs\Git\git-bash.exe --cd-to-home. Nothing was installed to \Program Files\Git or \Program Files (x86)\Git, which of course causes the Quick Start Terminal to hang searching for a bash shell again.

@bvierra
Copy link

bvierra commented Feb 8, 2016

Hello all,

I also noticed an issue (I have git installed in a non-standard location) and told the installer not to install git. The "Docker Quickstart Terminal" assumed it was located in c:\Program Files\Git\ (I believe) which would have been the standard location.

I would suggest checking the registry HKLM\SOFTWARE\GitForWindows\InstallPath first and if that does not work run "where.exe git.exe" checking that directory for bash.exe (to clear out the edge cases where someone has a setup with a git.exe in path but does not have the bash.exe file there as well). If all of that fails I would just prompt the user to locate it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants