|
@@ -4,14 +4,23 @@ $RootDir = Split-Path -Parent $PSScriptRoot
|
|
|
Set-Location $RootDir
|
|
Set-Location $RootDir
|
|
|
|
|
|
|
|
$PythonBin = if ($env:PYTHON_BIN) { $env:PYTHON_BIN } else { ".\.venv\Scripts\python.exe" }
|
|
$PythonBin = if ($env:PYTHON_BIN) { $env:PYTHON_BIN } else { ".\.venv\Scripts\python.exe" }
|
|
|
-$PyInstallerBin = if ($env:PYINSTALLER_BIN) { $env:PYINSTALLER_BIN } else { ".\.venv\Scripts\pyinstaller.exe" }
|
|
|
|
|
|
|
|
|
|
if (-not (Test-Path $PythonBin)) {
|
|
if (-not (Test-Path $PythonBin)) {
|
|
|
Write-Error "Python executable not found: $PythonBin"
|
|
Write-Error "Python executable not found: $PythonBin"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-if (-not (Test-Path $PyInstallerBin)) {
|
|
|
|
|
- Write-Error "PyInstaller executable not found: $PyInstallerBin`nInstall it with: uv pip install --python .\.venv\Scripts\python.exe pyinstaller"
|
|
|
|
|
|
|
+if ($env:PYINSTALLER_BIN) {
|
|
|
|
|
+ $PyInstallerBin = $env:PYINSTALLER_BIN
|
|
|
|
|
+ if (-not (Test-Path $PyInstallerBin)) {
|
|
|
|
|
+ Write-Error "PyInstaller executable not found: $PyInstallerBin"
|
|
|
|
|
+ }
|
|
|
|
|
+ $PyInstallerDescription = $PyInstallerBin
|
|
|
|
|
+} else {
|
|
|
|
|
+ & $PythonBin -c "import PyInstaller" *> $null
|
|
|
|
|
+ if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
+ Write-Error "PyInstaller is not installed in: $PythonBin`nInstall it with: uv pip install --python .\.venv\Scripts\python.exe pyinstaller"
|
|
|
|
|
+ }
|
|
|
|
|
+ $PyInstallerDescription = "$PythonBin -m PyInstaller"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$Version = (& $PythonBin -c "from pathlib import Path; import tomllib; print(tomllib.loads(Path('pyproject.toml').read_text(encoding='utf-8'))['project']['version'])").Trim()
|
|
$Version = (& $PythonBin -c "from pathlib import Path; import tomllib; print(tomllib.loads(Path('pyproject.toml').read_text(encoding='utf-8'))['project']['version'])").Trim()
|
|
@@ -19,7 +28,7 @@ $ArchName = if ([Environment]::Is64BitOperatingSystem) { "x86_64" } else { "x86"
|
|
|
$MainOutput = "dist/mlog-tool-qt.exe"
|
|
$MainOutput = "dist/mlog-tool-qt.exe"
|
|
|
$VersionedOutput = "dist/mlog-tool-qt-v$Version-windows-$ArchName.exe"
|
|
$VersionedOutput = "dist/mlog-tool-qt-v$Version-windows-$ArchName.exe"
|
|
|
|
|
|
|
|
-Write-Host "Building Qt executable with $PyInstallerBin"
|
|
|
|
|
|
|
+Write-Host "Building Qt executable with $PyInstallerDescription"
|
|
|
|
|
|
|
|
$ResetQtPlatform = $false
|
|
$ResetQtPlatform = $false
|
|
|
if (-not $env:QT_QPA_PLATFORM) {
|
|
if (-not $env:QT_QPA_PLATFORM) {
|
|
@@ -28,7 +37,11 @@ if (-not $env:QT_QPA_PLATFORM) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- & $PyInstallerBin --noconfirm --clean mlog_tool_qt.spec
|
|
|
|
|
|
|
+ if ($env:PYINSTALLER_BIN) {
|
|
|
|
|
+ & $PyInstallerBin --noconfirm --clean mlog_tool_qt.spec
|
|
|
|
|
+ } else {
|
|
|
|
|
+ & $PythonBin -m PyInstaller --noconfirm --clean mlog_tool_qt.spec
|
|
|
|
|
+ }
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
exit $LASTEXITCODE
|
|
exit $LASTEXITCODE
|
|
|
}
|
|
}
|