| $ErrorActionPreference = "Stop" |
| Set-Location -LiteralPath $PSScriptRoot |
|
|
| $ErrorActionPreference = "Continue" |
| python -c "import PyInstaller" 2>$null |
| $pyInstallerMissing = $LASTEXITCODE -ne 0 |
| $ErrorActionPreference = "Stop" |
| if ($pyInstallerMissing) { |
| python -m pip install pyinstaller |
| if ($LASTEXITCODE -ne 0) { throw "PyInstaller installation failed." } |
| } |
|
|
| python -c "from PIL import Image; image=Image.open(r'assets/adam_atom.png').convert('RGBA'); image.save(r'assets/adam_atom.ico', sizes=[(16,16),(24,24),(32,32),(48,48),(64,64),(128,128),(256,256)])" |
| if ($LASTEXITCODE -ne 0) { throw "ADAM icon creation failed." } |
|
|
| python -m PyInstaller --noconfirm ADAM.spec |
| if ($LASTEXITCODE -ne 0) { throw "ADAM executable build failed." } |
|
|
| $portableAssets = Join-Path $PSScriptRoot "dist\ADAM\assets" |
| New-Item -ItemType Directory -Force -Path $portableAssets | Out-Null |
| Copy-Item -LiteralPath (Join-Path $PSScriptRoot "assets\adam_atom.png") -Destination $portableAssets -Force |
|
|
| Write-Host "" |
| Write-Host "ADAM.exe was created at:" |
| Write-Host (Join-Path $PSScriptRoot "dist\ADAM\ADAM.exe") |
|
|