-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart-ZebraLabelTool.ps1
More file actions
48 lines (43 loc) · 1.47 KB
/
Start-ZebraLabelTool.ps1
File metadata and controls
48 lines (43 loc) · 1.47 KB
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
41
42
43
44
45
46
47
48
# Easy launcher for Zebra Label Tool (Windows PowerShell).
#
# Strategy: prefer a packaged binary in dist/, then a sibling exe,
# then a local .venv source install, otherwise print install hints.
#
# Run: .\Start-ZebraLabelTool.ps1
# or right-click -> Run with PowerShell.
$ErrorActionPreference = "Stop"
Set-Location -LiteralPath $PSScriptRoot
$candidates = @(
"dist/ZebraLabelTool.exe",
"ZebraLabelTool.exe"
)
foreach ($candidate in $candidates) {
$path = Join-Path $PSScriptRoot $candidate
if (Test-Path $path) {
Write-Host "Starting $candidate ..."
Start-Process -FilePath $path
return
}
}
$pythonw = Join-Path $PSScriptRoot ".venv/Scripts/pythonw.exe"
$main = Join-Path $PSScriptRoot "main.py"
if ((Test-Path $pythonw) -and (Test-Path $main)) {
Write-Host "Starting Python GUI from local .venv ..."
Start-Process -FilePath $pythonw -ArgumentList $main
return
}
Write-Host ""
Write-Host "Zebra Label Tool is not installed yet." -ForegroundColor Yellow
Write-Host ""
Write-Host "Either:"
Write-Host " * download ZebraLabelTool.exe from"
Write-Host " https://github.com/DevOpsOfChaos/zebra-label-tool/releases"
Write-Host " and put it next to this script,"
Write-Host " * or run the source setup once:"
Write-Host " py -m venv .venv"
Write-Host " .\.venv\Scripts\Activate.ps1"
Write-Host " pip install -r requirements.txt"
Write-Host " python main.py"
Write-Host ""
Read-Host "Press Enter to close" | Out-Null
exit 1