-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.ps1
More file actions
40 lines (33 loc) · 1011 Bytes
/
Copy pathbuild.ps1
File metadata and controls
40 lines (33 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$ErrorActionPreference = "Stop"
$pythonExe = $null
$pythonArgs = @()
if (Get-Command python -ErrorAction SilentlyContinue) {
$pythonExe = "python"
} elseif (Get-Command py -ErrorAction SilentlyContinue) {
$pythonExe = "py"
$pythonArgs = @("-3")
} else {
throw "Python was not found. Install Python 3, then run this script again."
}
function Invoke-BasePython {
& $pythonExe @pythonArgs @args
}
$venvPython = ".\.venv\Scripts\python.exe"
if (-not (Test-Path $venvPython)) {
Invoke-BasePython -m venv .venv
}
& $venvPython -m pip install --upgrade pip
& $venvPython -m pip install -r requirements.txt
& $venvPython -m PyInstaller `
--noconfirm `
--clean `
--onefile `
--windowed `
--name NovaPartsCalculator `
--manifest "NovaPartsCalculator.dpi.xml" `
--add-data "calculator.ui;." `
--add-data "partSelector.ui;." `
--add-data "typeSelector.ui;." `
--add-data "JSON;JSON" `
calculator.py
Write-Host "Built: dist\NovaPartsCalculator.exe"