diff --git a/attributes/default.rb b/attributes/default.rb index 945e1d96..fcf06f5f 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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' diff --git a/libraries/sevenzip_command_builder.rb b/libraries/sevenzip_command_builder.rb index 48e62952..f1506c7c 100644 --- a/libraries/sevenzip_command_builder.rb +++ b/libraries/sevenzip_command_builder.rb @@ -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)