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
# Build script for creating Windows MSI installer
# Usage: .\scripts\build-packages.ps1
$ErrorActionPreference = "Stop"
$ProjectRoot = Split-Path -Parent $PSScriptRoot
Set-Location $ProjectRoot
function Build-MSI {
Write-Host "Building Windows MSI installer..." -ForegroundColor Green
# Check if WiX is installed
if (!(Get-Command wix -ErrorAction SilentlyContinue)) {
Write-Host "Installing WiX..." -ForegroundColor Yellow
dotnet tool install --global wix
wix extension add -g WixToolset.UI.wixext
}
# Build the release binary
Write-Host "Building release binary..." -ForegroundColor Yellow
cargo build --release --target x86_64-pc-windows-msvc
# Ensure icon exists (placeholder)
$IconDir = "packaging\windows"
if (!(Test-Path $IconDir)) {
New-Item -ItemType Directory -Force -Path $IconDir | Out-Null
}
if (!(Test-Path "$IconDir\icon.ico")) {
Write-Host "Warning: No icon.ico found. Creating placeholder..." -ForegroundColor Yellow
Set-Content -Path "$IconDir\icon.ico" -Value "" -NoNewline
}
# Build MSI
Write-Host "Building MSI package..." -ForegroundColor Yellow
wix build -arch x64 -o bitbucket-cli.msi packaging\windows\main.wxs
Write-Host "✓ MSI installer built: bitbucket-cli.msi" -ForegroundColor Green
}
Build-MSI