1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Dir.foreach("C:\\Users\\") do |f|
mypath = String.try_convert("C:\\Users\\#{f}\\NTUSER.DAT")
if File.file?(mypath)
batch "run_install #{params[:name]}" do
code <<-EOH
verify >nul
REG LOAD "HKU\\#{f}" "#{mypath}"
IF errorlevel EQU 0
REG ADD "HKU\\#{f}\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" /v ProxyServer /t REG_SZ /d #{node['proxy']['http']} /f
REG ADD "HKU\\#{f}\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
REG ADD "HKU\\#{f}\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" /v ProxyOverride /t REG_SZ /d #{node['proxy']['excludes']} /f
REG UNLOAD "HKU\\#{f}"
END
EOH
returns [0,1]
end
else
puts mypath + "IS NOT A VALID FILE"
end
end |