Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. if platform?("windows") && win_version.windows_server_2008_r2?
  2. windows_package "Internet Explorer 9" do
  3. source node[:internet_explorer]["IE9_URL"]
  4. installer_type :custom
  5. options '/passive /norestart'
  6. success_codes [0, 3010]
  7. action :install
  8. guard_interpreter :powershell_script
  9. only_if <<-EOH
  10. [System.Reflection.Assembly]::LoadWithPartialName("System.Version")
  11. $condition = New-Object System.Version("9.0.0.0")
  12. $currentVersion = New-Object System.Version((Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Internet Explorer').Version)
  13. $currentVersion -lt $condition
  14. EOH
  15. end
  16. else
  17. raise "The 'install_IE9' recipe is only compatible with Windows Server 2008 R2."
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement