Skip to content
Merged
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
77 changes: 68 additions & 9 deletions retroiptv_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent
-Verb RunAs
exit
} else {
Write-Host "? Operation cancelled administrator rights required." -ForegroundColor Red
Write-Host "? Operation cancelled Ñ administrator rights required." -ForegroundColor Red
exit 1
}
}
Expand Down Expand Up @@ -104,13 +104,13 @@ try { Start-Transcript -Path $logFile -Append | Out-Null } catch {}

""
$banner = @"
���������� ��� ����������������� �������������� ��� ������� ��� ���
��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ���
��� ��� �������� ��������� �������� �������� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��������� ��������
���������� ��� ��� ��� ���� ��� ��� ��� ���������� ��� ��� ��� ��� ����� ��� ��� ������ ��� ��� ���
��� ��� ���������� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� �� ��� ��� ������ ��� ����������
��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ������ ��� ���� ��� ���� ������ ���� ���
��� ��� �������� ����� ��� �������� ���������� ��� ���� �������� ��������� ��� ��������� ��������
¦¦¦¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦
¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦
¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦
¦¦¦¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦
¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦ ¦¦¦ ¦¦¦ ¦¦¦¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦¦¦
¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦ ¦¦¦¦¦¦ ¦¦¦ ¦¦¦¦ ¦¦¦ ¦¦¦¦ ¦¦¦¦¦¦ ¦¦¦¦ ¦¦¦
¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦ ¦¦¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦¦ ¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦¦ ¦¦¦ ¦¦¦¦¦¦¦¦¦ ¦¦¦¦¦¦¦¦
"@

try {
Expand Down Expand Up @@ -473,6 +473,63 @@ function Do-Uninstall {
Read-Host
}

function Update-RetroIPTVGuide {
Write-Host ""
Write-Host "============================================================"
Write-Host " RetroIPTVGuide Updater (Windows)"
Write-Host "============================================================"

$InstallPath = "C:\RetroIPTVGuide\iptv-server"

if (-Not (Test-Path "$InstallPath\.git")) {
Write-Host "❌ Cannot update — this is not a git repository: $InstallPath"
return
}

Write-Host "Pulling latest changes from GitHub..."
try {
Set-Location $InstallPath
git fetch --all
git reset --hard origin/main
}
catch {
Write-Host "❌ Git update failed: $($_.Exception.Message)"
return
}

# Virtual environment path
$VenvPath = Join-Path $InstallPath "venv"

if (Test-Path $VenvPath) {
Write-Host "Updating Python dependencies..."
& "$VenvPath\Scripts\python.exe" -m pip install --upgrade pip
& "$VenvPath\Scripts\pip.exe" install -r "$InstallPath\requirements.txt"
}
else {
Write-Host "⚠️ No virtual environment found. Recreating..."
python -m venv "$VenvPath"
& "$VenvPath\Scripts\python.exe" -m pip install --upgrade pip
& "$VenvPath\Scripts\pip.exe" install -r "$InstallPath\requirements.txt"
}

Write-Host "Restarting RetroIPTVGuide service..."

$service = Get-Service -Name "RetroIPTVGuide" -ErrorAction SilentlyContinue
if ($service) {
Stop-Service RetroIPTVGuide -Force
Start-Service RetroIPTVGuide
}
else {
Write-Host "⚠️ Service not installed. The app will run only manually."
}

Write-Host ""
Write-Host "============================================================"
Write-Host " Update Complete "
Write-Host "============================================================"
Write-Host ""
}


if (-not $Action) {
Write-Host ""
Expand All @@ -498,6 +555,7 @@ if (-not $Action) {
try {
switch ($Action) {
'install' { Do-Install }
'update' { Do-Update }
'uninstall' { Do-Uninstall }
}
} catch {
Expand All @@ -508,11 +566,12 @@ try {
Stop-Transcript | Out-Null
Start-Sleep -Milliseconds 200
} catch {}
}

Write-Host ""
Write-Host "============================================================" -ForegroundColor Cyan
Write-Host "RetroIPTVGuide process complete." -ForegroundColor Green
Write-Host "You may review the log above or press ENTER to close this window." -ForegroundColor Yellow
Write-Host "============================================================"
Read-Host
}
}