[msysgit] how to detect git.exe directory?

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

[msysgit] how to detect git.exe directory?

From: Marco Costalba <hidden>
Date: 2016-06-15 22:44:01

Hi all,

   I'm progressing on qgit installer for windows, I have switched to
MSVC for compiling Qt4 and qgit sources and I have to say that first
results are very good, qgit.exe now seems to work without problems or
artifacts and the speed is much more similar to what we achieve under
the Linux platform (read much higher).

So it seems Qt+mingw is not the _best_ possible solution.

Anyhow, under Vista you cannot simply copy qgit.exe in the git
directory (OS barfs regarding some administrative rights, note that *I
am* the administartor!), so to make qgit.exe work git.exe file must be
in PATH.

To easy the user and allowing to call qgit.exe double clicking on a
nice desktop icon I need a way to know where git.exe is installed *at
runtime*.

So my question is: "What is the preferred way to detect git directory
at runtime for msysgit files?"

- environment variable ??

- windows registry ??

- others ?


I don't plan to use the cygwin version of git but going directly to
the "long term" solution that is msysgit.

Thanks for your help
Marco

Re: [msysgit] how to detect git.exe directory?

From: Abdelrazak Younes <hidden>
Date: 2016-06-15 22:44:01

Marco Costalba wrote:
Hi all,

   I'm progressing on qgit installer for windows, I have switched to
MSVC for compiling Qt4 and qgit sources and I have to say that first
results are very good, qgit.exe now seems to work without problems or
artifacts and the speed is much more similar to what we achieve under
the Linux platform (read much higher).
Glad you manage to do it by yourself. Sorry for not going further with 
compilation as I promised but the git repository had only a MSVC2008 
solution file and I have only MSVC2005 here. I tried to adapt our CMake 
files to qgit but failed...
So it seems Qt+mingw is not the _best_ possible solution.
I told you that ;-)
Anyhow, under Vista you cannot simply copy qgit.exe in the git
directory (OS barfs regarding some administrative rights, note that *I
am* the administartor!), so to make qgit.exe work git.exe file must be
in PATH.

To easy the user and allowing to call qgit.exe double clicking on a
nice desktop icon I need a way to know where git.exe is installed *at
runtime*.

So my question is: "What is the preferred way to detect git directory
at runtime for msysgit files?"
If you use QProcess to launch git, maybe you could just use 
QProcess::workingDirectory()?

Abdel.

Re: [msysgit] how to detect git.exe directory?

From: Marco Costalba <hidden>
Date: 2016-06-15 22:44:01

On Dec 23, 2007 8:45 PM, Abdelrazak Younes [off-list ref] wrote:
Marco Costalba wrote:
quoted
Hi all,
Glad you manage to do it by yourself. Sorry for not going further with
compilation as I promised but the git repository had only a MSVC2008
solution file and I have only MSVC2005 here. I tried to adapt our CMake
files to qgit but failed...
Don't worry, I have installed MSVC2008, compiled Qt4 (and everithing
went smooth) and bruefly tested qgit: it really seems to work, now
following steps are:

- Detect git.exe directory at runtime also when is not in PATH (see below)

- Manage to package qgit and others needed files in a windows
installer (I know very little about this)
quoted
So my question is: "What is the preferred way to detect git directory
at runtime for msysgit files?"
If you use QProcess to launch git, maybe you could just use
QProcess::workingDirectory()?
It's not the repository that I don't find, but the git binary
directory. I explain better. If I open a console under windows with
cmd.exe and type "git" when I hit enter button I have an error message
that says that "command git is not known"

This is because git.exe directory is _not_ (normally) in PATH
environment variable.

So, or msysgit installation *modifies* the user PATH adding the bin
directory, or I have to found git bin directory myself and manage to
add to the PATH of qgit process environment.

The question is: "How I find git.exe??"

Marco
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help