Skip to content

Commit

Permalink
Fixed searching for GIT.exe in "Program Files" even on x64 systems
Browse files Browse the repository at this point in the history
Supposedly %ProgramFiles% should evaluate to "C:\Program Files (x86)" when used from a 32-bit process on a 64-bit OS. This does not seem to work so added workaround to manually detect OS word length and select the right program files folder using either %ProgramFiles% or %ProgramFiles(x86)%
  • Loading branch information
arion-p committed Oct 21, 2011
1 parent ed4d7df commit 4f31570
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -45,7 +45,9 @@ public class VersionGIT

private Process RunGitCommand(string arguments)
{
FileInfo file = new FileInfo(Environment.GetEnvironmentVariable("ProgramFiles") + @"\Git\bin\git.exe");
string programFiles = Environment.GetEnvironmentVariable("ProgramFiles(x86)")?? Environment.GetEnvironmentVariable("ProgramFiles");

FileInfo file = new FileInfo(programFiles + @"\Git\bin\git.exe");

ProcessStartInfo procInfo = new ProcessStartInfo();
procInfo.RedirectStandardOutput = true;
Expand Down
Binary file not shown.

0 comments on commit 4f31570

Please sign in to comment.