Repository navigation
Expand file tree
/
Copy pathbuild_release.ps1
More file actions
42 lines (32 loc) · 2.4 KB
/
Copy pathbuild_release.ps1
File metadata and controls
42 lines (32 loc) · 2.4 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
$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $root
if (Test-Path .\.vendor) { Remove-Item .\.vendor -Recurse -Force }
New-Item -ItemType Directory -Force .\.vendor | Out-Null
python -m pip install --target .\.vendor -r .\requirements.txt
python -m pip install -r .\requirements-dev.txt
python .\scripts\generate_branding.py
python .\scripts\capture_screenshots.py
if (Test-Path .\build) { Remove-Item .\build -Recurse -Force }
if (Test-Path .\dist) { Remove-Item .\dist -Recurse -Force }
if (Test-Path .\release\portable) { Remove-Item .\release\portable -Recurse -Force }
if (Test-Path .\release\installer_payload) { Remove-Item .\release\installer_payload -Recurse -Force }
python -m PyInstaller --noconfirm --clean --onefile --windowed --name winddrescue-ui --icon .\docs\assets\winddrescue.ico --version-file .\resources\windows-version-info.txt --paths .\.vendor --collect-all tkinterdnd2 .\winddrescue_ui.py
python -m PyInstaller --noconfirm --clean --onefile --name winddrescue --icon .\docs\assets\winddrescue.ico --version-file .\resources\windows-version-info.txt .\winddrescue.py
python -m PyInstaller --noconfirm --clean --onefile --windowed --name winddrescue-installer --icon .\docs\assets\winddrescue.ico --version-file .\resources\windows-version-info.txt --add-data "dist\winddrescue-ui.exe;." --add-data "dist\winddrescue.exe;." --add-data "README.md;." --add-data "LICENSE;." --add-data "CHANGELOG.md;." .\scripts\installer_runner.py
New-Item -ItemType Directory -Force .\release\portable | Out-Null
Copy-Item .\dist\winddrescue-ui.exe .\release\portable\winddrescue-ui.exe -Force
Copy-Item .\dist\winddrescue.exe .\release\portable\winddrescue.exe -Force
Copy-Item .\README.md .\release\portable\README.md -Force
Copy-Item .\LICENSE .\release\portable\LICENSE -Force
Copy-Item .\CHANGELOG.md .\release\portable\CHANGELOG.md -Force
if (Test-Path .\release\winddrescue-portable.zip) {
Remove-Item .\release\winddrescue-portable.zip -Force
}
Compress-Archive -Path .\release\portable\* -DestinationPath .\release\winddrescue-portable.zip -Force
if (Test-Path .\release\winddrescue-installer.exe) {
Remove-Item .\release\winddrescue-installer.exe -Force
}
Copy-Item .\dist\winddrescue-installer.exe .\release\winddrescue-installer.exe -Force
Write-Host "Portable ZIP: .\release\winddrescue-portable.zip"
Write-Host "Installer EXE: .\release\winddrescue-installer.exe"