install-webplatform.ps1 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. Function Install-WebPlatform() {
  2. #includes
  3. . .\resources\get-file.ps1
  4. . .\resources\get-cpu.ps1
  5. #send message
  6. if (Get-Installed-App "*Web Platform*") {
  7. Write-Host "Web Platform Installer is already installed"
  8. }
  9. #download and install the web platform installer
  10. if (-not (Test-Path "${env:ProgramFiles}\Microsoft\Web Platform Installer\WebPlatformInstaller.exe")) {
  11. $url = "http://download.microsoft.com/download/F/4/2/F42AB12D-C935-4E65-9D98-4E56F9ACBC8E/wpilauncher.exe"
  12. $filename = Get-File $url
  13. Start-Process $filename
  14. Start-Sleep -s 25
  15. }
  16. else {
  17. #Start-Process "C:\Program Files\Microsoft\Web Platform Installer\WebPlatformInstaller.exe /silent" -Wait
  18. }
  19. Get-Process WebPlatformInstaller | ? { $_.CloseMainWindow() | Out-Null }
  20. # list available applications - All, Available
  21. # WebpiCmd-x64.exe /list /listoption:Available
  22. # install PHP 7.1 on IIS
  23. if (-not (Test-Path "${env:ProgramFiles}\PHP\v7.1\php.exe")) {
  24. $cpu = Get-CPU
  25. if ($cpu -eq "x86") {
  26. ."C:\Program Files\Microsoft\Web Platform Installer\WebpiCmd-x64.exe" "/install" "/Products:PHP71" "/AcceptEula"
  27. }
  28. else {
  29. ."C:\Program Files\Microsoft\Web Platform Installer\WebpiCmd-x64.exe" "/install" "/Products:PHP71x64" "/AcceptEula"
  30. }
  31. }
  32. }
  33. #Install-WebPlatform