feat: G-Earth now downloads latest release from Gitea
Fetches newest .rar from git.24-music.de/Administrator/G-Earth, extracts to temp dir, then moves to Desktop\G-Earth with a consistent folder name regardless of version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0c99ecf248
commit
9cd9581563
@ -140,20 +140,45 @@ if (Test-Path $winrarPath) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# 4. G-EARTH (nach WinRAR, damit wir entpacken koennen)
|
# 4. G-EARTH (von Gitea - nach WinRAR, damit wir entpacken koennen)
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "[4/$totalSteps] G-Earth..." -ForegroundColor Yellow
|
Write-Host "[4/$totalSteps] G-Earth..." -ForegroundColor Yellow
|
||||||
if (Test-Path "$desktopPath\G-Earth") {
|
if (Test-Path "$desktopPath\G-Earth") {
|
||||||
Write-Host " Bereits vorhanden - ueberspringe." -ForegroundColor Gray
|
Write-Host " Bereits vorhanden - ueberspringe." -ForegroundColor Gray
|
||||||
} else {
|
} else {
|
||||||
$gearthUrl = "https://streamerware.de/G-earth.rar"
|
try {
|
||||||
$gearthRar = "$tempDir\G-earth.rar"
|
Write-Host " Hole neueste Version von Gitea..." -ForegroundColor Gray
|
||||||
if (Download-File -Url $gearthUrl -Output $gearthRar) {
|
$releaseApi = "https://git.24-music.de/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
|
Write-Host " Entpacke G-Earth auf Desktop..." -ForegroundColor Gray
|
||||||
if (Unrar-File -RarPath $gearthRar -DestPath $desktopPath) {
|
# 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
|
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
|
# 5. VLC
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user