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

Docker Quickstart and Installer assumes Git is installed in c:\Program Files #466

Open
gortok opened this issue Mar 30, 2016 · 20 comments
Open

Comments

@gortok
Copy link

gortok commented Mar 30, 2016

The Docker installer believes Git can only be installed to C:\Program Files. I have a fresh Windows 10 installation and installed Git for WIndows; and it's at C:\Program Files (x86).

I've made a fork to add those changes; but there are downstream consequences:

The Docker Quickstart Terminal run command assumes Git is installed at:

C:\Program Files\Git; (again, no x86); when it is not uncommon for Git to be installed in the (x86) folder.

It uses the {pf64} (function?constant?Argument?) to assume this:

https://github.com/gortok/toolbox/blob/patch-1/windows/Toolbox.iss#L81

I don't quite know enough to know how the {pf64} is generated to know exactly how to change that; but the bottom line is that git can be installed (by default) in multiple places; and the installer should take that into account.

I'd love to make these changes; but I just need someone to let me know how {pf64} is generated / where it comes from.

My way of fixing this would be to modify the "NeedToInstallGit" as I've done in my fork; and then add a function that would give the install path for Git, and use that instead of {pf64}.

@gortok
Copy link
Author

gortok commented Apr 10, 2016

So {pf64} is an artifact of the Inno Setup scripting engine. http://www.jrsoftware.org/ishelp/index.php?topic=consts

So I assume fixing the issue is adding a branch that says, "if you find Git installed in {pf32}, then use that as the basis for the rest of the paths; but if you find it in {pf64}, use that instead.

@jmorganca
Copy link
Contributor

Thanks for attending to this issue in the Toolbox - we really appreciate it.

make should build the artifacts (they'll end up in dist). Note you'll need Docker to build the Toolbox

@nathanleclaire may have a good suggestion on how to handle existing installations of Git bash - any ideas?

@AndreKR
Copy link

AndreKR commented May 21, 2016

@gortok The {pf64} is just a constant available in the Inno Setup script that on 64bit points to %ProgramFiles%, e.g. c:\Program Files\ and on 32bit must not be used.

In any case, in recent versions of Git there seems to be an official way to detect its installation path:
git-for-windows/build-extra@ed655294

@gortok
Copy link
Author

gortok commented Jun 3, 2016

I have made a branch that looks at and tries to resolve this specific issue. The commit is here:

gortok@2cfe8e4

I'm working on testing it.

@nschudlo
Copy link

I had this issue when installing Docker on Windows 8.

@Gnafu
Copy link

Gnafu commented Jan 19, 2017

Still an issue as today

@jcollum-cambia
Copy link

Still an issue.

The Docker Quickstart Terminal shortcut on Win 10 has this target:

"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"

However my git bash is in C:\Users\usernamehere\AppData\Local\Programs\Git\git-bash.exe

C:\Program Files\Git does not exist. Nor does C:\Program Files (x86)\Git.

So I changed the QST to use this" C:\Users\usernamehere\AppData\Local\Programs\Git\git-bash.exe --login -i "C:\Program Files\Docker Toolbox\start.sh" However when I run that, nothing happens, just a quick flash of a terminal and then it goes away. I assumed it exited with a non zero exit code.

Did this fail because I already had Git-Bash installed from the time I installed Git?

@tinghf
Copy link

tinghf commented Aug 25, 2017

I had the exact same problem as jcollum-cambia, does anyone know what's the workaround for that?

@IllyaMoskvin
Copy link

Related to #640, #343.

@Download
Copy link

Download commented Jan 9, 2018

My setup today also produced a situation where starting the Docker Quickstart Console would indicate it could not find bash.exe. Fixed manually by pointing it to the correct location. Maybe the console could check the path for bash.exe also? And a list of well-known locations?

@canadiancreed
Copy link

Still exists as of today

@lgallindo
Copy link

lgallindo commented Jun 21, 2018

Just happened here.

(Windows 7 64bit)

mplevako added a commit to mplevako/toolbox that referenced this issue Aug 15, 2018
Different Git packages use different installation paths, which, in
their turn may also be redefined by the user. Moreover, even if Git
is installed there is no guarantee that the Bash component is also
present. So there is little sense to depend on Git bash or to consider
it to be at any specific location.

Resolves: docker-archive#343, docker-archive#335, docker-archive#640, docker-archive#466, docker-archive#687, docker-archive#636.

Signed-off-by: Maxim Plevako <mplevako@gmail.com>
@examinedliving
Copy link

This is still happening. I even tried creating a symbolic link (windows style) with mklink /d to point from "C:\Program Files\git" to my git install location. I don't know exactly how it broke, but nothing really worked afterwards.

@examinedliving
Copy link

Anyone who stumbles on this - the only way I was able to solve this was to install the git that came bundled with the download and store it at C:\Program Files\Git. It wasn't a terrible fix, because I still used the git I had installed with those settings, but it's not ideal. It's like running a noop() function :).

@jiachen1120
Copy link

Open it by using bin\bash.exe instead of git-bash.exe

@vasukihn
Copy link

Open it by using bin\bash.exe instead of git-bash.exe

This worked for me

@harderitconsulting
Copy link

harderitconsulting commented Apr 15, 2019

Change the link to your GIT installation in your Docker Quickstart Terminal properties (right mouse click, props) as described above. It should look like this:
"C:<your git installation dir>\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"

@ghost
Copy link

ghost commented Aug 13, 2019

What do you mean "Open it by using bin\bash.exe instead of git-bash.exe" ? When launching a fresh install of Docker Toolbox's Docker Quick Start Terminal, it immediately tries to open a non-existent bash.exe. If it needs Bash.exe, why doesn't it install Bash.exe at install time?

@inviul
Copy link

inviul commented Nov 22, 2019

Change the link to your GIT installation in your Docker Quickstart Terminal properties (right mouse click, props) as described above. It should look like this:
"C:\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"

I followed this suggestion, but I am still facing the same issue. I have created an issue- #864

Please suggest

@maathieu maathieu mentioned this issue Dec 23, 2019
@liheweifrank
Copy link

jiachen1120's solution is the right way to go for those who had flash after clicking the docker quickstart

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

No branches or pull requests