[packaging] (Windows) Ability to run "generate_windows_installers.ps1" from any location.

This commit is contained in:
Alexandr Stelnykovych
2025-03-06 15:21:38 +02:00
parent 911255e1d2
commit 260449e59b
2 changed files with 35 additions and 27 deletions

View File

@@ -39,7 +39,7 @@
}
},
"productName": "Portmaster",
"version": "0.1.0",
"version": "0.1.0", // If removed the version number from Cargo.toml is used.
"identifier": "io.safing.portmaster", // this is added as a property to the shortcut on windows (ApplicationUserModelID). Used for notifications.
"app": {
"withGlobalTauri": true,

View File

@@ -128,6 +128,9 @@ function Find-And-Copy-File {
}
# >>>>>>>>>>>>>>>>>>>>>>> End Functions >>>>>>>>>>>>>>>>>>>>>>>>
# Set-Location relative to the script location "../.." (root of the project). So that the script can be run from any location.
Set-Location -Path (Join-Path -Path $PSScriptRoot -ChildPath "../..")
try {
# CONSTANTS
$destinationDir = "desktop/tauri/src-tauri"
$binaryDir = "$destinationDir/binary" #portmaster\desktop\tauri\src-tauri\binary
@@ -156,6 +159,11 @@ if (-not (Test-Path -Path $intelDir)) {
New-Item -ItemType Directory -Path $intelDir -ErrorAction Stop > $null
}
Copy-Item -Force -Path "dist/intel/*" -Destination "$intelDir/" -ErrorAction Stop
} catch {
Set-Location $originalDirectory
Write-Error "[!] Failed! Error: $_"
exit 1
}
Set-Location $destinationDir
try {