22
33& " $PSScriptRoot /compile_resources.ps1"
44
5+ $ProjectRoot = " $PSScriptRoot /.."
56$SupportsSplashScreen = [System.Convert ]::ToBoolean($ (uv run -- active python - c " import _tkinter; print(hasattr(_tkinter, '__file__'))" ))
67
78$arguments = @ (
8- " $PSScriptRoot /.. /src/AutoSplit.py" ,
9+ " $ProjectRoot /src/AutoSplit.py" ,
910 ' --onefile' ,
1011 ' --windowed' ,
11- ' --additional-hooks-dir=Pyinstaller/hooks' ,
1212 ' --optimize 2' , # Remove asserts and docstrings for smaller build
13- " --add-data=pyproject.toml$ ( [System.IO.Path ]::PathSeparator) ." ,
14- ' --icon=res/icon.ico' )
13+ " --additional-hooks-dir=$ProjectRoot /Pyinstaller/hooks" ,
14+ " --add-data=$ProjectRoot /pyproject.toml$ ( [System.IO.Path ]::PathSeparator) ." ,
15+ " --upx-dir=$PSScriptRoot /.upx"
16+ " --icon=$ProjectRoot /res/icon.ico" )
1517if ($SupportsSplashScreen ) {
1618 # https://github.com/pyinstaller/pyinstaller/issues/9022
17- $arguments += @ (' --splash=res/splash.png' )
19+ $arguments += @ (" --splash=$ProjectRoot / res/splash.png" )
1820}
1921if ($IsWindows ) {
2022 $arguments += @ (
@@ -25,10 +27,10 @@ if ($IsWindows) {
2527Start-Process - Wait - NoNewWindow uv - ArgumentList $ (@ (' run' , ' --active' , ' pyinstaller' ) + $arguments )
2628
2729If ($IsLinux ) {
28- Move-Item - Force $PSScriptRoot / .. / dist/ AutoSplit $PSScriptRoot / .. / dist/ AutoSplit.elf
30+ Move-Item - Force $ProjectRoot / dist/ AutoSplit $ProjectRoot / dist/ AutoSplit.elf
2931 If ($? ) {
3032 Write-Host ' Added .elf extension'
3133 }
32- chmod + x $PSScriptRoot / .. / dist/ AutoSplit.elf
34+ chmod + x $ProjectRoot / dist/ AutoSplit.elf
3335 Write-Host ' Added execute permission'
3436}
0 commit comments