OpenBoard Package initial
This commit is contained in:
34
packages/openboard/tools/chocolateyuninstall.ps1
Executable file
34
packages/openboard/tools/chocolateyuninstall.ps1
Executable file
@@ -0,0 +1,34 @@
|
||||
#OpenBoard uninstaller
|
||||
|
||||
$packageName = 'openboard'
|
||||
$packageSearch = 'OpenBoard'
|
||||
|
||||
$r = 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" }
|
||||
|
||||
$r | ForEach-Object {
|
||||
$exe = $_.UninstallString | Select-String -Pattern ".*exe`"?$"
|
||||
$msi = $_.UninstallString | Select-String -Pattern "^MsiExec.*$"
|
||||
if ($exe) {
|
||||
$installerType = 'exe'
|
||||
$silentArgs = '/VERYSILENT'
|
||||
$validExitCodes = @(0)
|
||||
Uninstall-ChocolateyPackage -PackageName "$packageName" `
|
||||
-FileType "$installerType" `
|
||||
-SilentArgs "$($silentArgs)" `
|
||||
-File "$($_.UninstallString)" `
|
||||
-ValidExitCodes $validExitCodes
|
||||
}
|
||||
if ($msi) {
|
||||
$installerType = 'msi'
|
||||
$silentArgs = '/quiet /qn /norestart'
|
||||
$validExitCodes = @(0,3010)
|
||||
Uninstall-ChocolateyPackage -PackageName "$packageName" `
|
||||
-FileType "$installerType" `
|
||||
-SilentArgs "$($_.PSChildName) $silentArgs" `
|
||||
-ValidExitCodes $validExitCodes
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user