Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .

Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
| 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 |
2 changes: 1 addition & 1 deletion run_wow_backup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions scripts/uninstall_wow_backup.ps1
Original file line number Diff line number Diff line change
@@ -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 (Split-Path $PSScriptRoot -Parent) "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. CLick X in top right corner to close..."
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
2 changes: 1 addition & 1 deletion wowBackup.ps1 → scripts/wowBackup.ps1
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
13 changes: 13 additions & 0 deletions uninstall_run_wow_backup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off
:: 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%"