Skip to content

Commit

Permalink
[WIP] Fix windows installer CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vlabo committed Oct 11, 2024
1 parent 3502eb2 commit 6be7330
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions packaging/windows/generate_windows_installers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,28 @@ $originalDirectory = Get-Location
$destinationDir = "desktop/tauri/src-tauri"
$binaryDir = "$destinationDir/binary"
$intelDir = "$destinationDir/intel"
$targetDir = "$destinationDir/target/release"

# Make sure distination folder exists.
# Make sure binary folder exists.
if (-not (Test-Path -Path $binaryDir)) {
New-Item -ItemType Directory -Path $binaryDir > $null
}


Write-Output "Copying binary files"
Copy-Item -Force -Path "dist/binary/bin-index.json" -Destination "$binaryDir/bin-index.json"
Copy-Item -Force -Path "dist/binary/windows_amd64/portmaster-core.exe" -Destination "$binaryDir/portmaster-core.exe"
Copy-Item -Force -Path "dist/binary/windows_amd64/portmaster-kext.sys" -Destination "$binaryDir/portmaster-kext.sys"
Copy-Item -Force -Path "dist/binary/all/portmaster.zip" -Destination "$binaryDir/portmaster.zip"
Copy-Item -Force -Path "dist/binary/all/assets.zip" -Destination "$binaryDir/assets.zip"
Copy-Item -Force -Path "dist/binary/windows_amd64/portmaster.exe" -Destination "$destinationDir/target/release/portmaster.exe"

# Make sure distination folder exists.
# Make sure target folder exists.
if (-not (Test-Path -Path $targetDir)) {
New-Item -ItemType Directory -Path $targetDir > $null
}
Copy-Item -Force -Path "dist/binary/windows_amd64/portmaster.exe" -Destination "$targetDir/portmaster.exe"

# Make sure intel folder exists.
if (-not (Test-Path -Path $intelDir)) {
New-Item -ItemType Directory -Path $intelDir > $null
}
Expand Down Expand Up @@ -61,5 +68,29 @@ if (-not (Test-Path -Path $installerDist)) {
Copy-Item -Path ".\target\release\bundle\msi\*" -Destination $installerDist
Copy-Item -Path ".\target\release\bundle\nsis\*" -Destination $installerDist


# Restore the original directory
Set-Location $originalDirectory
Set-Location $originalDirectory


# FIXME: remove
function Show-Tree {
param (
[string]$Path = ".",
[int]$Indent = 0
)

$items = Get-ChildItem -Path $Path

foreach ($item in $items) {
Write-Host (" " * $Indent) -NoNewline
Write-Host "+-- " -NoNewline
Write-Host $item.Name

if ($item.PSIsContainer) {
Show-Tree -Path $item.FullName -Indent ($Indent + 4)
}
}
}

Show-Tree 'C:\Program Files (x86)\Windows Kits\10\Include'

0 comments on commit 6be7330

Please sign in to comment.