Skip to content

Commit

Permalink
Fix sous-chefs#157 Ark fails to compile on Windows if 7zip is not alr…
Browse files Browse the repository at this point in the history
…eady installed
  • Loading branch information
sgtcoolguy committed Nov 15, 2016
1 parent 676a8e1 commit a08abf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
default['ark']['tar'] = case node['platform_family']
when 'windows'
"\"#{::Win32::Registry::HKEY_LOCAL_MACHINE.open(
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe', ::Win32::Registry::KEY_READ).read_s('Path')}\\7z.exe\""
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe', ::Win32::Registry::KEY_READ).read_s('Path')}\\7z.exe\"" rescue nil
when 'mac_os_x', 'freebsd'
'/usr/bin/tar'
when 'smartos'
Expand Down
3 changes: 2 additions & 1 deletion libraries/sevenzip_command_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def sevenzip_command
end

def sevenzip_binary
resource.run_context.node['ark']['tar']
resource.run_context.node['ark']['tar'] ||= "\"#{::Win32::Registry::HKEY_LOCAL_MACHINE.open(
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe', ::Win32::Registry::KEY_READ).read_s('Path')}\\7z.exe\"" rescue '7z.exe'
end

def sevenzip_command_builder(dir, command)
Expand Down

0 comments on commit a08abf9

Please sign in to comment.