fix: complete script overhaul - JD blocking bug, TLS, backup import, Gitea apps
Critical fixes: - JDownloader no longer blocks script (use polling instead of -Wait) - Force TLS 1.2 for HTTPS downloads on older servers - JD backup import uses marker file instead of cfg/ check (was always skipped) - Explorer restart after Windows settings for immediate effect New features: - Twitch VOD Manager, Multi-Hoster-Upload, Real-Debrid-Downloader from Gitea - Install-Gitea-App helper function (auto-fetches latest release) - Unrar-File helper function (DRY) Cleanup: - Consistent step numbering via $totalSteps variable - WinRAR path as global variable - Gitea WebClient with User-Agent header - ReadKey pause at script end - Cleaner formatting throughout Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d6781e8138
commit
c54df9162d
330
VServerSetup.ps1
330
VServerSetup.ps1
@ -2,7 +2,14 @@
|
||||
$ErrorActionPreference = "Continue"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
# TLS 1.2 erzwingen - ohne das schlagen HTTPS-Downloads auf aelteren Servern fehl
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
$tempDir = "$env:TEMP\vserver-setup"
|
||||
$desktopPath = [Environment]::GetFolderPath("Desktop")
|
||||
$winrarPath = "C:\Program Files\WinRAR\WinRAR.exe"
|
||||
$totalSteps = 18
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $tempDir | Out-Null
|
||||
|
||||
Write-Host "========================================" -ForegroundColor Cyan
|
||||
@ -12,7 +19,8 @@ Write-Host ""
|
||||
|
||||
function Download-File {
|
||||
param($Url, $Output)
|
||||
Write-Host " Downloading: $Output" -ForegroundColor Gray
|
||||
$filename = Split-Path $Output -Leaf
|
||||
Write-Host " Downloading: $filename" -ForegroundColor Gray
|
||||
try {
|
||||
$webClient = New-Object System.Net.WebClient
|
||||
$webClient.Headers.Add("User-Agent", "Mozilla/5.0")
|
||||
@ -24,8 +32,60 @@ function Download-File {
|
||||
}
|
||||
}
|
||||
|
||||
function Unrar-File {
|
||||
param($RarPath, $DestPath)
|
||||
if (Test-Path $winrarPath) {
|
||||
Start-Process -FilePath $winrarPath -ArgumentList "x", "-ibck", "-o+", $RarPath, "$DestPath\" -Wait
|
||||
return $true
|
||||
} else {
|
||||
Write-Host " FEHLER: WinRAR nicht gefunden" -ForegroundColor Red
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
function Install-Gitea-App {
|
||||
param($Name, $Repo, $StepNum, $DetectPaths, $ProcessName)
|
||||
Write-Host ""
|
||||
Write-Host "[$StepNum/$totalSteps] $Name..." -ForegroundColor Yellow
|
||||
|
||||
foreach ($p in $DetectPaths) {
|
||||
if (Test-Path $p) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Write-Host " Hole neueste Version von Gitea..." -ForegroundColor Gray
|
||||
$releaseApi = "https://git.24-music.de/api/v1/repos/Administrator/$Repo/releases?limit=1"
|
||||
$wc = New-Object System.Net.WebClient
|
||||
$wc.Headers.Add("User-Agent", "Mozilla/5.0")
|
||||
$release = $wc.DownloadString($releaseApi) | ConvertFrom-Json
|
||||
$setupAsset = $release[0].assets | Where-Object { $_.name -like "*Setup*.exe" -and $_.name -notlike "*.blockmap" } | Select-Object -First 1
|
||||
if ($setupAsset) {
|
||||
$installer = "$tempDir\$($setupAsset.name)"
|
||||
Write-Host " Version: $($release[0].tag_name)" -ForegroundColor Gray
|
||||
if (Download-File -Url $setupAsset.browser_download_url -Output $installer) {
|
||||
Write-Host " Installiere $Name (silent)..." -ForegroundColor Gray
|
||||
Start-Process -FilePath $installer -ArgumentList "/S" -Wait
|
||||
# Electron-Apps starten manchmal nach Installation - beenden damit Setup weiterlaeuft
|
||||
if ($ProcessName) {
|
||||
Start-Sleep -Seconds 3
|
||||
Stop-Process -Name $ProcessName -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
Write-Host " $Name installiert!" -ForegroundColor Green
|
||||
}
|
||||
} else {
|
||||
Write-Host " FEHLER: Kein Setup-Asset im Release gefunden" -ForegroundColor Red
|
||||
}
|
||||
} catch {
|
||||
Write-Host " FEHLER beim Abrufen der Gitea-Release: $_" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
|
||||
# 1. PYTHON
|
||||
Write-Host "[1/12] Python..." -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
Write-Host "[1/$totalSteps] Python..." -ForegroundColor Yellow
|
||||
$pythonInstalled = (Get-Command python -ErrorAction SilentlyContinue) -or (Test-Path "C:\Program Files\Python*\python.exe")
|
||||
if ($pythonInstalled) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
@ -40,7 +100,8 @@ if ($pythonInstalled) {
|
||||
}
|
||||
|
||||
# 2. FFMPEG
|
||||
Write-Host "[2/12] FFmpeg..." -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
Write-Host "[2/$totalSteps] FFmpeg..." -ForegroundColor Yellow
|
||||
if (Test-Path "C:\ffmpeg\bin\ffmpeg.exe") {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
@ -65,8 +126,9 @@ if ($currentPath -notlike "*C:\ffmpeg\bin*") {
|
||||
}
|
||||
|
||||
# 3. WINRAR
|
||||
Write-Host "[3/12] WinRAR..." -ForegroundColor Yellow
|
||||
if (Test-Path "C:\Program Files\WinRAR\WinRAR.exe") {
|
||||
Write-Host ""
|
||||
Write-Host "[3/$totalSteps] WinRAR..." -ForegroundColor Yellow
|
||||
if (Test-Path $winrarPath) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
$winrarUrl = "https://www.win-rar.com/fileadmin/winrar-versions/winrar/winrar-x64-701.exe"
|
||||
@ -79,27 +141,24 @@ if (Test-Path "C:\Program Files\WinRAR\WinRAR.exe") {
|
||||
}
|
||||
|
||||
# 4. G-EARTH (nach WinRAR, damit wir entpacken koennen)
|
||||
Write-Host "[4/12] G-Earth..." -ForegroundColor Yellow
|
||||
$gearthPath = "$([Environment]::GetFolderPath('Desktop'))\G-Earth"
|
||||
if (Test-Path $gearthPath) {
|
||||
Write-Host ""
|
||||
Write-Host "[4/$totalSteps] G-Earth..." -ForegroundColor Yellow
|
||||
if (Test-Path "$desktopPath\G-Earth") {
|
||||
Write-Host " Bereits vorhanden - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
$gearthUrl = "https://streamerware.de/G-earth.rar"
|
||||
$gearthRar = "$tempDir\G-earth.rar"
|
||||
if (Download-File -Url $gearthUrl -Output $gearthRar) {
|
||||
Write-Host " Entpacke G-Earth auf Desktop..." -ForegroundColor Gray
|
||||
$winrarPath = "C:\Program Files\WinRAR\WinRAR.exe"
|
||||
if (Test-Path $winrarPath) {
|
||||
Start-Process -FilePath $winrarPath -ArgumentList "x", "-ibck", "-o+", $gearthRar, "$([Environment]::GetFolderPath('Desktop'))\" -Wait
|
||||
if (Unrar-File -RarPath $gearthRar -DestPath $desktopPath) {
|
||||
Write-Host " G-Earth installiert!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " FEHLER: WinRAR nicht gefunden" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 5. VLC
|
||||
Write-Host "[5/12] VLC..." -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
Write-Host "[5/$totalSteps] VLC..." -ForegroundColor Yellow
|
||||
if (Test-Path "C:\Program Files\VideoLAN\VLC\vlc.exe") {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
@ -112,8 +171,9 @@ if (Test-Path "C:\Program Files\VideoLAN\VLC\vlc.exe") {
|
||||
}
|
||||
}
|
||||
|
||||
# 5. JAVA 8
|
||||
Write-Host "[6/12] Java 8..." -ForegroundColor Yellow
|
||||
# 6. JAVA 8
|
||||
Write-Host ""
|
||||
Write-Host "[6/$totalSteps] Java 8..." -ForegroundColor Yellow
|
||||
$javaInstalled = (Test-Path "C:\Program Files\Java\*") -or (Test-Path "C:\Program Files\Eclipse Adoptium\*") -or (Get-Command java -ErrorAction SilentlyContinue)
|
||||
if ($javaInstalled) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
@ -127,8 +187,9 @@ if ($javaInstalled) {
|
||||
}
|
||||
}
|
||||
|
||||
# 6. .NET FRAMEWORK 4.8
|
||||
Write-Host "[7/13] .NET Framework 4.8..." -ForegroundColor Yellow
|
||||
# 7. .NET FRAMEWORK 4.8
|
||||
Write-Host ""
|
||||
Write-Host "[7/$totalSteps] .NET Framework 4.8..." -ForegroundColor Yellow
|
||||
$netInstalled = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" -ErrorAction SilentlyContinue).Release -ge 528040
|
||||
if ($netInstalled) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
@ -142,8 +203,9 @@ if ($netInstalled) {
|
||||
}
|
||||
}
|
||||
|
||||
# 7. .NET 6.0 DESKTOP RUNTIME
|
||||
Write-Host "[8/13] .NET 6.0 Desktop Runtime..." -ForegroundColor Yellow
|
||||
# 8. .NET 6.0 DESKTOP RUNTIME
|
||||
Write-Host ""
|
||||
Write-Host "[8/$totalSteps] .NET 6.0 Desktop Runtime..." -ForegroundColor Yellow
|
||||
$net6Installed = (Test-Path "C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\6.*") -or (Test-Path "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.*")
|
||||
if ($net6Installed) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
@ -158,7 +220,8 @@ if ($net6Installed) {
|
||||
}
|
||||
|
||||
# 9. .NET 8.0 DESKTOP RUNTIME
|
||||
Write-Host "[9/16] .NET 8.0 Desktop Runtime..." -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
Write-Host "[9/$totalSteps] .NET 8.0 Desktop Runtime..." -ForegroundColor Yellow
|
||||
$net8Installed = (Test-Path "C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\8.*") -or (Test-Path "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.*")
|
||||
if ($net8Installed) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
@ -173,7 +236,8 @@ if ($net8Installed) {
|
||||
}
|
||||
|
||||
# 10. GOOGLE CHROME
|
||||
Write-Host "[10/16] Google Chrome..." -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
Write-Host "[10/$totalSteps] Google Chrome..." -ForegroundColor Yellow
|
||||
$chromeInstalled = (Test-Path "C:\Program Files\Google\Chrome\Application\chrome.exe") -or (Test-Path "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
|
||||
if ($chromeInstalled) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
@ -187,9 +251,10 @@ if ($chromeInstalled) {
|
||||
}
|
||||
}
|
||||
|
||||
# 10. HABBO LAUNCHER
|
||||
Write-Host "[11/16] Habbo Launcher..." -ForegroundColor Yellow
|
||||
$habboInstalled = (Test-Path "$env:LOCALAPPDATA\Programs\habbo-launcher\Habbo Launcher.exe") -or (Test-Path "C:\Program Files\Habbo Launcher\*") -or (Test-Path "$env:USERPROFILE\AppData\Local\Programs\habbo-launcher\Habbo Launcher.exe") -or (Get-ChildItem "C:\Users\*\AppData\Local\Programs\habbo-launcher\Habbo Launcher.exe" -ErrorAction SilentlyContinue) -or (Test-Path "$([Environment]::GetFolderPath('Desktop'))\Habbo Launcher.lnk")
|
||||
# 11. HABBO LAUNCHER
|
||||
Write-Host ""
|
||||
Write-Host "[11/$totalSteps] Habbo Launcher..." -ForegroundColor Yellow
|
||||
$habboInstalled = (Test-Path "$env:LOCALAPPDATA\Programs\habbo-launcher\Habbo Launcher.exe") -or (Test-Path "C:\Program Files\Habbo Launcher\*")
|
||||
if ($habboInstalled) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
@ -198,110 +263,128 @@ if ($habboInstalled) {
|
||||
if (Download-File -Url $habboUrl -Output $habboInstaller) {
|
||||
Write-Host " Installiere Habbo Launcher (silent)..." -ForegroundColor Gray
|
||||
Start-Process -FilePath $habboInstaller -ArgumentList "/S" -Wait
|
||||
Start-Sleep -Seconds 3
|
||||
Stop-Process -Name "Habbo Launcher" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host " Habbo Launcher installiert!" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
|
||||
# 8. JDOWNLOADER (von Website laden)
|
||||
Write-Host "[12/16] JDownloader..." -ForegroundColor Yellow
|
||||
$jdPath = "$env:LOCALAPPDATA\JDownloader 2.0"
|
||||
$jdInstalled = (Test-Path "$jdPath\JDownloader2.exe") -or (Test-Path "C:\Program Files\JDownloader\JDownloader2.exe")
|
||||
if ($jdInstalled) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
$jdUrl = "http://streamerware.de/JDownloader2Setup_windows-amd64_v21_0_7.exe"
|
||||
$jdInstaller = "$tempDir\JDownloader2Setup.exe"
|
||||
if (Download-File -Url $jdUrl -Output $jdInstaller) {
|
||||
Write-Host " Installiere JDownloader (silent)..." -ForegroundColor Gray
|
||||
Start-Process -FilePath $jdInstaller -ArgumentList "-q" -Wait
|
||||
Write-Host " JDownloader installiert!" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
|
||||
# JD2 BACKUP IMPORTIEREN (eingebettet)
|
||||
$jdPaths = @(
|
||||
# 12. JDOWNLOADER
|
||||
Write-Host ""
|
||||
Write-Host "[12/$totalSteps] JDownloader..." -ForegroundColor Yellow
|
||||
$jdDetectPaths = @(
|
||||
"$env:LOCALAPPDATA\JDownloader 2.0",
|
||||
"C:\Program Files\JDownloader",
|
||||
"C:\Users\Administrator\AppData\Local\JDownloader 2.0"
|
||||
)
|
||||
$jdPath = $null
|
||||
foreach ($p in $jdPaths) {
|
||||
if (Test-Path $p) { $jdPath = $p; break }
|
||||
foreach ($p in $jdDetectPaths) {
|
||||
if (Test-Path "$p\JDownloader2.exe") { $jdPath = $p; break }
|
||||
}
|
||||
# Pruefen ob Backup bereits importiert wurde (cfg Ordner existiert)
|
||||
if ($jdPath -and (Test-Path "$jdPath\cfg")) {
|
||||
Write-Host " JD2-Backup bereits importiert - ueberspringe." -ForegroundColor Gray
|
||||
} elseif ($jdPath) {
|
||||
Write-Host " Importiere JD2-Backup..." -ForegroundColor Cyan
|
||||
Write-Host " Ziel: $jdPath" -ForegroundColor Gray
|
||||
# JD2 Backup wird als separate Datei mitgeliefert (jdownloader-backup.zip)
|
||||
# oder aus dem gleichen Verzeichnis wie das Script geladen
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$backupZip = Join-Path $scriptDir "jdownloader-backup.zip"
|
||||
if (-not (Test-Path $backupZip)) {
|
||||
$backupZip = "$tempDir\jd2backup.zip"
|
||||
$backupUrl = "https://streamerware.de/jdownloader-backup.zip"
|
||||
Download-File -Url $backupUrl -Output $backupZip | Out-Null
|
||||
|
||||
if ($jdPath) {
|
||||
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
$jdUrl = "https://streamerware.de/JDownloader2Setup_windows-amd64_v21_0_7.exe"
|
||||
$jdInstaller = "$tempDir\JDownloader2Setup.exe"
|
||||
if (Download-File -Url $jdUrl -Output $jdInstaller) {
|
||||
Write-Host " Installiere JDownloader (silent)..." -ForegroundColor Gray
|
||||
# NICHT -Wait benutzen! Der JD-Installer (install4j) startet JDownloader nach
|
||||
# der Installation und wartet bis JD geschlossen wird. -Wait wuerde das Script
|
||||
# blockieren bis der User JDownloader manuell schliesst.
|
||||
$jdProc = Start-Process -FilePath $jdInstaller -ArgumentList "-q" -PassThru
|
||||
|
||||
# Warte bis JDownloader2.exe auf der Festplatte erscheint (max 2 Minuten)
|
||||
Write-Host " Warte auf Installation..." -ForegroundColor Gray
|
||||
$installed = $false
|
||||
for ($i = 0; $i -lt 60; $i++) {
|
||||
Start-Sleep -Seconds 2
|
||||
foreach ($dp in $jdDetectPaths) {
|
||||
if (Test-Path "$dp\JDownloader2.exe") {
|
||||
$jdPath = $dp
|
||||
$installed = $true
|
||||
break
|
||||
}
|
||||
}
|
||||
if ($installed) { break }
|
||||
if ($jdProc.HasExited -and -not $installed) { break }
|
||||
}
|
||||
|
||||
# JDownloader und Installer-Prozess beenden
|
||||
Start-Sleep -Seconds 3
|
||||
Stop-Process -Name "JDownloader2" -Force -ErrorAction SilentlyContinue
|
||||
# Auf einem frischen VServer laeuft kein anderes Java - sicher zu killen
|
||||
Stop-Process -Name "java" -Force -ErrorAction SilentlyContinue
|
||||
if (-not $jdProc.HasExited) {
|
||||
Stop-Process -Id $jdProc.Id -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
if ($installed) {
|
||||
Write-Host " JDownloader installiert!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " WARNUNG: JDownloader Installation nicht verifiziert" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
try {
|
||||
Expand-Archive -Path $backupZip -DestinationPath $jdPath -Force
|
||||
Write-Host " JD2-Settings importiert!" -ForegroundColor Green
|
||||
} catch {
|
||||
Write-Host " FEHLER beim Import: $_" -ForegroundColor Red
|
||||
}
|
||||
|
||||
# JD2 BACKUP IMPORTIEREN
|
||||
# Marker-Datei statt cfg/-Check: JDownloader erstellt cfg/ beim ersten Start mit
|
||||
# Default-Dateien, was den alten Check sofort zum Ueberspringen gebracht hat
|
||||
if ($jdPath) {
|
||||
if (Test-Path "$jdPath\.backup-imported") {
|
||||
Write-Host " JD2-Backup bereits importiert - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host " Importiere JD2-Backup..." -ForegroundColor Cyan
|
||||
Write-Host " Ziel: $jdPath" -ForegroundColor Gray
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$backupZip = Join-Path $scriptDir "jdownloader-backup.zip"
|
||||
if (-not (Test-Path $backupZip)) {
|
||||
Write-Host " WARNUNG: jdownloader-backup.zip nicht neben dem Script gefunden" -ForegroundColor Yellow
|
||||
Write-Host " Erwarte Datei in: $scriptDir" -ForegroundColor Yellow
|
||||
}
|
||||
if (Test-Path $backupZip) {
|
||||
try {
|
||||
Expand-Archive -Path $backupZip -DestinationPath $jdPath -Force
|
||||
New-Item -Path "$jdPath\.backup-imported" -ItemType File -Force | Out-Null
|
||||
Write-Host " JD2-Settings importiert!" -ForegroundColor Green
|
||||
} catch {
|
||||
Write-Host " FEHLER beim Import: $_" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Host " JDownloader-Ordner nicht gefunden - Backup uebersprungen" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# 6. FILE-UPLOADER + ORDNER
|
||||
# 13. DESKTOP ORDNER + FILE-UPLOADER
|
||||
Write-Host ""
|
||||
Write-Host "[13/16] Desktop Ordner..." -ForegroundColor Yellow
|
||||
$desktopPath = [Environment]::GetFolderPath("Desktop")
|
||||
Write-Host "[13/$totalSteps] Desktop Ordner..." -ForegroundColor Yellow
|
||||
|
||||
# Ordner "Fertig" und "Unfertig" erstellen (nur wenn nicht vorhanden)
|
||||
if (Test-Path "$desktopPath\Fertig") {
|
||||
Write-Host " Ordner 'Fertig' bereits vorhanden." -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host " Erstelle Ordner 'Fertig'..." -ForegroundColor Gray
|
||||
New-Item -ItemType Directory -Force -Path "$desktopPath\Fertig" | Out-Null
|
||||
}
|
||||
if (Test-Path "$desktopPath\Unfertig") {
|
||||
Write-Host " Ordner 'Unfertig' bereits vorhanden." -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host " Erstelle Ordner 'Unfertig'..." -ForegroundColor Gray
|
||||
New-Item -ItemType Directory -Force -Path "$desktopPath\Unfertig" | Out-Null
|
||||
foreach ($folder in @("Fertig", "Unfertig")) {
|
||||
if (Test-Path "$desktopPath\$folder") {
|
||||
Write-Host " Ordner '$folder' bereits vorhanden." -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host " Erstelle Ordner '$folder'..." -ForegroundColor Gray
|
||||
New-Item -ItemType Directory -Force -Path "$desktopPath\$folder" | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
# File-Uploader vom Server laden (nur wenn nicht vorhanden)
|
||||
if (Test-Path "$desktopPath\File-Uploader") {
|
||||
Write-Host " File-Uploader bereits vorhanden - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
Write-Host " Lade File-Uploader vom Server..." -ForegroundColor Gray
|
||||
$fileUploaderUrl = "https://streamerware.de/FileUploader.rar"
|
||||
$uploaderRar = "$tempDir\FileUploader.rar"
|
||||
|
||||
if (Download-File -Url $fileUploaderUrl -Output $uploaderRar) {
|
||||
try {
|
||||
$winrarPath = "C:\Program Files\WinRAR\WinRAR.exe"
|
||||
if (Test-Path $winrarPath) {
|
||||
Start-Process -FilePath $winrarPath -ArgumentList "x", "-ibck", "-o+", $uploaderRar, "$desktopPath\" -Wait
|
||||
Write-Host " File-Uploader installiert!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " FEHLER: WinRAR nicht gefunden (fuer .rar Entpacken)." -ForegroundColor Red
|
||||
}
|
||||
} catch {
|
||||
Write-Host " FEHLER beim Entpacken: $_" -ForegroundColor Red
|
||||
if (Unrar-File -RarPath $uploaderRar -DestPath $desktopPath) {
|
||||
Write-Host " File-Uploader installiert!" -ForegroundColor Green
|
||||
}
|
||||
} else {
|
||||
Write-Host " FEHLER: Download vom Server fehlgeschlagen." -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host " Desktop Ordner erstellt!" -ForegroundColor Green
|
||||
|
||||
# 13. SCRIPTE
|
||||
# 14. SCRIPTE
|
||||
Write-Host ""
|
||||
Write-Host "[14/16] Scripte..." -ForegroundColor Yellow
|
||||
Write-Host "[14/$totalSteps] Scripte..." -ForegroundColor Yellow
|
||||
if (Test-Path "$desktopPath\Rename MKV AVI.py") {
|
||||
Write-Host " Bereits vorhanden - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
@ -309,37 +392,35 @@ if (Test-Path "$desktopPath\Rename MKV AVI.py") {
|
||||
$scripteRar = "$tempDir\Scripte.rar"
|
||||
if (Download-File -Url $scripteUrl -Output $scripteRar) {
|
||||
Write-Host " Entpacke Scripte auf Desktop..." -ForegroundColor Gray
|
||||
$winrarPath = "C:\Program Files\WinRAR\WinRAR.exe"
|
||||
if (Test-Path $winrarPath) {
|
||||
Start-Process -FilePath $winrarPath -ArgumentList "x", "-ibck", "-o+", $scripteRar, "$desktopPath\" -Wait
|
||||
if (Unrar-File -RarPath $scripteRar -DestPath $desktopPath) {
|
||||
Write-Host " Scripte installiert!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " FEHLER: WinRAR nicht gefunden" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 14. TWITCH VOD MANAGER
|
||||
Write-Host ""
|
||||
Write-Host "[15/16] Twitch VOD Manager..." -ForegroundColor Yellow
|
||||
$twitchPath = "$desktopPath\Twitch Downloader"
|
||||
if (Test-Path "$twitchPath\Twitch_VOD_Manager.exe") {
|
||||
Write-Host " Bereits vorhanden - ueberspringe." -ForegroundColor Gray
|
||||
} else {
|
||||
$twitchUrl = "https://streamerware.de/Twitch_VOD_Manager.zip"
|
||||
$twitchZip = "$tempDir\Twitch_VOD_Manager.zip"
|
||||
if (Download-File -Url $twitchUrl -Output $twitchZip) {
|
||||
Write-Host " Entpacke Twitch VOD Manager auf Desktop..." -ForegroundColor Gray
|
||||
Expand-Archive -Path $twitchZip -DestinationPath $desktopPath -Force
|
||||
Write-Host " Twitch VOD Manager installiert!" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
# 15. TWITCH VOD MANAGER (von Gitea)
|
||||
Install-Gitea-App -Name "Twitch VOD Manager" -Repo "Twitch-VOD-Manager" `
|
||||
-StepNum 15 `
|
||||
-DetectPaths @("$env:LOCALAPPDATA\Programs\twitch-vod-manager\Twitch VOD Manager.exe", "$desktopPath\Twitch VOD Manager.lnk") `
|
||||
-ProcessName "Twitch VOD Manager"
|
||||
|
||||
# 12. WINDOWS EINSTELLUNGEN
|
||||
Write-Host ""
|
||||
Write-Host "[16/16] Windows Einstellungen..." -ForegroundColor Yellow
|
||||
# 16. MULTI-HOSTER-UPLOAD (von Gitea)
|
||||
Install-Gitea-App -Name "Multi-Hoster-Upload" -Repo "Multi-Hoster-Upload" `
|
||||
-StepNum 16 `
|
||||
-DetectPaths @("$env:LOCALAPPDATA\Programs\multi-hoster-upload\Multi-Hoster-Upload.exe", "$desktopPath\Multi-Hoster-Upload.lnk") `
|
||||
-ProcessName "Multi-Hoster-Upload"
|
||||
|
||||
# IE Enhanced Security Configuration deaktivieren (fuer Administratoren und Benutzer)
|
||||
# 17. REAL-DEBRID-DOWNLOADER (von Gitea)
|
||||
Install-Gitea-App -Name "Real-Debrid-Downloader" -Repo "real-debrid-downloader" `
|
||||
-StepNum 17 `
|
||||
-DetectPaths @("$env:LOCALAPPDATA\Programs\real-debrid-downloader\Real-Debrid-Downloader.exe", "$desktopPath\Real-Debrid-Downloader.lnk") `
|
||||
-ProcessName "Real-Debrid-Downloader"
|
||||
|
||||
# 18. WINDOWS EINSTELLUNGEN
|
||||
Write-Host ""
|
||||
Write-Host "[18/$totalSteps] Windows Einstellungen..." -ForegroundColor Yellow
|
||||
|
||||
# IE Enhanced Security Configuration deaktivieren
|
||||
Write-Host " IE Enhanced Security deaktivieren..." -ForegroundColor Gray
|
||||
$ieAdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
|
||||
$ieUserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
|
||||
@ -371,6 +452,12 @@ Set-ItemProperty -Path $desktopRegPath -Name "IconSize" -Value 32 -Type DWord -F
|
||||
Set-ItemProperty -Path $desktopRegPath -Name "Mode" -Value 1 -Type DWord -Force
|
||||
Set-ItemProperty -Path $desktopRegPath -Name "LogicalViewMode" -Value 3 -Type DWord -Force
|
||||
|
||||
# Explorer neu starten damit alle Einstellungen sofort wirksam werden
|
||||
Write-Host " Explorer wird neu gestartet..." -ForegroundColor Gray
|
||||
Stop-Process -Name "explorer" -Force -ErrorAction SilentlyContinue
|
||||
Start-Sleep -Seconds 2
|
||||
Start-Process "explorer.exe"
|
||||
|
||||
Write-Host " Windows Einstellungen angepasst!" -ForegroundColor Green
|
||||
|
||||
# CLEANUP
|
||||
@ -384,3 +471,4 @@ Write-Host " FERTIG! Alle Programme installiert." -ForegroundColor Green
|
||||
Write-Host "========================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "Druecke eine Taste zum Beenden..."
|
||||
$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | Out-Null
|
||||
|
||||
Loading…
Reference in New Issue
Block a user