mirror of https://github.com/Icinga/icinga2.git
parent
4c7b5f710f
commit
901618d15b
|
@ -22,5 +22,6 @@
|
|||
</metadata>
|
||||
<files>
|
||||
<file src="tools\chocolateyInstall.ps1" target="tools" />
|
||||
<file src="tools\chocolateyUninstall.ps1" target="tools" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
$instDir = "unset"
|
||||
$uninstaller = "Uninstall.exe"
|
||||
$icingaRegistry64bitOS = "hklm:\SOFTWARE\Wow6432Node\Icinga Development Team\ICINGA2"
|
||||
$icingaRegistry32bitOS = "hklm:\SOFTWARE\Icinga Development Team\ICINGA2"
|
||||
$found = $false
|
||||
$validExitCodes = @(0)
|
||||
|
||||
if(test-path $icingaRegistry32bitOS) {
|
||||
$instDir = (get-itemproperty -literalpath $icingaRegistry32bitOS).'(default)'
|
||||
$found = $true
|
||||
}
|
||||
elseif(test-path $icingaRegistry64bitOS) {
|
||||
$instDir = (get-itemproperty -literalpath $icingaRegistry64bitOS).'(default)'
|
||||
$found = $true
|
||||
}
|
||||
else {
|
||||
Write-Host "Did not find a path in the registry to the Icinga2 folder, did you use the installer?"
|
||||
}
|
||||
|
||||
if ($found) {
|
||||
$packageArgs = "/S ?_="
|
||||
$statements = "& `"$instDir\$uninstaller`" $packageArgs`"$instDir`""
|
||||
|
||||
Start-ChocolateyProcessAsAdmin "$statements" -minimized -validExitCodes $validExitCodes
|
||||
}
|
Loading…
Reference in New Issue