Add iis-media-services package
This commit is contained in:
parent
295b39e488
commit
17312af761
4 changed files with 127 additions and 0 deletions
44
iis-media-services/tools/chocolateyinstall.ps1
Executable file
44
iis-media-services/tools/chocolateyinstall.ps1
Executable 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
50
iis-media-services/tools/chocolateyuninstall.ps1
Executable file
50
iis-media-services/tools/chocolateyuninstall.ps1
Executable 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"}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue