-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
29 lines (24 loc) · 1.01 KB
/
build.ps1
File metadata and controls
29 lines (24 loc) · 1.01 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
#!/usr/bin/env pwsh
# Build PyMacroRecorder standalone binary using pyinstaller (Windows)
$ErrorActionPreference = "Stop"
$ProjectRoot = Split-Path -Parent $MyInvocation.MyCommand.Definition
$DistDir = Join-Path $ProjectRoot "dist"
$BuildDir = Join-Path $ProjectRoot "build"
$SpecFile = Join-Path $ProjectRoot "PyMacroRecorder.spec"
$EntryPoint = Join-Path $ProjectRoot "main.py"
$IconFile = Join-Path $ProjectRoot "assets\logo.ico"
$AppName = "PyMacroRecorder"
# Clean previous outputs
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue $DistDir, $BuildDir, $SpecFile
# Run pyinstaller with icon and assets
# Add hidden imports for pynput backends (especially for Linux cross-compat)
pyinstaller --onefile --noconsole `
--name "$AppName" `
--icon "$IconFile" `
--add-data "assets;assets" `
--hidden-import pynput.keyboard._win32 `
--hidden-import pynput.mouse._win32 `
--distpath "$DistDir" `
--workpath "$BuildDir" `
"$EntryPoint"
Write-Output "Build complete. Binary located at: $DistDir\$AppName.exe"