Skip to content

Commit

Permalink
support 32 bit and 64 bit installs on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
smurawski committed Mar 31, 2016
1 parent d643a2d commit d457394
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@
case node['platform_family']
when 'windows'
default['git']['version'] = '2.7.4'
default['git']['architecture'] = '32'
if node['kernel']['machine'] == 'x86_64'
default['git']['architecture'] = '64'
default['git']['checksum'] = '1290afb22f2441ce85f8f6f1a94c06768ca470dc18113a83ef6a4cefc16c2381'
else
default['git']['architecture'] = '32'
default['git']['checksum'] = '49601d5102df249d6f866ecfa1eea68eb5672acc1dbb7e4051099e792f6da5fc'
end
default['git']['url'] = 'https://github.com/git-for-windows/git/releases/download/v%{version}.windows.1/Git-%{version}-%{architecture}-bit.exe'
default['git']['checksum'] = '49601d5102df249d6f866ecfa1eea68eb5672acc1dbb7e4051099e792f6da5fc'
default['git']['display_name'] = "Git version #{node['git']['version']}"
when 'mac_os_x'
default['git']['osx_dmg']['app_name'] = 'git-2.7.1-intel-universal-mavericks'
Expand Down
6 changes: 5 additions & 1 deletion libraries/provider_git_client_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ class Windows < Chef::Provider::GitClient

# 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']
PROGRAM_FILES = if node['git']['architecture'] == '32'
ENV['ProgramFiles(x86)'] || ENV['ProgramFiles']
else
ENV['ProgramW6432'] || ENV['ProgramFiles']
end
GIT_PATH = "#{PROGRAM_FILES}\\Git\\Cmd".freeze

# COOK-3482 - windows_path resource doesn't change the current process
Expand Down

0 comments on commit d457394

Please sign in to comment.