# Baut rippy.ico + RippyWorkerSetup.exe aus install-gui.ps1 (ps2exe). # # WANN NEU BAUEN: nur wenn sich install-gui.ps1 (die Installer-Oberflaeche) # aendert. NICHT bei MakeMKV-/HandBrake-Updates - die .exe holt HandBrake zur # Laufzeit (GitHub latest) und den Worker-Code live von Rippy, friert also # keine Versionen ein. # AUSFUEHREN AUF WINDOWS (eine Windows-.exe kann nicht von Linux gebaut werden): # powershell -ExecutionPolicy Bypass -File build-exe.ps1 # Danach RippyWorkerSetup.exe committen (die API serviert sie). $ErrorActionPreference = "Stop" Add-Type -AssemblyName System.Drawing Set-Location $PSScriptRoot $guiSrc = Join-Path $PSScriptRoot "install-gui.ps1" # 1. Rippy-Disc-Icon 256x256 zeichnen -> PNG -> ICO-Container $bmp = New-Object System.Drawing.Bitmap 256, 256 $g = [System.Drawing.Graphics]::FromImage($bmp) $g.SmoothingMode = "AntiAlias" $g.Clear([System.Drawing.Color]::Transparent) $g.FillEllipse((New-Object System.Drawing.SolidBrush ([System.Drawing.Color]::FromArgb(99, 102, 241))), 8, 8, 240, 240) $g.FillEllipse((New-Object System.Drawing.SolidBrush ([System.Drawing.Color]::FromArgb(147, 51, 234))), 40, 40, 176, 176) $g.FillEllipse([System.Drawing.Brushes]::White, 104, 104, 48, 48) $ms = New-Object System.IO.MemoryStream $bmp.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png) $png = $ms.ToArray() $icoStream = New-Object System.IO.MemoryStream $bw = New-Object System.IO.BinaryWriter $icoStream $bw.Write([UInt16]0); $bw.Write([UInt16]1); $bw.Write([UInt16]1) # ICONDIR $bw.Write([Byte]0); $bw.Write([Byte]0); $bw.Write([Byte]0); $bw.Write([Byte]0) # 256x256, colors, res $bw.Write([UInt16]1); $bw.Write([UInt16]32) # planes, bpp $bw.Write([UInt32]$png.Length); $bw.Write([UInt32]22) # size, offset $bw.Write($png); $bw.Flush() [System.IO.File]::WriteAllBytes("$PSScriptRoot\rippy.ico", $icoStream.ToArray()) Write-Host "rippy.ico erzeugt ($($png.Length) Bytes PNG)" # 2. ps2exe sicherstellen - TLS 1.2 ist der Fix fuer den NuGet-Bootstrap-Fehler [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072 if (-not (Get-Module -ListAvailable ps2exe)) { Write-Host "Bootstrappe NuGet + PSGallery ..." try { Get-PackageProvider -Name NuGet -ErrorAction Stop | Out-Null } catch { Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope CurrentUser | Out-Null } Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -ErrorAction SilentlyContinue Write-Host "Installiere ps2exe ..." Install-Module ps2exe -Scope CurrentUser -Force -AllowClobber } Import-Module ps2exe # 3. Kompilieren (WinForms -> noConsole + STA, Icon eingebettet) Invoke-ps2exe -inputFile $guiSrc -outputFile "$PSScriptRoot\RippyWorkerSetup.exe" ` -iconFile "$PSScriptRoot\rippy.ico" -noConsole -STA ` -title "Rippy Worker Setup" -product "Rippy" -company "Rippy" -version "1.0.0.0" if (Test-Path "$PSScriptRoot\RippyWorkerSetup.exe") { Write-Host "OK: RippyWorkerSetup.exe = $((Get-Item "$PSScriptRoot\RippyWorkerSetup.exe").Length) Bytes" } else { Write-Host "FEHLER: keine .exe erzeugt" }