GithubHelp home page GithubHelp logo

Comments (6)

iennae avatar iennae commented on May 8, 2024

This is intentionally being done by the provider right now:

      # Git is installed to Program Files (x86) on 64-bit machines and
      # 'Program Files' on 32-bit machines
      PROGRAM_FILES = ENV['ProgramFiles(x86)'] || ENV['ProgramFiles']
      GIT_PATH = "#{PROGRAM_FILES}\\Git\\Cmd".freeze

What should the path be?

Thanks for helping us debug this!

from git.

joshburt avatar joshburt commented on May 8, 2024

There is no single default location. This is determined by the git installer (and the bitness of the package).

If a 32-bit version is installed it’s placed in C:\Program Files (x86)\Git
If a 64-bit version is installed it’s placed in C:\Program Files\Git

Since there is not an easy way to determine the install location (that I’m aware of) under this scenario I have been brain storming and have some suggestions to bounce off you:

  • Registry Based

Parse it out of the registry post install. It looks like this might be a possible place to extract it from:

Registry key: HKEY_CLASSES_ROOT\Directory\background\shell\git_shell\command
Value when 32-bit: "C:\Program Files (x86)\Git\git-bash.exe" "--cd=%v."
Value when 64-bit: "C:\Program Files\Git\git-bash.exe" "--cd=%v."

There could possibly be other registry keys that will work as well. Using a tool like Process Monitor https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx during install could provide a list.

  • Filename Based: Parse the installer executable filename and attempt to determine the bitness
  • Attribute Driven: Create an attribute ‘flag’ that designates bitness and enforces this artificially

With the advent of Windows Core & Nano and the effort to create 64-bit builds of the Chef client we ultimately need to have 64-bit support of the tools we use along-side Chef as well.

Thanks!

from git.

smurawski avatar smurawski commented on May 8, 2024

Here are the challenges.. MSI's don't always broadcast changes to path (when reboots are pending on the box for example). Also, not every top level program listens for changes to the path, which is why if we want to find git later in the course of the chef client run, we need to update the path as ruby sees it, so any ruby code or child shell outs will get it.

If the cookbook is picking the installer, it can know which path to put things on more easily. However, it shouldn't be too hard to figure out.. we could test program files x86 and program files and see where the git.exe landed, then put that on the path. I can work up a PR early next week most likely.

from git.

iennae avatar iennae commented on May 8, 2024

@smurawski any progress on this? :) Thanks!

from git.

smurawski avatar smurawski commented on May 8, 2024

@iennae @joshburt I just submitted a PR to add support for installing the 64 bit git client and finding the right path.

from git.

iennae avatar iennae commented on May 8, 2024

@joshburt Please check out cookbook version 4.4.1. Reopen if this doesn't solve the problem. Again thank you for submitting the original issue and sharing the underlying problems to improve my context with the issue. We really appreciate your help in making community cookbooks awesome!

from git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.