Skip to content

Commit a49e36a

Browse files
committed
Partial alignment: add installer branding pipeline parity
1 parent dad1d8b commit a49e36a

4 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/build-windows-installer.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ jobs:
5555
shell: pwsh
5656
run: choco install nsis --no-progress -y
5757

58+
- name: Install ImageMagick
59+
shell: pwsh
60+
run: choco install imagemagick --no-progress -y
61+
62+
- name: Generate installer branding assets
63+
shell: pwsh
64+
run: windows-installer/prepare-branding.ps1
65+
5866
- name: Build NSIS installer
5967
shell: pwsh
6068
run: |

windows-installer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
staging/
22
output/
3+
branding/

windows-installer/installer.nsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@ SetCompressor /SOLID lzma
1616
!define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\EdgeImpulseLinuxCLI"
1717
!define STAGING_DIR "staging"
1818
!define OUTPUT_DIR "output"
19+
!define BRAND_HEADER_BMP "branding\header.bmp"
20+
!define BRAND_WELCOME_BMP "branding\welcome.bmp"
1921

2022
!include "MUI2.nsh"
2123
!include "x64.nsh"
2224
!include "WinMessages.nsh"
2325
!include "FileFunc.nsh"
2426

2527
!define MUI_ABORTWARNING
28+
!define MUI_HEADERIMAGE
29+
!define MUI_HEADERIMAGE_RIGHT
30+
!define MUI_HEADERIMAGE_BITMAP "${BRAND_HEADER_BMP}"
31+
!define MUI_WELCOMEFINISHPAGE_BITMAP "${BRAND_WELCOME_BMP}"
2632

2733
!insertmacro MUI_PAGE_WELCOME
2834
!insertmacro MUI_PAGE_LICENSE "${STAGING_DIR}\LICENSE.txt"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[CmdletBinding()]
2+
param()
3+
4+
Set-StrictMode -Version Latest
5+
$ErrorActionPreference = 'Stop'
6+
7+
$repoRoot = Resolve-Path "$PSScriptRoot\.."
8+
$sourceImage = Join-Path $repoRoot "img\linux-collection.png"
9+
$brandingDir = Join-Path $PSScriptRoot "branding"
10+
$headerBmp = Join-Path $brandingDir "header.bmp"
11+
$welcomeBmp = Join-Path $brandingDir "welcome.bmp"
12+
13+
if (-not (Test-Path $sourceImage)) {
14+
throw "Branding source image not found: $sourceImage"
15+
}
16+
17+
New-Item -ItemType Directory -Force -Path $brandingDir | Out-Null
18+
19+
$magick = Get-Command magick -ErrorAction SilentlyContinue
20+
if (-not $magick) {
21+
throw "ImageMagick (magick) is required to generate NSIS branding bitmaps"
22+
}
23+
24+
Write-Host "Generating NSIS branding bitmaps from $sourceImage"
25+
26+
# NSIS header image: 150x57
27+
& $magick.Source "$sourceImage" `
28+
-background white -gravity center `
29+
-resize 150x57 `
30+
-extent 150x57 `
31+
BMP3:"$headerBmp"
32+
33+
# NSIS welcome/finish side image: 164x314
34+
& $magick.Source "$sourceImage" `
35+
-background white -gravity center `
36+
-resize 164x314 `
37+
-extent 164x314 `
38+
BMP3:"$welcomeBmp"
39+
40+
if (-not (Test-Path $headerBmp) -or -not (Test-Path $welcomeBmp)) {
41+
throw "Failed to generate branding assets"
42+
}
43+
44+
Write-Host "Branding assets generated:"
45+
Get-ChildItem $brandingDir | Format-Table Name, Length -AutoSize

0 commit comments

Comments
 (0)