Skip to content

Commit 4c739d0

Browse files
matej21claude
andcommitted
feat: add Windows Inno Setup installer
Add a proper .exe installer for Windows using Inno Setup, replacing the raw .zip extraction. Includes Start Menu shortcut, desktop shortcut option, uninstaller in Add/Remove Programs, and LZMA2 compression. Also adds a pre-built icon.ico asset and simplifies install.ps1 to download and run the setup executable silently. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 530d9fb commit 4c739d0

5 files changed

Lines changed: 64 additions & 54 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,16 @@ jobs:
120120
run: |
121121
$buildDir = "build/${{ needs.prepare.outputs.electrobun-env }}-${{ matrix.platform }}"
122122
$appDir = Get-ChildItem -Path $buildDir -Directory -Filter "Dotaz*" | Select-Object -First 1
123-
$iconPng = Resolve-Path "assets\icon.png"
123+
$iconIco = Resolve-Path "assets\icon.ico"
124124
125-
# Install rcedit and png-to-ico in isolated temp dir (avoids workspace:* conflict)
125+
# Install rcedit in isolated temp dir (avoids workspace:* conflict)
126126
$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) "icon-tools"
127127
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
128128
Push-Location $tempDir
129129
npm init -y | Out-Null
130-
npm install rcedit png-to-ico --silent
130+
npm install rcedit --silent
131131
Pop-Location
132132
133-
# Convert PNG to ICO
134-
$iconIco = Join-Path $buildDir "app-icon.ico"
135-
node -e "const m=require('$($tempDir -replace '\\','/')/node_modules/png-to-ico');const p=m.default||m;const fs=require('fs');p('$($iconPng -replace '\\','/')').then(b=>fs.writeFileSync('$($iconIco -replace '\\','/')',b))"
136-
137133
# Embed icon into executables and copy .ico for shortcuts
138134
$rcedit = Join-Path $tempDir "node_modules\rcedit\bin\rcedit-x64.exe"
139135
& $rcedit "$($appDir.FullName)\bin\launcher.exe" --set-icon $iconIco
@@ -147,6 +143,14 @@ jobs:
147143
BUILD_DIR="build/${{ needs.prepare.outputs.electrobun-env }}-${{ matrix.platform }}"
148144
tar -czf ${{ matrix.artifact }}.tar.gz -C "$BUILD_DIR" .
149145
146+
- name: Build Windows installer (Inno Setup)
147+
if: runner.os == 'Windows'
148+
shell: pwsh
149+
run: |
150+
$buildDir = "build/${{ needs.prepare.outputs.electrobun-env }}-${{ matrix.platform }}"
151+
$appDir = (Get-ChildItem -Path $buildDir -Directory -Filter "Dotaz*" | Select-Object -First 1).FullName
152+
iscc /DAppVersion=${{ needs.prepare.outputs.version }} /DAppDir="$appDir" /DOutputDir="$PWD" installer\dotaz.iss
153+
150154
- name: Package artifact (Windows)
151155
if: runner.os == 'Windows'
152156
shell: pwsh
@@ -161,6 +165,7 @@ jobs:
161165
path: |
162166
${{ matrix.artifact }}.tar.gz
163167
${{ matrix.artifact }}.zip
168+
dotaz-win-x64-setup.exe
164169
if-no-files-found: error
165170

166171
- name: Upload update artifacts

assets/icon.ico

279 KB
Binary file not shown.

electrobun.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
},
3939
win: {
4040
bundleCEF: false,
41-
icon: 'assets/icon.png',
41+
icon: 'assets/icon.ico',
4242
},
4343
},
4444
release: {

install.ps1

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
$ErrorActionPreference = "Stop"
44

55
$Repo = "contember/dotaz"
6-
$Artifact = "dotaz-win-x64"
7-
$InstallDir = if ($env:DOTAZ_INSTALL_DIR) { $env:DOTAZ_INSTALL_DIR } else { "$env:LOCALAPPDATA\Dotaz" }
6+
$Artifact = "dotaz-win-x64-setup.exe"
87

98
# ── Resolve version ─────────────────────────────────────────
109

@@ -18,63 +17,26 @@ if (-not $Version) {
1817
}
1918
}
2019

21-
$DownloadUrl = "https://github.com/$Repo/releases/download/$Version/$Artifact.zip"
20+
$DownloadUrl = "https://github.com/$Repo/releases/download/$Version/$Artifact"
2221

2322
Write-Host "Installing Dotaz $Version (win-x64)..."
2423

25-
# ── Download and extract ────────────────────────────────────
24+
# ── Download and run installer ──────────────────────────────
2625

2726
$TmpDir = Join-Path ([System.IO.Path]::GetTempPath()) "dotaz-install-$(Get-Random)"
2827
New-Item -ItemType Directory -Path $TmpDir -Force | Out-Null
2928

