Files
VServerSetup/VServerSetup.ps1
T
Administrator 4c46e4a697 release: sync VServerSetup with Multi-Hoster v2.0.3
Keep the setup source on the canonical Administrator/Multi-Hoster-Upload Gitea repository and expose that source in the installer output. Remove the obsolete .mhu asset lookup because the v2.0.3 private bridge release publishes installer, portable, blockmap, and latest metadata only. Bump the setup version and document the v2.0.3 product release with transport tag v3.3.111.
2026-08-09 15:21:14 +02:00

638 lines
29 KiB
PowerShell

#Requires -RunAsAdministrator
$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"
$vserverSetupVersion = "2.5.0"
$giteaBaseUrl = "https://git.24-music.de"
$githubApiBaseUrl = "https://api.github.com"
$githubDownloaderRepo = "Sucukdeluxe/multi-debrid-downloader"
$multiHosterRepo = "Multi-Hoster-Upload"
$multiHosterSourceUrl = "$giteaBaseUrl/Administrator/$multiHosterRepo"
$totalSteps = 18
New-Item -ItemType Directory -Force -Path $tempDir | Out-Null
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " VServer Setup v$vserverSetupVersion - Automatische Installation" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
function Download-File {
param($Url, $Output)
$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")
$webClient.DownloadFile($Url, $Output)
return $true
} catch {
Write-Host " FEHLER beim Download: $_" -ForegroundColor Red
return $false
}
}
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 Get-Gitea-Latest-Asset {
param($Repo, $Filter)
$releaseApi = "$giteaBaseUrl/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)[0]
$asset = $release.assets | Where-Object { $_.name -like $Filter -and $_.name -notlike "*.blockmap" } | Select-Object -First 1
if ($asset) {
Write-Host " Version: $($release.tag_name)" -ForegroundColor Gray
}
return $asset
}
function Get-GitHub-Latest-Asset {
param($Repo, $Filter)
$releaseApi = "$githubApiBaseUrl/repos/$Repo/releases/latest"
$wc = New-Object System.Net.WebClient
$wc.Headers.Add("User-Agent", "VServerSetup")
$wc.Headers.Add("Accept", "application/vnd.github+json")
$release = ($wc.DownloadString($releaseApi) | ConvertFrom-Json)
$asset = $release.assets | Where-Object { $_.name -like $Filter -and $_.name -notlike "*.blockmap" } | Select-Object -First 1
if ($asset) {
Write-Host " Version: $($release.tag_name)" -ForegroundColor Gray
}
return $asset
}
function Copy-Gitea-DataFile-To-Desktop {
param($Repo, $Filter)
try {
$asset = Get-Gitea-Latest-Asset -Repo $Repo -Filter $Filter
if (-not $asset) {
Write-Host " WARNUNG: Kein Asset '$Filter' im Release gefunden" -ForegroundColor Yellow
return
}
$destPath = Join-Path $desktopPath $asset.name
if (Test-Path $destPath) {
Write-Host " $($asset.name) bereits vorhanden - ueberspringe." -ForegroundColor Gray
return
}
if (Download-File -Url $asset.browser_download_url -Output $destPath) {
Write-Host " $($asset.name) auf Desktop!" -ForegroundColor Green
}
} catch {
Write-Host " FEHLER beim Laden der Data-Datei: $_" -ForegroundColor Red
}
}
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
$asset = Get-Gitea-Latest-Asset -Repo $Repo -Filter "*Setup*.exe"
if ($asset) {
$installer = "$tempDir\$($asset.name)"
if (Download-File -Url $asset.browser_download_url -Output $installer) {
Write-Host " Installiere $Name (silent)..." -ForegroundColor Gray
Start-Process -FilePath $installer -ArgumentList "/S" -Wait
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
}
}
function Install-GitHub-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 GitHub..." -ForegroundColor Gray
$asset = Get-GitHub-Latest-Asset -Repo $Repo -Filter "*Setup*.exe"
if ($asset) {
$installer = "$tempDir\$($asset.name)"
if (Download-File -Url $asset.browser_download_url -Output $installer) {
Write-Host " Installiere $Name (silent)..." -ForegroundColor Gray
Start-Process -FilePath $installer -ArgumentList "/S" -Wait
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 GitHub-Release gefunden" -ForegroundColor Red
}
} catch {
Write-Host " FEHLER beim Abrufen des GitHub-Releases: $_" -ForegroundColor Red
}
}
function Copy-GitHub-DataFile-To-Desktop {
param($Repo, $Filter)
try {
$asset = Get-GitHub-Latest-Asset -Repo $Repo -Filter $Filter
if (-not $asset) {
Write-Host " WARNUNG: Kein Asset '$Filter' im GitHub-Release gefunden" -ForegroundColor Yellow
return
}
$destPath = Join-Path $desktopPath $asset.name
if (Test-Path $destPath) {
Write-Host " $($asset.name) bereits vorhanden - ueberspringe." -ForegroundColor Gray
return
}
if (Download-File -Url $asset.browser_download_url -Output $destPath) {
Write-Host " $($asset.name) auf Desktop!" -ForegroundColor Green
}
} catch {
Write-Host " FEHLER beim Laden der GitHub-Datei: $_" -ForegroundColor Red
}
}
# 1. PYTHON
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
} else {
$pythonUrl = "https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe"
$pythonInstaller = "$tempDir\python-installer.exe"
if (Download-File -Url $pythonUrl -Output $pythonInstaller) {
Write-Host " Installiere Python (silent)..." -ForegroundColor Gray
Start-Process -FilePath $pythonInstaller -ArgumentList "/quiet", "InstallAllUsers=1", "PrependPath=1", "Include_pip=1" -Wait
Write-Host " Python installiert!" -ForegroundColor Green
}
}
# 2. FFMPEG
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 {
$ffmpegZip = "$tempDir\ffmpeg.zip"
$ffmpegAsset = Get-Gitea-Latest-Asset -Repo "ffmpeg" -Filter "*.zip"
if ($ffmpegAsset -and (Download-File -Url $ffmpegAsset.browser_download_url -Output $ffmpegZip)) {
Write-Host " Entpacke FFmpeg nach C:\ffmpeg..." -ForegroundColor Gray
if (Test-Path "C:\ffmpeg") { Remove-Item -Path "C:\ffmpeg" -Recurse -Force }
Expand-Archive -Path $ffmpegZip -DestinationPath $tempDir -Force
$ffmpegExtracted = Get-ChildItem -Path $tempDir -Directory | Where-Object { $_.Name -like "ffmpeg-*" } | Select-Object -First 1
if ($ffmpegExtracted) {
Move-Item -Path $ffmpegExtracted.FullName -Destination "C:\ffmpeg" -Force
Write-Host " FFmpeg entpackt!" -ForegroundColor Green
}
}
}
$currentPath = [Environment]::GetEnvironmentVariable("Path", "Machine")
if ($currentPath -notlike "*C:\ffmpeg\bin*") {
Write-Host " Setze PATH Variable..." -ForegroundColor Gray
[Environment]::SetEnvironmentVariable("Path", "$currentPath;C:\ffmpeg\bin", "Machine")
Write-Host " PATH aktualisiert!" -ForegroundColor Green
}
# 3. WINRAR
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"
$winrarInstaller = "$tempDir\winrar-installer.exe"
if (Download-File -Url $winrarUrl -Output $winrarInstaller) {
Write-Host " Installiere WinRAR (silent)..." -ForegroundColor Gray
Start-Process -FilePath $winrarInstaller -ArgumentList "/S" -Wait
Write-Host " WinRAR installiert!" -ForegroundColor Green
}
}
# 4. G-EARTH (von Gitea - nach WinRAR, damit wir entpacken koennen)
Write-Host ""
Write-Host "[4/$totalSteps] G-Earth..." -ForegroundColor Yellow
if (Test-Path "$desktopPath\G-Earth") {
Write-Host " Bereits vorhanden - ueberspringe." -ForegroundColor Gray
} else {
try {
Write-Host " Hole neueste Version von Gitea..." -ForegroundColor Gray
$releaseApi = "$giteaBaseUrl/api/v1/repos/Administrator/G-Earth/releases?limit=1"
$wc = New-Object System.Net.WebClient
$wc.Headers.Add("User-Agent", "Mozilla/5.0")
$release = ($wc.DownloadString($releaseApi) | ConvertFrom-Json)
$rarAsset = $release[0].assets | Where-Object { $_.name -like "*.rar" } | Select-Object -First 1
if ($rarAsset) {
$gearthRar = "$tempDir\$($rarAsset.name)"
Write-Host " Version: $($release[0].tag_name)" -ForegroundColor Gray
if (Download-File -Url $rarAsset.browser_download_url -Output $gearthRar) {
Write-Host " Entpacke G-Earth auf Desktop..." -ForegroundColor Gray
# In temp entpacken, dann nach G-Earth umbenennen (RAR-Ordnername aendert sich je Version)
$gearthTemp = "$tempDir\G-Earth-extract"
New-Item -ItemType Directory -Force -Path $gearthTemp | Out-Null
if (Unrar-File -RarPath $gearthRar -DestPath $gearthTemp) {
# Finde den entpackten Ordner (z.B. "G-Earth 1.5.4")
$extracted = Get-ChildItem -Path $gearthTemp -Directory | Where-Object { $_.Name -like "G-Earth*" } | Select-Object -First 1
if ($extracted) {
Move-Item -Path $extracted.FullName -Destination "$desktopPath\G-Earth" -Force
} else {
# Falls die Dateien direkt im Ordner liegen
Move-Item -Path $gearthTemp -Destination "$desktopPath\G-Earth" -Force
}
Write-Host " G-Earth installiert!" -ForegroundColor Green
}
}
} else {
Write-Host " FEHLER: Kein .rar-Asset im Release gefunden" -ForegroundColor Red
}
} catch {
Write-Host " FEHLER beim Abrufen der Gitea-Release: $_" -ForegroundColor Red
}
}
# 5. VLC
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 {
$vlcUrl = "https://ftp.fau.de/videolan/vlc/3.0.21/win64/vlc-3.0.21-win64.exe"
$vlcInstaller = "$tempDir\vlc-installer.exe"
if (Download-File -Url $vlcUrl -Output $vlcInstaller) {
Write-Host " Installiere VLC (silent)..." -ForegroundColor Gray
Start-Process -FilePath $vlcInstaller -ArgumentList "/S", "/L=1031" -Wait
Write-Host " VLC installiert!" -ForegroundColor Green
}
}
# 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
} else {
$javaUrl = "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u432-b06/OpenJDK8U-jre_x64_windows_hotspot_8u432b06.msi"
$javaInstaller = "$tempDir\java8.msi"
if (Download-File -Url $javaUrl -Output $javaInstaller) {
Write-Host " Installiere Java 8 (silent)..." -ForegroundColor Gray
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i", $javaInstaller, "/quiet", "/norestart" -Wait
Write-Host " Java 8 installiert!" -ForegroundColor Green
}
}
# 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
} else {
$netUrl = "https://go.microsoft.com/fwlink/?linkid=2088631"
$netInstaller = "$tempDir\dotnet48.exe"
if (Download-File -Url $netUrl -Output $netInstaller) {
Write-Host " Installiere .NET Framework 4.8 (silent)..." -ForegroundColor Gray
Start-Process -FilePath $netInstaller -ArgumentList "/q", "/norestart" -Wait
Write-Host " .NET Framework 4.8 installiert!" -ForegroundColor Green
}
}
# 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
} else {
$net6Installer = "$tempDir\dotnet6-desktop.exe"
$net6Asset = Get-Gitea-Latest-Asset -Repo "dotnet-runtimes" -Filter "*6.0*"
if ($net6Asset -and (Download-File -Url $net6Asset.browser_download_url -Output $net6Installer)) {
Write-Host " Installiere .NET 6.0 Desktop Runtime (silent)..." -ForegroundColor Gray
Start-Process -FilePath $net6Installer -ArgumentList "/install", "/quiet", "/norestart" -Wait
Write-Host " .NET 6.0 Desktop Runtime installiert!" -ForegroundColor Green
}
}
# 9. .NET 8.0 DESKTOP RUNTIME
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
} else {
$net8Installer = "$tempDir\dotnet8-desktop.exe"
$net8Asset = Get-Gitea-Latest-Asset -Repo "dotnet-runtimes" -Filter "*8.0*"
if ($net8Asset -and (Download-File -Url $net8Asset.browser_download_url -Output $net8Installer)) {
Write-Host " Installiere .NET 8.0 Desktop Runtime (silent)..." -ForegroundColor Gray
Start-Process -FilePath $net8Installer -ArgumentList "/install", "/quiet", "/norestart" -Wait
Write-Host " .NET 8.0 Desktop Runtime installiert!" -ForegroundColor Green
}
}
# 10. GOOGLE CHROME
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
} else {
$chromeUrl = "https://dl.google.com/chrome/install/latest/chrome_installer.exe"
$chromeInstaller = "$tempDir\chrome_installer.exe"
if (Download-File -Url $chromeUrl -Output $chromeInstaller) {
Write-Host " Installiere Google Chrome (silent)..." -ForegroundColor Gray
Start-Process -FilePath $chromeInstaller -ArgumentList "/silent", "/install" -Wait
Write-Host " Google Chrome installiert!" -ForegroundColor Green
}
}
# 11. HABBO LAUNCHER (von Gitea)
Install-Gitea-App -Name "Habbo Launcher" -Repo "Habbo-Launcher" `
-StepNum 11 `
-DetectPaths @("$env:LOCALAPPDATA\Programs\habbo-launcher\Habbo Launcher.exe", "C:\Program Files\Habbo Launcher\*") `
-ProcessName "Habbo Launcher"
# 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 $jdDetectPaths) {
if (Test-Path "$p\JDownloader2.exe") { $jdPath = $p; break }
}
if ($jdPath) {
Write-Host " Bereits installiert - ueberspringe." -ForegroundColor Gray
} else {
# JDownloader Installer von Gitea holen
$jdAsset = Get-Gitea-Latest-Asset -Repo "JDownloader-Setup" -Filter "*Setup*.exe"
$jdInstaller = "$tempDir\JDownloader2Setup.exe"
if ($jdAsset -and (Download-File -Url $jdAsset.browser_download_url -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
}
}
}
# 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
# Backup zuerst lokal suchen, dann von Gitea laden
$backupZip = $null
$scriptPath = $MyInvocation.MyCommand.Path
if ($scriptPath) {
$localZip = Join-Path (Split-Path -Parent $scriptPath) "jdownloader-backup.zip"
if (Test-Path $localZip) { $backupZip = $localZip }
}
if (-not $backupZip) {
Write-Host " Lade Backup von Gitea..." -ForegroundColor Gray
$backupZip = "$tempDir\jdownloader-backup.zip"
try {
$backupAsset = Get-Gitea-Latest-Asset -Repo "JDownloader-Setup" -Filter "*backup*.zip"
if ($backupAsset) {
Download-File -Url $backupAsset.browser_download_url -Output $backupZip | Out-Null
}
} catch {
Write-Host " WARNUNG: Backup konnte nicht von Gitea geladen werden" -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
}
# 13. DESKTOP ORDNER + FILE-UPLOADER
Write-Host ""
Write-Host "[13/$totalSteps] Desktop Ordner..." -ForegroundColor Yellow
foreach ($folder in @("Downloader Fertig", "Downloader Unfertig", "Entpackt")) {
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
}
}
if (Test-Path "$desktopPath\File-Uploader") {
Write-Host " File-Uploader bereits vorhanden - ueberspringe." -ForegroundColor Gray
} else {
Write-Host " Hole File-Uploader von Gitea..." -ForegroundColor Gray
try {
$fuAsset = Get-Gitea-Latest-Asset -Repo "File-Uploader" -Filter "*.rar"
} catch { $fuAsset = $null }
$uploaderRar = "$tempDir\FileUploader.rar"
if ($fuAsset -and (Download-File -Url $fuAsset.browser_download_url -Output $uploaderRar)) {
if (Unrar-File -RarPath $uploaderRar -DestPath $desktopPath) {
Write-Host " File-Uploader installiert!" -ForegroundColor Green
}
}
}
# 14. SCRIPTE
Write-Host ""
Write-Host "[14/$totalSteps] Scripte..." -ForegroundColor Yellow
if (Test-Path "$desktopPath\Rename MKV AVI.py") {
Write-Host " Bereits vorhanden - ueberspringe." -ForegroundColor Gray
} else {
try {
$scriptAsset = Get-Gitea-Latest-Asset -Repo "xabbo-scripts" -Filter "*.rar"
} catch { $scriptAsset = $null }
$scripteRar = "$tempDir\Scripte.rar"
if ($scriptAsset -and (Download-File -Url $scriptAsset.browser_download_url -Output $scripteRar)) {
Write-Host " Entpacke Scripte auf Desktop..." -ForegroundColor Gray
if (Unrar-File -RarPath $scripteRar -DestPath $desktopPath) {
Write-Host " Scripte 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"
# 16. MULTI-HOSTER-UPLOAD (von Gitea)
Write-Host " Quelle: $multiHosterSourceUrl (latest Release)" -ForegroundColor Gray
Install-Gitea-App -Name "Multi-Hoster-Upload" -Repo $multiHosterRepo `
-StepNum 16 `
-DetectPaths @("$env:LOCALAPPDATA\Programs\multi-hoster-upload\Multi-Hoster-Upload.exe", "$desktopPath\Multi-Hoster-Upload.lnk") `
-ProcessName "Multi-Hoster-Upload"
# 17. REAL-DEBRID-DOWNLOADER (von GitHub)
Install-GitHub-App -Name "Real-Debrid-Downloader" -Repo $githubDownloaderRepo `
-StepNum 17 `
-DetectPaths @("$env:LOCALAPPDATA\Programs\real-debrid-downloader\Real-Debrid-Downloader.exe", "$desktopPath\Real-Debrid-Downloader.lnk") `
-ProcessName "Real-Debrid-Downloader"
Copy-GitHub-DataFile-To-Desktop -Repo $githubDownloaderRepo -Filter "*.mdd"
# 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}"
if (Test-Path $ieAdminKey) {
Set-ItemProperty -Path $ieAdminKey -Name "IsInstalled" -Value 0 -Type DWord -Force
}
if (Test-Path $ieUserKey) {
Set-ItemProperty -Path $ieUserKey -Name "IsInstalled" -Value 0 -Type DWord -Force
}
# Taskansicht-Schaltflaeche ausblenden
Write-Host " Taskansicht-Button ausblenden..." -ForegroundColor Gray
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Value 0 -Type DWord -Force
# Suchfeld ausblenden
Write-Host " Suchfeld ausblenden..." -ForegroundColor Gray
if (-not (Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Value 0 -Type DWord -Force
# Desktop kleine Symbole
Write-Host " Desktop auf kleine Symbole..." -ForegroundColor Gray
$desktopRegPath = "HKCU:\SOFTWARE\Microsoft\Windows\Shell\Bags\1\Desktop"
if (-not (Test-Path $desktopRegPath)) {
New-Item -Path $desktopRegPath -Force | Out-Null
}
Set-ItemProperty -Path $desktopRegPath -Name "IconSize" -Value 32 -Type DWord -Force
Set-ItemProperty -Path $desktopRegPath -Name "Mode" -Value 1 -Type DWord -Force
Set-ItemProperty -Path $desktopRegPath -Name "LogicalViewMode" -Value 3 -Type DWord -Force
# Windows Update dauerhaft deaktivieren
Write-Host " Windows Update deaktivieren..." -ForegroundColor Gray
# Update-Service stoppen und auf "Deaktiviert" setzen
Stop-Service -Name "wuauserv" -Force -ErrorAction SilentlyContinue
Set-Service -Name "wuauserv" -StartupType Disabled -ErrorAction SilentlyContinue
# Orchestrator-Service (plant Updates im Hintergrund)
Stop-Service -Name "UsoSvc" -Force -ErrorAction SilentlyContinue
Set-Service -Name "UsoSvc" -StartupType Disabled -ErrorAction SilentlyContinue
# BITS (Background Intelligent Transfer Service - laedt Updates runter)
Stop-Service -Name "BITS" -Force -ErrorAction SilentlyContinue
Set-Service -Name "BITS" -StartupType Disabled -ErrorAction SilentlyContinue
# Registry: Automatische Updates komplett deaktivieren
$wuRegPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
if (-not (Test-Path $wuRegPath)) {
New-Item -Path $wuRegPath -Force | Out-Null
}
# NoAutoUpdate = 1 → Keine automatischen Updates
Set-ItemProperty -Path $wuRegPath -Name "NoAutoUpdate" -Value 1 -Type DWord -Force
# AUOptions = 1 → Nie nach Updates suchen
Set-ItemProperty -Path $wuRegPath -Name "AUOptions" -Value 1 -Type DWord -Force
Write-Host " Windows Update deaktiviert!" -ForegroundColor Green
# Energiesparplan auf Hoechstleistung setzen
Write-Host " Energiesparplan auf Hoechstleistung..." -ForegroundColor Gray
powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
Write-Host " Hoechstleistung aktiviert!" -ForegroundColor Green
# 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
Write-Host ""
Write-Host "Raeume auf..." -ForegroundColor Gray
Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue
Write-Host ""
Write-Host "========================================" -ForegroundColor Green
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