Selaa lähdekoodia

Remote chocolateyuninstall.ps1

This was warning the user that both versions were installed, and that therefore
it wasn't going to do anything, right before the auto-uninstaller kicked in
and uninstalled one of the versions anyway. We're better off just letting
the auto-uninstaller do its thing, and not getting involved
Antony Male 4 vuotta sitten
vanhempi
sitoutus
e7b46d431c
1 muutettua tiedostoa jossa 0 lisäystä ja 34 poistoa
  1. 0 34
      chocolatey/tools/chocolateyuninstall.ps1

+ 0 - 34
chocolatey/tools/chocolateyuninstall.ps1

@@ -1,34 +0,0 @@
-$ErrorActionPreference = 'Stop'; # stop on all errors
-
-$packageName = 'SyncTrayzor'
-$softwareName = 'SyncTrayzor*' #part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique
-$installerType = 'exe' 
-$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
-$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\*'
-
-[array]$key = Get-ItemProperty -Path @($machine_key6432,$machine_key, $local_key) `
-                        -ErrorAction SilentlyContinue `
-         | ? { $_.DisplayName -like "$softwareName" }
-
-if ($key.Count -eq 1) {
-  $key | % { 
-    $file = "$($_.UninstallString)"
-    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"}
-}