Add iis-media-services package

This commit is contained in:
benc 2016-05-04 10:55:24 +01:00
parent 295b39e488
commit 17312af761
4 changed files with 127 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesnt appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>iis-media-services</id>
<title>IIS Media Services (Install)</title>
<version>4.1.20160504</version>
<authors>Microsoft Inc.</authors>
<owners>Microsoft Inc.</owners>
<summary>Installs IIS Media Services</summary>
<description>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.
</description>
<projectUrl>http://www.iis.net/media</projectUrl>
<packageSourceUrl>https://github.com/bcc/choco-packages</packageSourceUrl>
<tags>microsoft iis mediaservices media services admin</tags>
<copyright>Microsoft</copyright>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/IIS_Media_services_4.1_RTW_EULA.htm</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<iconUrl>http://www.microsoft.com/web/media/gallery/apps-screenshots/Microsoft-MediaServices2.png</iconUrl>
<releaseNotes>
#### 4.1.20160504
* First packaging for chocolatey.
</releaseNotes>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>

View file

@ -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

View file

@ -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"}
}