This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip ci] https://gist.github.com/508bb89c4cc35b67842940c60310532b/7d439dce25fc8b846ab64122a3210efbf09157f9
- Loading branch information
1 parent
1c4ec19
commit 94d3a1f
Showing
8 changed files
with
23 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"phantom": "3.0.1.411-phantom", | ||
"beta": "2.0.0.5318-beta", | ||
"stable": "2.0.0.5301" | ||
"stable": "2.0.0.5319" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,26 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
$packageName = 'sonarr' | ||
$programUninstallEntryName = 'Sonarr*' | ||
|
||
$toolsDir = Split-Path $MyInvocation.MyCommand.Definition | ||
$fileLocation = Get-Item "$toolsDir\*.exe" | ||
$registry = Get-UninstallRegistryKey -SoftwareName $programUninstallEntryName | ||
$file = $registry.UninstallString | ||
|
||
$packageArgs = @{ | ||
packageName = $packageName | ||
fileType = 'exe' | ||
file = $fileLocation | ||
silentArgs = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /LOG=`"$($env:TEMP)\$($env:chocolateyPackageName).$($env:chocolateyPackageVersion).InnoInstall.log`"" | ||
silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' | ||
validExitCodes = @(0) | ||
file = $file | ||
} | ||
|
||
Install-ChocolateyInstallPackage @packageArgs | ||
Uninstall-ChocolateyPackage @packageArgs | ||
|
||
# Remove the installers as there is no more need for it | ||
Remove-Item $toolsDir\*.exe -ea 0 -Force | ||
|
||
# Start service if it's not running | ||
$service = 'Sonarr' | ||
if (Get-Service "$service" -ErrorAction SilentlyContinue) { | ||
$running = Get-Service $service | ||
if ($running.Status -eq "Running") { | ||
Write-Host 'Service is already running' | ||
} elseif ($running.Status -eq "Stopped") { | ||
Start-Service $service | ||
} | ||
#remove Sonarr folder that gets left behind | ||
$fexist = Test-Path $env:ProgramData\NzbDrone | ||
if ($fexist) { | ||
Write-Host "Removing Sonarr Folder that's left behind" | ||
Remove-Item $env:ProgramData\NzbDrone -Recurse -Force | ||
} else { | ||
Write-Host "Sonarr Folder not found" | ||
} |