From 17312af761a3890d399834da4ea30586bce6ac04 Mon Sep 17 00:00:00 2001 From: benc Date: Wed, 4 May 2016 10:55:24 +0100 Subject: [PATCH] Add iis-media-services package --- README.md | 4 ++ iis-media-services/iis-media-services.nuspec | 29 +++++++++++ .../tools/chocolateyinstall.ps1 | 44 ++++++++++++++++ .../tools/chocolateyuninstall.ps1 | 50 +++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100755 iis-media-services/iis-media-services.nuspec create mode 100755 iis-media-services/tools/chocolateyinstall.ps1 create mode 100755 iis-media-services/tools/chocolateyuninstall.ps1 diff --git a/README.md b/README.md index 8e78cad..9764e1f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ To build: # Packages +Data sources from WebPI: + * https://www.microsoft.com/web/webpi/5.0/webproductlist.xml + * https://www.microsoft.com/web/webpi/5.0/mediaproductlist.xml + ## urlrewrite https://chocolatey.org/packages/UrlRewrite diff --git a/iis-media-services/iis-media-services.nuspec b/iis-media-services/iis-media-services.nuspec new file mode 100755 index 0000000..0901c57 --- /dev/null +++ b/iis-media-services/iis-media-services.nuspec @@ -0,0 +1,29 @@ + + + + + iis-media-services + IIS Media Services (Install) + 4.1.20160504 + Microsoft Inc. + Microsoft Inc. + Installs IIS Media Services + IIS Media Services, an integrated HTTP-based media delivery platform, delivers true HD (720p+) live and on-demand streaming, DVR functionality, and real-time analytics support to computers, TVs, and mobile devices. + + http://www.iis.net/media + https://github.com/bcc/choco-packages + microsoft iis mediaservices media services admin + Microsoft + http://www.microsoft.com/web/webpi/eula/IIS_Media_services_4.1_RTW_EULA.htm + true + http://www.microsoft.com/web/media/gallery/apps-screenshots/Microsoft-MediaServices2.png + + #### 4.1.20160504 + + * First packaging for chocolatey. + + + + + + diff --git a/iis-media-services/tools/chocolateyinstall.ps1 b/iis-media-services/tools/chocolateyinstall.ps1 new file mode 100755 index 0000000..1f8a6e3 --- /dev/null +++ b/iis-media-services/tools/chocolateyinstall.ps1 @@ -0,0 +1,44 @@ + +$ErrorActionPreference = 'Stop'; + + +$packageName= 'iis-media-services' +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$url = 'https://download.microsoft.com/download/9/E/A/9EA89305-2B2E-4379-8C1B-69FFFFD4D4FD/IISMedia32.msi' +$url64 = 'https://download.microsoft.com/download/1/7/5/175931F3-DCF8-4E8F-A62D-884C5ACF6D46/IISMedia64.msi' + +$packageArgs = @{ + packageName = $packageName + unzipLocation = $toolsDir + fileType = 'MSI' + url = $url + url64bit = $url64 + + silentArgs = "/qn /norestart /l*v `"$env:TEMP\chocolatey\$($packageName)\$($packageName).MsiInstall.log`"" + validExitCodes= @(0, 3010, 1641) + + softwareName = 'IIS Media Services 4.1' + checksum = '8f23129fc9c3d9d43e86d3ea9d2b3cd67053c592' + checksumType = 'sha1' + checksum64 = '4f9766e6b364af030e34b314fd3ec0c4bfc8f855' + checksumType64= 'sha1' +} + +Install-ChocolateyPackage @packageArgs + + + + + + + + + + + + + + + + + diff --git a/iis-media-services/tools/chocolateyuninstall.ps1 b/iis-media-services/tools/chocolateyuninstall.ps1 new file mode 100755 index 0000000..ada079d --- /dev/null +++ b/iis-media-services/tools/chocolateyuninstall.ps1 @@ -0,0 +1,50 @@ + + +$ErrorActionPreference = 'Stop'; + +$packageName = 'iis-media-services' +$softwareName = 'IIS Media Services 4.1' +$installerType = 'MSI' + +$silentArgs = '/qn /norestart' +$validExitCodes = @(0, 3010, 1605, 1614, 1641) +if ($installerType -ne 'MSI') { + $validExitCodes = @(0) +} + +$uninstalled = $false +$local_key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' +$machine_key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' +$machine_key6432 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' + +$key = Get-ItemProperty -Path @($machine_key6432,$machine_key, $local_key) ` + -ErrorAction SilentlyContinue ` + | ? { $_.DisplayName -like "$softwareName" } + +if ($key.Count -eq 1) { + $key | % { + $file = "$($_.UninstallString)" + + if ($installerType -eq 'MSI') { + $silentArgs = "$($_.PSChildName) $silentArgs" + + $file = '' + } + + Uninstall-ChocolateyPackage -PackageName $packageName ` + -FileType $installerType ` + -SilentArgs "$silentArgs" ` + -ValidExitCodes $validExitCodes ` + -File "$file" + } +} elseif ($key.Count -eq 0) { + Write-Warning "$packageName has already been uninstalled by other means." +} elseif ($key.Count -gt 1) { + Write-Warning "$key.Count matches found!" + Write-Warning "To prevent accidental data loss, no programs will be uninstalled." + Write-Warning "Please alert package maintainer the following keys were matched:" + $key | % {Write-Warning "- $_.DisplayName"} +} + + +