1 $ErrorActionPreference = "Stop" 2 3 if (Test-Path "$PSScriptRoot\win-installer-helper.psm1") 4 { 5 Import-Module "$PSScriptRoot\win-installer-helper.psm1" 6 } 7 elseif (Test-Path "C:\win-installer-helper.psm1") 8 { 9 Import-Module "C:\win-installer-helper.psm1" 10 } 11 12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 13 14 Start-Setup 15 16 try { 17 18 19 Get-File -Url "http://www.jrsoftware.org/download.php/is.exe" -fileName "innosetup-6.0.3.exe" 20 Install-FromExe -Path "C:\Downloads\innosetup-6.0.3.exe" -Arguments "/VERYSILENT /SUPPRESSMSGBOXES" 21 } 22 catch 23 { 24 $_.Exception | Format-List 25 exit -1 26 } 27 finally 28 { 29 Stop-Setup 30 } 31