|
|
|
|
@@ -21,8 +21,22 @@ Trap {
|
|
|
|
|
# Reset working dir on error
|
|
|
|
|
Pop-Location
|
|
|
|
|
}
|
|
|
|
|
# If signing, get the certificate
|
|
|
|
|
if ($Sign) {
|
|
|
|
|
$cert=Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Where-Object { $_.Thumbprint -eq $CertificateThumbprint }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$cert=Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Where-Object { $_.Thumbprint -eq $CertificateThumbprint }
|
|
|
|
|
# Building service executable
|
|
|
|
|
Write-Output "Building WinBGP service"
|
|
|
|
|
& "..\service\WinBGP-Service.ps1" -Build
|
|
|
|
|
Move-Item -Path "..\builder\WinBGP-Service.exe" -Destination "..\service\WinBGP-Service.exe" -Force
|
|
|
|
|
if ($Sign) {
|
|
|
|
|
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe" sign /sha1 $CertificateThumbprint /tr http://time.certum.pl/ /td sha256 /fd sha256 /v "..\service\WinBGP-Service.exe"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Building engine
|
|
|
|
|
Write-Output "Building engine"
|
|
|
|
|
New-Item -ItemType Directory -Path "..\engine" -Force | Out-Null
|
|
|
|
|
Get-ChildItem -Path '..\src' | Where-Object {$_.Extension -eq '.ps1'} | ForEach-Object {
|
|
|
|
|
Copy-Item -Path $_.FullName -Destination "..\engine" -Force
|
|
|
|
|
if ($Sign) {
|
|
|
|
|
@@ -30,17 +44,18 @@ Get-ChildItem -Path '..\src' | Where-Object {$_.Extension -eq '.ps1'} | ForEach
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Verbose "Creating winbgp-${Version}-${Arch}.msi"
|
|
|
|
|
Write-Output "Building winbgp-${Version}-${Arch}.msi"
|
|
|
|
|
$wixArch = @{"amd64" = "x64"; "arm64" = "arm64"}[$Arch]
|
|
|
|
|
|
|
|
|
|
Invoke-Expression "wix build -arch $wixArch -o .\WinBGP-$($Version)-$($Arch).msi .\files.wxs .\main.wxs -d ProductName=WinBGP -d Version=$($MsiVersion) -ext WixToolset.Firewall.wixext -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext"
|
|
|
|
|
|
|
|
|
|
Write-Verbose "Done!"
|
|
|
|
|
Pop-Location
|
|
|
|
|
Write-Output "Build complete !"
|
|
|
|
|
|
|
|
|
|
# Clean temporary build folder
|
|
|
|
|
Remove-Item -Path "..\engine\*"
|
|
|
|
|
|
|
|
|
|
Write-Output "Release build"
|
|
|
|
|
New-Item -ItemType Directory -Path "..\release" -Force | Out-Null
|
|
|
|
|
Copy-Item -Path "WinBGP-$($Version)-$($Arch).msi" -Destination "..\release" -Force
|
|
|
|
|
if ($Sign) {
|
|
|
|
|
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe" sign /sha1 $CertificateThumbprint /tr http://time.certum.pl/ /td sha256 /fd sha256 /v "..\release\WinBGP-$($Version)-$($Arch).msi"
|
|
|
|
|
|