From 2f561ece0419d7821cc6002268053aae370f01b5 Mon Sep 17 00:00:00 2001 From: Journey Date: Tue, 30 Jan 2024 21:22:47 -0600 Subject: [PATCH] fix this all hopefully... --- .../tinymediamanager/tinymediamanager.nuspec | 5 ++-- .../tools/chocolateyInstall.ps1 | 1 + automatic/tinymediamanager/update.ps1 | 28 ++++++++++--------- .../{old_versions.ps1 => install_v4.ps1} | 0 .../{version5.ps1 => install_v5.ps1} | 4 +-- .../version_switch/uninstall_v4.ps1 | 6 ++++ .../version_switch/uninstall_v5.ps1 | 6 ++++ 7 files changed, 32 insertions(+), 18 deletions(-) rename automatic/tinymediamanager/version_switch/{old_versions.ps1 => install_v4.ps1} (100%) rename automatic/tinymediamanager/version_switch/{version5.ps1 => install_v5.ps1} (88%) create mode 100644 automatic/tinymediamanager/version_switch/uninstall_v4.ps1 create mode 100644 automatic/tinymediamanager/version_switch/uninstall_v5.ps1 diff --git a/automatic/tinymediamanager/tinymediamanager.nuspec b/automatic/tinymediamanager/tinymediamanager.nuspec index f35c1755..b6de28e8 100644 --- a/automatic/tinymediamanager/tinymediamanager.nuspec +++ b/automatic/tinymediamanager/tinymediamanager.nuspec @@ -33,9 +33,8 @@ #### Package * Automatically built and uploaded by [JourneyOver](https://chocolatey.org/profiles/JourneyOver) * If you have any requests or issues with this package please make an issue [here](https://github.com/JourneyOver/chocolatey-packages) instead of "Contact Maintainers" - - - + diff --git a/automatic/tinymediamanager/tools/chocolateyInstall.ps1 b/automatic/tinymediamanager/tools/chocolateyInstall.ps1 index 7708dbb7..16e159c8 100644 --- a/automatic/tinymediamanager/tools/chocolateyInstall.ps1 +++ b/automatic/tinymediamanager/tools/chocolateyInstall.ps1 @@ -8,6 +8,7 @@ $Destination = "C:\Tools\tmm" $packageArgs = @{ packageName = $packageName FileFullPath = $embedded_path + SpecificFolder = 'tinyMediaManager' Destination = $Destination } diff --git a/automatic/tinymediamanager/update.ps1 b/automatic/tinymediamanager/update.ps1 index 955c9eba..19e9a333 100644 --- a/automatic/tinymediamanager/update.ps1 +++ b/automatic/tinymediamanager/update.ps1 @@ -27,9 +27,11 @@ function global:au_BeforeUpdate($Package) { Get-RemoteFiles -Purge -NoSuffix if ($Latest.URL32 -like '*tmm_3*' -or $Latest.URL32 -like '*tmm_4*') { - Copy-Item "$PSScriptRoot\version_switch\old_versions.ps1" "$PSScriptRoot\tools\chocolateyInstall.ps1" -Force + Copy-Item "$PSScriptRoot\version_switch\install_v4.ps1" "$PSScriptRoot\tools\chocolateyInstall.ps1" -Force + Copy-Item "$PSScriptRoot\version_switch\uninstall_v4.ps1" "$PSScriptRoot\tools\chocolateyUninstall.ps1" -Force } else { - Copy-Item "$PSScriptRoot\version_switch\version5.ps1" "$PSScriptRoot\tools\chocolateyInstall.ps1" -Force + Copy-Item "$PSScriptRoot\version_switch\install_v5.ps1" "$PSScriptRoot\tools\chocolateyInstall.ps1" -Force + Copy-Item "$PSScriptRoot\version_switch\uninstall_v5.ps1" "$PSScriptRoot\tools\chocolateyUninstall.ps1" -Force } } @@ -91,17 +93,17 @@ function GetV4Version() { #} function global:au_GetLatest { -# $v3Stream = GetV3Version - $v4Stream = GetV4Version - $v5Stream = GetV5Version - - $streams = [ordered] @{ -# v3 = $v3Stream - v4 = $v4Stream - v5 = $v5Stream - } + # $v3Stream = GetV3Version + $v4Stream = GetV4Version + $v5Stream = GetV5Version + + $streams = [ordered] @{ + # v3 = $v3Stream + v4 = $v4Stream + v5 = $v5Stream + } - return @{ Streams = $streams } -} + return @{ Streams = $streams } + } update -ChecksumFor none diff --git a/automatic/tinymediamanager/version_switch/old_versions.ps1 b/automatic/tinymediamanager/version_switch/install_v4.ps1 similarity index 100% rename from automatic/tinymediamanager/version_switch/old_versions.ps1 rename to automatic/tinymediamanager/version_switch/install_v4.ps1 diff --git a/automatic/tinymediamanager/version_switch/version5.ps1 b/automatic/tinymediamanager/version_switch/install_v5.ps1 similarity index 88% rename from automatic/tinymediamanager/version_switch/version5.ps1 rename to automatic/tinymediamanager/version_switch/install_v5.ps1 index 16e159c8..69c1f475 100644 --- a/automatic/tinymediamanager/version_switch/version5.ps1 +++ b/automatic/tinymediamanager/version_switch/install_v5.ps1 @@ -3,7 +3,7 @@ $ErrorActionPreference = 'Stop' $packageName = 'tinymediamanager' $toolsDir = Split-Path $MyInvocation.MyCommand.Definition $embedded_path = Get-Item "$toolsDir\*.zip" -$Destination = "C:\Tools\tmm" +$Destination = "C:\Tools" $packageArgs = @{ packageName = $packageName @@ -14,7 +14,7 @@ $packageArgs = @{ Get-ChocolateyUnzip @packageArgs -$fileLocation = Get-Item "$Destination\*Manager.exe" +$fileLocation = Get-Item "$Destination\tinyMediaManager\*Manager.exe" $shortcutName = 'tinyMediaManager.lnk' Install-ChocolateyShortcut -shortcutFilePath "$env:Public\Desktop\$shortcutName" -targetPath "$fileLocation" -WorkingDirectory "$Destination" diff --git a/automatic/tinymediamanager/version_switch/uninstall_v4.ps1 b/automatic/tinymediamanager/version_switch/uninstall_v4.ps1 new file mode 100644 index 00000000..dcff3fc1 --- /dev/null +++ b/automatic/tinymediamanager/version_switch/uninstall_v4.ps1 @@ -0,0 +1,6 @@ +$packageName = 'tinymediamanager' +$shortcutName = 'tinyMediaManager.lnk' + +Remove-Item "$env:Public\Desktop\$shortcutName" -Force -ErrorAction 'SilentlyContinue' +Remove-Item "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\$shortcutName" -Force -ErrorAction 'SilentlyContinue' +Remove-Item -r "C:\Tools\tmm*" -ea 0 -Force diff --git a/automatic/tinymediamanager/version_switch/uninstall_v5.ps1 b/automatic/tinymediamanager/version_switch/uninstall_v5.ps1 new file mode 100644 index 00000000..c75439fd --- /dev/null +++ b/automatic/tinymediamanager/version_switch/uninstall_v5.ps1 @@ -0,0 +1,6 @@ +$packageName = 'tinymediamanager' +$shortcutName = 'tinyMediaManager.lnk' + +Remove-Item "$env:Public\Desktop\$shortcutName" -Force -ErrorAction 'SilentlyContinue' +Remove-Item "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\$shortcutName" -Force -ErrorAction 'SilentlyContinue' +Remove-Item -r "C:\Tools\tinyMediaManager*" -ea 0 -Force