| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/ProgramData/chocolatey/lib/vcredist140/tools/ |
Upload File : |
Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'
. (Join-Path -Path (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) -ChildPath 'data.ps1')
$packageName = $otherData.PackageName
$installerType = 'exe'
$silentArgs = '/uninstall /quiet'
$validExitCodes = @(0, 3010) # http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
Set-StrictMode -Off
[array] $uninstallKeys = Get-UninstallRegistryKey @uninstallData
Set-StrictMode -Version 2
[array] $filteredUninstallKeys = $uninstallKeys | Where-Object { $_ -ne $null -and ($_.PSObject.Properties['SystemComponent'] -eq $null -or $_.SystemComponent -eq 0) }
foreach ($uninstallKey in $filteredUninstallKeys)
{
if ($uninstallKey -eq $null)
{
# this might happen on PS 2.0
continue
}
if ($uninstallKey.PSObject.Properties['UninstallString'] -ne $null)
{
$uninstallString = $uninstallKey.UninstallString
Write-Verbose "Found uninstall key, UninstallString = $uninstallString"
if ($uninstallString -match '^"?(.*?)(".*)?$')
{
$uninstallerPath = $matches[1]
Set-StrictMode -Off
Uninstall-ChocolateyPackage -PackageName $packageName `
-FileType $installerType `
-SilentArgs $silentArgs `
-File $uninstallerPath `
-ValidExitCodes $validExitCodes
Set-StrictMode -Version 2
}
else
{
Write-Warning "The uninstall information in the registry is in an unknown format. Please report this to package maintainers. Data from the registry: [$uninstallString]"
}
}
else
{
Write-Warning "The uninstall information in the registry does not contain the path to the uninstaller application. Please report this to package maintainers. Registry key path: [$($uninstallKey.PSPath)]"
}
}