From de03c975834d7c88ea14ef539b637750ec6b414d Mon Sep 17 00:00:00 2001 From: Shane Mitchell Date: Tue, 22 Apr 2025 00:37:49 -0700 Subject: [PATCH 1/6] uninstall wow backup --- uninstall_run_wow_backup.bat | 2 ++ uninstall_wow_backup.ps1 | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 uninstall_run_wow_backup.bat create mode 100644 uninstall_wow_backup.ps1 diff --git a/uninstall_run_wow_backup.bat b/uninstall_run_wow_backup.bat new file mode 100644 index 0000000..5b26325 --- /dev/null +++ b/uninstall_run_wow_backup.bat @@ -0,0 +1,2 @@ +@echo off +powershell -ExecutionPolicy Bypass -File "%~dp0uninstall_wow_backup.ps1" diff --git a/uninstall_wow_backup.ps1 b/uninstall_wow_backup.ps1 new file mode 100644 index 0000000..79927d6 --- /dev/null +++ b/uninstall_wow_backup.ps1 @@ -0,0 +1,30 @@ +# Prompt for elevation if not already admin +if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(` + [Security.Principal.WindowsBuiltinRole]::Administrator)) { + Write-Host "Restarting with administrative privileges..." + Start-Process powershell "-ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs + exit +} + +Write-Host "Uninstalling WoW UI Backup setup..." + +# Remove Scheduled Task +$taskName = "WowUI_Backup" +if (Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue) { + Unregister-ScheduledTask -TaskName $taskName -Confirm:$false + Write-Host "✅ Scheduled task '$taskName' removed." +} else { + Write-Host "ℹ️ No scheduled task named '$taskName' found." +} + +# Remove Config File +$configPath = Join-Path $PSScriptRoot "wowUI_config.json" +if (Test-Path $configPath) { + Remove-Item $configPath -Force + Write-Host "✅ Config file removed: $configPath" +} else { + Write-Host "ℹ️ No config file found at: $configPath" +} + +Write-Host "`n✅ Uninstall complete. Press any key to close..." +$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") From f9e2d959f3125c097e9976c894d81020b4c4d95e Mon Sep 17 00:00:00 2001 From: Shane Mitchell Date: Tue, 22 Apr 2025 00:44:35 -0700 Subject: [PATCH 2/6] updated file structure --- README.md | 15 +++++++++------ run_wow_backup.bat | 2 +- .../uninstall_wow_backup.ps1 | 0 wowBackup.ps1 => scripts/wowBackup.ps1 | 0 4 files changed, 10 insertions(+), 7 deletions(-) rename uninstall_wow_backup.ps1 => scripts/uninstall_wow_backup.ps1 (100%) rename wowBackup.ps1 => scripts/wowBackup.ps1 (100%) diff --git a/README.md b/README.md index 4dac0e4..3e4c39e 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,17 @@ This will let you choose folders again and reconfigure the scheduler. 🧹 Uninstalling / Removing the Task +| `uninstall_run_wow_backup.bat` | Double-click to uninstall | + To remove the scheduled task manually: Run in Powershell as admin: Unregister-ScheduledTask -TaskName "WowUI_Backup" -Confirm:$false -To reset everything, delete: - - wowUI_config.json - - The scheduled task (WowUI_Backup) +## 📁 Folder Structure - Any backup .zip files \ No newline at end of file +| Folder/File | Description | +|-------------|-------------| +| `scripts/wowBackup.ps1` | Main backup script | +| `scripts/uninstall_wow_backup.ps1` | Uninstalls the scheduled task and config | +| `run_wow_backup.bat` | Double-click to run the backup | +| `uninstall_run_wow_backup.bat` | Double-click to uninstall | diff --git a/run_wow_backup.bat b/run_wow_backup.bat index 60cd72c..e856eea 100644 --- a/run_wow_backup.bat +++ b/run_wow_backup.bat @@ -2,7 +2,7 @@ :: Batch file to launch wowBackup.ps1 with admin rights :: Set the full path to your PowerShell script -set scriptPath=%~dp0wowBackup.ps1 +set scriptPath=%~dp0scripts\wowBackup.ps1 :: Check if run from Task Scheduler (SESSIONNAME usually is "Console" or missing in Scheduled Tasks) setlocal EnableDelayedExpansion diff --git a/uninstall_wow_backup.ps1 b/scripts/uninstall_wow_backup.ps1 similarity index 100% rename from uninstall_wow_backup.ps1 rename to scripts/uninstall_wow_backup.ps1 diff --git a/wowBackup.ps1 b/scripts/wowBackup.ps1 similarity index 100% rename from wowBackup.ps1 rename to scripts/wowBackup.ps1 From 16a481804940c0564e83f5f79adaafd1891f7696 Mon Sep 17 00:00:00 2001 From: Shane Mitchell Date: Tue, 22 Apr 2025 00:47:15 -0700 Subject: [PATCH 3/6] updated config path --- scripts/uninstall_wow_backup.ps1 | 2 +- uninstall_run_wow_backup.bat | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/uninstall_wow_backup.ps1 b/scripts/uninstall_wow_backup.ps1 index 79927d6..0eab38e 100644 --- a/scripts/uninstall_wow_backup.ps1 +++ b/scripts/uninstall_wow_backup.ps1 @@ -18,7 +18,7 @@ if (Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue) { } # Remove Config File -$configPath = Join-Path $PSScriptRoot "wowUI_config.json" +$configPath = Join-Path (Split-Path $PSScriptRoot -Parent) "wowUI_config.json" if (Test-Path $configPath) { Remove-Item $configPath -Force Write-Host "✅ Config file removed: $configPath" diff --git a/uninstall_run_wow_backup.bat b/uninstall_run_wow_backup.bat index 5b26325..4205980 100644 --- a/uninstall_run_wow_backup.bat +++ b/uninstall_run_wow_backup.bat @@ -1,2 +1,13 @@ @echo off -powershell -ExecutionPolicy Bypass -File "%~dp0uninstall_wow_backup.ps1" +:: Launch the uninstall script with admin rights + +set scriptPath=%~dp0scripts\uninstall_wow_backup.ps1 + +>nul 2>&1 "%SystemRoot%\system32\cacls.exe" "%SystemRoot%\system32\config\system" +if '%errorlevel%' NEQ '0' ( + echo Requesting administrator privileges... + powershell -Command "Start-Process '%~f0' -Verb runAs" + exit /b +) + +powershell -ExecutionPolicy Bypass -File "%scriptPath%" From 7d002786110c0870b3039ba162b9b29fc467a818 Mon Sep 17 00:00:00 2001 From: Shane Mitchell Date: Tue, 22 Apr 2025 00:47:34 -0700 Subject: [PATCH 4/6] updatyed config path --- scripts/wowBackup.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/wowBackup.ps1 b/scripts/wowBackup.ps1 index f135a7b..c27943f 100644 --- a/scripts/wowBackup.ps1 +++ b/scripts/wowBackup.ps1 @@ -1,5 +1,5 @@ # Define path to config file -$configPath = "$PSScriptRoot\wowUI_config.json" +$configPath = Join-Path (Split-Path $PSScriptRoot -Parent) "wowUI_config.json" # Function to select folder function Select-Folder { From 6f0ed5bc4899b47e72e94f5c8252b3581a016594 Mon Sep 17 00:00:00 2001 From: Shane Mitchell Date: Tue, 22 Apr 2025 00:55:04 -0700 Subject: [PATCH 5/6] update release script --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d05a489..4ad5e2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,17 +16,17 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Set up environment + - name: Prepare release version id: prep run: | - # Use current date-time to generate unique tag version VERSION="v$(date +'%Y.%m.%d-%H%M%S')" echo "version_tag=$VERSION" >> $GITHUB_OUTPUT - - name: Create ZIP archive + - name: Create ZIP structure run: | - mkdir release - cp wowBackup.ps1 run_wow_backup.bat README.md release/ + mkdir -p release/scripts + cp scripts/wowBackup.ps1 scripts/uninstall_wow_backup.ps1 release/scripts/ + cp run_wow_backup.bat uninstall_run_wow_backup.bat README.md release/ cd release zip -r ../WoWBackup_${{ steps.prep.outputs.version_tag }}.zip . From 7d7e92623867d332d797e9416a2e0191cbba064a Mon Sep 17 00:00:00 2001 From: Shane Mitchell Date: Tue, 22 Apr 2025 01:00:54 -0700 Subject: [PATCH 6/6] uninstall edit --- scripts/uninstall_wow_backup.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/uninstall_wow_backup.ps1 b/scripts/uninstall_wow_backup.ps1 index 0eab38e..e75d1d4 100644 --- a/scripts/uninstall_wow_backup.ps1 +++ b/scripts/uninstall_wow_backup.ps1 @@ -26,5 +26,5 @@ if (Test-Path $configPath) { Write-Host "ℹ️ No config file found at: $configPath" } -Write-Host "`n✅ Uninstall complete. Press any key to close..." +Write-Host "`n✅ Uninstall complete. CLick X in top right corner to close..." $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")