feat(installer): fertige .exe mit Rippy-Icon + ohne Konsolenfenster (statt .vbs)
Ampel / ampel (push) Successful in 28s
Ampel / ampel (push) Successful in 28s
Commander-Einwand: .vbs ist abgekuendigt (Win11 24H2 Feature-on-Demand) und wird oft als gefaehrlich geflaggt. Loesung: echte .exe. - RippyWorkerSetup.exe (50 KB): install-gui.ps1 via ps2exe kompiliert — eingebettetes Rippy-Disc-Icon (deploy/worker-windows/rippy.ico), kein Konsolenfenster (-noConsole), WinForms (-STA). E2E getestet: Fenster oeffnet, conhost-Zaehler unveraendert (kein Konsolenfenster). Vorgebaut auf Windows (build-exe.ps1) + committet — eine Windows-.exe kann nicht von Linux (Rippy-Host) gebaut werden. WICHTIG: friert KEINE Versionen ein — HandBrake wird zur Laufzeit (GitHub latest) und der Worker-Code live von Rippy geholt; nur bei GUI-Aenderungen neu bauen. - API: GET /worker-setup/windows-exe (FileResponse); Dockerfile kopiert die .exe ins Image. .gitattributes: *.exe/*.ico als binary. - UI (Worker -> Windows): 'Installer herunterladen (.exe)' als Haupt-Weg (generisch, GUI fragt Adresse ab; die einzutragende IP wird als Hinweis angezeigt). .vbs-Erzeugung entfernt. CLI bleibt Profi-Alternative. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,5 +22,9 @@ COPY docker/api/ .
|
||||
# die Zielmaschine braucht weder git noch Docker.
|
||||
COPY docker/worker/*.py docker/worker/requirements.txt worker_dist/
|
||||
COPY deploy/worker-windows/install.ps1 deploy/worker-windows/install-gui.ps1 worker_dist/
|
||||
# Vorgebaute .exe (Rippy-Icon, kein Konsolenfenster) — auf Windows via
|
||||
# deploy/worker-windows/build-exe.ps1 erzeugt (Windows-.exe geht nicht von
|
||||
# Linux). Nur bei GUI-Aenderungen neu bauen, nicht bei Tool-Updates.
|
||||
COPY deploy/worker-windows/RippyWorkerSetup.exe worker_dist/
|
||||
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--app-dir", "/app"]
|
||||
|
||||
+18
-2
@@ -1091,14 +1091,30 @@ async def worker_setup_windows():
|
||||
|
||||
@app.get("/worker-setup/windows-gui")
|
||||
async def worker_setup_windows_gui():
|
||||
"""Grafischer Windows-Installer (WinForms) — vom .bat-Launcher geladen und
|
||||
gestartet, damit der Nutzer ein Fenster statt CLI bekommt."""
|
||||
"""Grafischer Windows-Installer (WinForms, PowerShell-Quelle) — Rückfall
|
||||
für Fortgeschrittene; der Normalweg ist die .exe unten."""
|
||||
pfad = "worker_dist/install-gui.ps1"
|
||||
if not os.path.isfile(pfad):
|
||||
raise HTTPException(status_code=404, detail="GUI-Installer nicht im Image — API neu bauen")
|
||||
return FileResponse(pfad, media_type="text/plain", filename="rippy-worker-gui.ps1")
|
||||
|
||||
|
||||
@app.get("/worker-setup/windows-exe")
|
||||
async def worker_setup_windows_exe():
|
||||
"""Fertige Windows-Installer-.exe (Rippy-Icon, kein Konsolenfenster).
|
||||
|
||||
Vorgebaut auf Windows (deploy/worker-windows/build-exe.ps1) — eine
|
||||
Windows-.exe lässt sich nicht auf Linux bauen. Generisch: die GUI fragt
|
||||
die Rippy-Adresse selbst ab, HandBrake + Worker-Code kommen zur Laufzeit."""
|
||||
pfad = "worker_dist/RippyWorkerSetup.exe"
|
||||
if not os.path.isfile(pfad):
|
||||
raise HTTPException(status_code=404, detail="Installer-.exe nicht im Image — API neu bauen")
|
||||
return FileResponse(
|
||||
pfad, media_type="application/vnd.microsoft.portable-executable",
|
||||
filename="RippyWorkerSetup.exe",
|
||||
)
|
||||
|
||||
|
||||
@app.get("/worker-setup/paket")
|
||||
async def worker_setup_paket():
|
||||
"""Worker-Quellcode als Zip — der Windows-Installer lädt ihn von hier.
|
||||
|
||||
@@ -91,28 +91,14 @@ export default function WorkerVerwaltung() {
|
||||
})
|
||||
}
|
||||
|
||||
// Grafischer Installer: erzeugt eine .vbs CLIENT-seitig mit der eingetragenen
|
||||
// LAN-IP (der Browser kennt sie, die API nicht sicher). Doppelklick startet
|
||||
// via wscript PowerShell KOMPLETT VERSTECKT (kein Konsolenfenster) und lädt
|
||||
// den WinForms-Installer von Rippy — nur das Installer-Fenster erscheint.
|
||||
const guiInstallerHerunterladen = () => {
|
||||
const host = rippyHost.trim()
|
||||
if (!host) { toast('error', 'Erst die LAN-IP der Rippy-Maschine eintragen'); return }
|
||||
const ps = `try { Invoke-WebRequest 'http://${host}/api/worker-setup/windows-gui' -OutFile ($env:TEMP + '\\rippy-gui.ps1') -UseBasicParsing; & ($env:TEMP + '\\rippy-gui.ps1') -RippyHost '${host}' } catch { Add-Type -AssemblyName System.Windows.Forms; [void][System.Windows.Forms.MessageBox]::Show($_.Exception.Message, 'Rippy Installer') }`
|
||||
// VBScript verdoppelt innere Anführungszeichen; Fensterstil 0 = versteckt
|
||||
const psEscaped = ps.replace(/"/g, '""')
|
||||
const vbs = [
|
||||
"' Rippy Encoding-Worker - grafische Installation (ohne Konsolenfenster)",
|
||||
'Set sh = CreateObject("WScript.Shell")',
|
||||
`sh.Run "powershell -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -STA -Command ""${psEscaped}""", 0, False`,
|
||||
].join('\r\n')
|
||||
const blob = new Blob([vbs], { type: 'application/octet-stream' })
|
||||
// Fertige Installer-.exe (Rippy-Icon, kein Konsolenfenster) direkt laden.
|
||||
// Generisch — die GUI fragt die Rippy-Adresse selbst ab.
|
||||
const exeHerunterladen = () => {
|
||||
const a = document.createElement('a')
|
||||
a.href = URL.createObjectURL(blob)
|
||||
a.download = 'rippy-worker-setup.vbs'
|
||||
a.href = '/api/worker-setup/windows-exe'
|
||||
a.download = 'RippyWorkerSetup.exe'
|
||||
document.body.appendChild(a); a.click(); a.remove()
|
||||
URL.revokeObjectURL(a.href)
|
||||
toast('success', 'rippy-worker-setup.vbs heruntergeladen — doppelklicken zum Installieren')
|
||||
toast('success', 'RippyWorkerSetup.exe wird heruntergeladen — doppelklicken zum Installieren')
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -224,20 +210,24 @@ export default function WorkerVerwaltung() {
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Windows: grafischer Installer als Haupt-Weg (Doppelklick statt CLI) */}
|
||||
{/* Windows: fertige .exe als Haupt-Weg (Doppelklick, Icon, kein Konsolenfenster) */}
|
||||
{variante === 'windows' && (
|
||||
<div className="rounded-xl p-4 border border-amber-500/30 bg-amber-500/5 space-y-2">
|
||||
<p className="text-sm text-slate-700 dark:text-slate-300">
|
||||
<strong>Einfachster Weg:</strong> grafischen Installer herunterladen, doppelklicken,
|
||||
Fenster ausfüllen, „Installieren". Braucht nur Python 3.10+ auf dem PC — kein Docker, kein git.
|
||||
<strong>Einfachster Weg:</strong> Installer (.exe) herunterladen, doppelklicken,
|
||||
im Fenster Adresse + Name eintragen, „Installieren". Kein Konsolenfenster.
|
||||
Braucht nur Python 3.10+ auf dem PC — kein Docker, kein git.
|
||||
</p>
|
||||
<Button variant="amber" onClick={guiInstallerHerunterladen} disabled={!rippyHost.trim()}>
|
||||
<Download size={16} /> Grafischen Installer herunterladen
|
||||
<Button variant="amber" onClick={exeHerunterladen}>
|
||||
<Download size={16} /> Installer herunterladen (.exe)
|
||||
</Button>
|
||||
<p className="text-xs text-slate-700 dark:text-slate-300">
|
||||
Im Installer-Fenster als Rippy-Adresse eintragen: <code className="font-semibold">{rippyHost.trim() || '<LAN-IP der Rippy-Maschine>'}</code>
|
||||
</p>
|
||||
<p className="text-xs text-slate-500 dark:text-slate-400">
|
||||
Öffnet direkt das Installer-Fenster — kein Konsolenfenster. Windows warnt beim Doppelklick evtl.
|
||||
(„Windows hat Ihren PC geschützt") → „Weitere Informationen" → „Trotzdem ausführen". Die Datei
|
||||
lädt den Installer nur von deiner Rippy-Maschine.
|
||||
Windows warnt beim ersten Start evtl. („Windows hat Ihren PC geschützt", unbekannter Herausgeber)
|
||||
→ „Weitere Informationen" → „Trotzdem ausführen". Die .exe holt Worker-Code und HandBrake nur von
|
||||
deiner Rippy-Maschine bzw. dem offiziellen HandBrake-Release.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user