Skip to content

Commit

Permalink
https://github.com/dtgm/chocolatey-packages/issues/11
Browse files Browse the repository at this point in the history
  • Loading branch information
dtgm committed Mar 4, 2015
1 parent 05465c8 commit 5f6b436
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 39 deletions.
2 changes: 1 addition & 1 deletion automatic/bitmessage/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ try {
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
Get-ChocolateyWebFile -PackageName "$packageName" -FileFullPath "$installFile" -Url "$url" -Checksum "$checksum" -ChecksumType "$checksumType"
Set-Content -Path ("$installFile.gui") -Value $nul
Set-Content -Path ("$installFile.gui") -Value $null
} catch {
throw $_.Exception
}
18 changes: 18 additions & 0 deletions automatic/dupeguru-me/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$packageName = '{{PackageName}}'
$packageSearch = 'dupeguru m'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageSearch*" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}
18 changes: 18 additions & 0 deletions automatic/dupeguru-pe/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$packageName = '{{PackageName}}'
$packageSearch = 'dupeguru p'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageSearch*" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}
18 changes: 13 additions & 5 deletions automatic/dupeguru/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
$packageName = '{{PackageName}}'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
$packageName = '{{PackageName}}'
$packageSearch = $packageName + "*"
$packageVersion = '{{PackageVersion}}'
$uninstallPackage = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like $packageSearch -and ($_.Version -eq $packageVersion) }
$uninstallResults = $uninstallPackage.Uninstall()
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageName" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}
17 changes: 17 additions & 0 deletions automatic/fv/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$packageName = '{{PackageName}}'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageName" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}
19 changes: 13 additions & 6 deletions automatic/openproj/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
$packageName = '{{PackageName}}'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
$packageName = '{{PackageName}}'
$app = Get-WmiObject -class win32_product | Where-Object {$_.Name -like "$packageName"}
if ($app) {
$msiArgs = $('/x' + $app.IdentifyingNumber + ' /quiet /qn /norestart')
Start-ChocolateyProcessAsAdmin $msiArgs 'msiexec'
}
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageName" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}
22 changes: 14 additions & 8 deletions automatic/pan/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
$packageName = '{{PackageName}}'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
$packageName = '{{PackageName}}'
$app = Get-WmiObject -class win32_product | Where-Object {$_.Name -like "$packageName"}
if ($app) {
$msiArgs = $('/x' + $app.IdentifyingNumber + ' /quiet /qn /norestart')
Start-ChocolateyProcessAsAdmin $msiArgs 'msiexec'
}
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageName" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}

}
19 changes: 13 additions & 6 deletions automatic/pdfedit/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
$packageName = '{{PackageName}}'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
$packageName = '{{PackageName}}'
$app = Get-WmiObject -class win32_product | Where-Object {$_.Name -like "$packageName"}
if ($app) {
$msiArgs = $('/x' + $app.IdentifyingNumber + ' /quiet /qn /norestart')
Start-ChocolateyProcessAsAdmin $msiArgs 'msiexec'
}
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageName" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}
19 changes: 13 additions & 6 deletions automatic/projectlibre/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
$packageName = '{{PackageName}}'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
$packageName = '{{PackageName}}'
$app = Get-WmiObject -class win32_product | Where-Object {$_.Name -like "$packageName"}
if ($app) {
$msiArgs = $('/x' + $app.IdentifyingNumber + ' /quiet /qn /norestart')
Start-ChocolateyProcessAsAdmin $msiArgs 'msiexec'
}
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageName" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}
20 changes: 13 additions & 7 deletions automatic/zimbra-desktop/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
$packageName = '{{PackageName}}'
$fileType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0)
try {
$packageName = '{{PackageName}}'
$packageSearch = 'Zimbra Desktop'
$app = Get-WmiObject -class win32_product | Where-Object {$_.Name -like "$packageSearch"}
if ($app) {
$msiArgs = $('/x' + $app.IdentifyingNumber + ' /quiet /qn /norestart')
Start-ChocolateyProcessAsAdmin $msiArgs 'msiexec'
}
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like "$packageName" } `
| ForEach-Object { Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$fileType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes }
} catch {
throw $_.Exception
}

0 comments on commit 5f6b436

Please sign in to comment.