Avoids the cmd.exe flash from double-clicking run_desktop.bat and gives a proper double-click .exe like VersaGUI.exe. Must be deployed locally (%LOCALAPPDATA%) -- Windows silently refuses to load the _internal DLLs when the .exe sits on the Z: network share, no error shown. build_and_deploy.ps1 handles build + local copy in one step.
26 lines
941 B
PowerShell
26 lines
941 B
PowerShell
# Baut VersaPadViewer.exe (PyInstaller --onedir) und kopiert das Ergebnis
|
|
# nach lokal (C:\Users\<user>\AppData\Local\VersaPadViewer).
|
|
#
|
|
# WICHTIG: Muss lokal laufen, NICHT direkt vom Netzlaufwerk (Z:\Git\...) --
|
|
# Windows blockiert das Nachladen der PyInstaller-_internal-DLLs von einem
|
|
# Netzwerkpfad (SMB-Share) ohne jede Fehlermeldung, der Prozess startet
|
|
# einfach nie. Deshalb bauen wir hier (Quelle darf auf Z: liegen) und
|
|
# kopieren das fertige Bundle danach nach C:.
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$projectDir = $PSScriptRoot
|
|
$localDir = "$env:LOCALAPPDATA\VersaPadViewer"
|
|
|
|
Push-Location $projectDir
|
|
try {
|
|
py -m PyInstaller --windowed --onedir --name VersaPadViewer desktop_viewer.py --noconfirm
|
|
} finally {
|
|
Pop-Location
|
|
}
|
|
|
|
if (Test-Path $localDir) {
|
|
Remove-Item $localDir -Recurse -Force
|
|
}
|
|
Copy-Item "$projectDir\dist\VersaPadViewer" -Destination $localDir -Recurse
|
|
|
|
Write-Host "Fertig: $localDir\VersaPadViewer.exe"
|