[packaging] (Windows) Ability to run "generate_windows_installers.ps1" from any location.
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"productName": "Portmaster",
|
"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.
|
"identifier": "io.safing.portmaster", // this is added as a property to the shortcut on windows (ApplicationUserModelID). Used for notifications.
|
||||||
"app": {
|
"app": {
|
||||||
"withGlobalTauri": true,
|
"withGlobalTauri": true,
|
||||||
|
|||||||
@@ -128,34 +128,42 @@ function Find-And-Copy-File {
|
|||||||
}
|
}
|
||||||
# >>>>>>>>>>>>>>>>>>>>>>> End Functions >>>>>>>>>>>>>>>>>>>>>>>>
|
# >>>>>>>>>>>>>>>>>>>>>>> End Functions >>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
|
|
||||||
# CONSTANTS
|
# Set-Location relative to the script location "../.." (root of the project). So that the script can be run from any location.
|
||||||
$destinationDir = "desktop/tauri/src-tauri"
|
Set-Location -Path (Join-Path -Path $PSScriptRoot -ChildPath "../..")
|
||||||
$binaryDir = "$destinationDir/binary" #portmaster\desktop\tauri\src-tauri\binary
|
try {
|
||||||
$intelDir = "$destinationDir/intel" #portmaster\desktop\tauri\src-tauri\intel
|
# CONSTANTS
|
||||||
$targetDir = "$destinationDir/target/release" #portmaster\desktop\tauri\src-tauri\target\release
|
$destinationDir = "desktop/tauri/src-tauri"
|
||||||
|
$binaryDir = "$destinationDir/binary" #portmaster\desktop\tauri\src-tauri\binary
|
||||||
|
$intelDir = "$destinationDir/intel" #portmaster\desktop\tauri\src-tauri\intel
|
||||||
|
$targetDir = "$destinationDir/target/release" #portmaster\desktop\tauri\src-tauri\target\release
|
||||||
|
|
||||||
# Copying BINARY FILES
|
# Copying BINARY FILES
|
||||||
Write-Output "`n[+] Copying binary files:"
|
Write-Output "`n[+] Copying binary files:"
|
||||||
$filesToCopy = @(
|
$filesToCopy = @(
|
||||||
@{Folder=""; File="portmaster-kext.sys"; Destination=$binaryDir; AlternateFolder="dist/download/windows_amd64"},
|
@{Folder=""; File="portmaster-kext.sys"; Destination=$binaryDir; AlternateFolder="dist/download/windows_amd64"},
|
||||||
@{Folder="dist/binary/windows_amd64"; File="portmaster-core.dll"; Destination=$binaryDir; AlternateFolder="dist/download/windows_amd64"},
|
@{Folder="dist/binary/windows_amd64"; File="portmaster-core.dll"; Destination=$binaryDir; AlternateFolder="dist/download/windows_amd64"},
|
||||||
@{Folder="dist/binary/windows_amd64"; File="portmaster-core.exe"; Destination=$binaryDir},
|
@{Folder="dist/binary/windows_amd64"; File="portmaster-core.exe"; Destination=$binaryDir},
|
||||||
@{Folder="dist/binary/windows_amd64"; File="WebView2Loader.dll"; Destination=$binaryDir},
|
@{Folder="dist/binary/windows_amd64"; File="WebView2Loader.dll"; Destination=$binaryDir},
|
||||||
@{Folder="dist/binary/all"; File="portmaster.zip"; Destination=$binaryDir},
|
@{Folder="dist/binary/all"; File="portmaster.zip"; Destination=$binaryDir},
|
||||||
@{Folder="dist/binary/all"; File="assets.zip"; Destination=$binaryDir},
|
@{Folder="dist/binary/all"; File="assets.zip"; Destination=$binaryDir},
|
||||||
@{Folder="dist/binary"; File="index.json"; Destination=$binaryDir},
|
@{Folder="dist/binary"; File="index.json"; Destination=$binaryDir},
|
||||||
@{Folder="dist/binary/windows_amd64"; File="portmaster.exe"; Destination=$targetDir}
|
@{Folder="dist/binary/windows_amd64"; File="portmaster.exe"; Destination=$targetDir}
|
||||||
)
|
)
|
||||||
foreach ($file in $filesToCopy) {
|
foreach ($file in $filesToCopy) {
|
||||||
Find-And-Copy-File -SourceDir $file.Folder -File $file.File -DestinationDir $file.Destination -AlternateSourceDir $file.AlternateFolder
|
Find-And-Copy-File -SourceDir $file.Folder -File $file.File -DestinationDir $file.Destination -AlternateSourceDir $file.AlternateFolder
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copying INTEL FILES
|
# Copying INTEL FILES
|
||||||
Write-Output "`n[+] Copying intel files"
|
Write-Output "`n[+] Copying intel files"
|
||||||
if (-not (Test-Path -Path $intelDir)) {
|
if (-not (Test-Path -Path $intelDir)) {
|
||||||
New-Item -ItemType Directory -Path $intelDir -ErrorAction Stop > $null
|
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
|
||||||
}
|
}
|
||||||
Copy-Item -Force -Path "dist/intel/*" -Destination "$intelDir/" -ErrorAction Stop
|
|
||||||
|
|
||||||
Set-Location $destinationDir
|
Set-Location $destinationDir
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user