navpoint/build-windows.ps1

13 lines
751 B
PowerShell
Raw Normal View History

2024-07-30 09:26:07 -07:00
$version = (Get-Content -Path README.md -TotalCount 1).Split()[3]
$distName = "navpoint-$version-windows-$env:PROCESSOR_ARCHITECTURE"
Remove-Item -Path "dist\$distName-*"
2024-07-30 10:05:32 -07:00
pyinstaller --icon "icon.ico" --windowed --onefile --hidden-import "tornado.web" --add-data "icon.ico:files" --add-data "README.md:files" --add-data "GPL-3.0.txt:files" --add-data "CC-BY-SA-4.0.txt:files" --name "navpoint.exe" "main.py"
(Get-Content ".\windows_installer.nsi" -Raw).Replace("<<version>>", "$version").Replace("<<distName>>", "$distName") | Out-File ".\temp_installer.nsi"
& "C:\Program Files (x86)\NSIS\makensis.exe" ".\temp_installer.nsi"
Remove-Item -Path ".\temp_installer.nsi"
Move-Item -Path "dist\navpoint.exe" -Destination "dist\$distName-portable.exe"