3029
try {
31-
$ZipPath = Join-Path $TmpDir "dotaz.zip"
30+
$InstallerPath = Join-Path $TmpDir $Artifact
3231

3332
Write-Host "Downloading $DownloadUrl..."
34-
Invoke-WebRequest -Uri $DownloadUrl -OutFile $ZipPath -UseBasicParsing
33+
Invoke-WebRequest -Uri $DownloadUrl -OutFile $InstallerPath -UseBasicParsing
3534

36-
Expand-Archive -Path $ZipPath -DestinationPath $TmpDir -Force
37-
38-
# Find the extracted app directory
39-
$AppSrc = Get-ChildItem -Path $TmpDir -Directory -Filter "Dotaz*" | Select-Object -First 1
40-
if (-not $AppSrc) {
41-
Write-Error "No Dotaz directory found in archive"
42-
exit 1
43-
}
44-
45-
# ── Install ─────────────────────────────────────────────
46-
47-
Write-Host "Installing to $InstallDir..."
48-
49-
if (Test-Path $InstallDir) {
50-
Remove-Item -Recurse -Force $InstallDir
51-
}
52-
Copy-Item -Recurse -Path $AppSrc.FullName -Destination $InstallDir
53-
54-
# Create Start Menu shortcut
55-
$StartMenu = [System.IO.Path]::Combine($env:APPDATA, "Microsoft\Windows\Start Menu\Programs")
56-
$ShortcutPath = Join-Path $StartMenu "Dotaz.lnk"
57-
$LauncherPath = Join-Path $InstallDir "bin\launcher.exe"
58-
59-
if (Test-Path $LauncherPath) {
60-
$WshShell = New-Object -ComObject WScript.Shell
61-
$Shortcut = $WshShell.CreateShortcut($ShortcutPath)
62-
$Shortcut.TargetPath = $LauncherPath
63-
$Shortcut.WorkingDirectory = $InstallDir
64-
$Shortcut.Description = "Desktop database client"
65-
66-
$IconPath = Join-Path $InstallDir "Resources\app.ico"
67-
if (Test-Path $IconPath) {
68-
$Shortcut.IconLocation = $IconPath
69-
}
70-
71-
$Shortcut.Save()
72-
Write-Host "Start Menu shortcut created."
73-
}
35+
Write-Host "Running installer..."
36+
Start-Process -FilePath $InstallerPath -ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART" -Wait
7437

7538
Write-Host ""
76-
Write-Host "Done! Dotaz installed to $InstallDir"
77-
39+
Write-Host "Done! Dotaz $Version installed."
7840
} finally {
7941
Remove-Item -Recurse -Force $TmpDir -ErrorAction SilentlyContinue
8042
}

installer/dotaz.iss

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
; Dotaz — Inno Setup installer script
2+
; Compiled in CI via: iscc /DAppVersion=X.Y.Z /DAppDir=<build-output> /DOutputDir=<out> installer\dotaz.iss
3+
4+
#ifndef AppVersion
5+
#define AppVersion "0.0.0"
6+
#endif
7+
#ifndef AppDir
8+
#define AppDir "..\build\stable-win-x64\Dotaz-stable"
9+
#endif
10+
#ifndef OutputDir
11+
#define OutputDir ".."
12+
#endif
13+
14+
[Setup]
15+
AppName=Dotaz
16+
AppVersion={#AppVersion}
17+
AppPublisher=Contember
18+
AppPublisherURL=https://github.com/contember/dotaz
19+
DefaultDirName={localappdata}\Dotaz
20+
DefaultGroupName=Dotaz
21+
UninstallDisplayIcon={app}\Resources\app.ico
22+
OutputDir={#OutputDir}
23+
OutputBaseFilename=dotaz-win-x64-setup
24+
Compression=lzma2
25+
SolidCompression=yes
26+
PrivilegesRequired=lowest
27+
SetupIconFile=..\assets\icon.ico
28+
WizardStyle=modern
29+
DisableProgramGroupPage=yes
30+
ArchitecturesInstallIn64BitMode=x64compatible
31+
32+
[Files]
33+
Source: "{#AppDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
34+
35+
[Icons]
36+
Name: "{group}\Dotaz"; Filename: "{app}\bin\launcher.exe"; IconFilename: "{app}\Resources\app.ico"
37+
Name: "{autodesktop}\Dotaz"; Filename: "{app}\bin\launcher.exe"; IconFilename: "{app}\Resources\app.ico"; Tasks: desktopicon
38+
39+
[Tasks]
40+
Name: "desktopicon"; Description: "Create a desktop shortcut"; GroupDescription: "Additional shortcuts:"
41+
42+
[Run]
43+
Filename: "{app}\bin\launcher.exe"; Description: "Launch Dotaz"; Flags: nowait postinstall skipifsilent

0 commit comments

Comments
 (0)