Skip to content

Commit 2cd4fbe

Browse files
authored
Merge pull request #47 from saieeshward/feat/combined-windows-msi
Feat/combined windows msi
2 parents f8224b8 + 183bb70 commit 2cd4fbe

6 files changed

Lines changed: 100 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
# retired the macos-13 (last Intel) runner image.
5353
- os: macos-latest
5454
target: x86_64-apple-darwin
55-
- os: windows-latest
56-
target: x86_64-pc-windows-msvc
55+
# No Windows entry: Windows ships a single combined MSI (CLI + viewer)
56+
# from the `desktop` job below, not a standalone CLI archive.
5757
steps:
5858
- uses: actions/checkout@v4
5959

@@ -159,6 +159,29 @@ jobs:
159159
working-directory: app
160160
run: npm ci
161161

162+
# Windows ships ONE combined MSI: build the `clan` CLI and stage it as a
163+
# Tauri sidecar so the viewer installer also installs the CLI. The
164+
# Windows-only tauri.windows.conf.json picks it up via externalBin and a
165+
# WiX fragment (wix/cli-path.wxs) adds the install dir to the system PATH.
166+
- name: Stage CLI into viewer installer (Windows)
167+
if: matrix.os == 'windows-latest'
168+
shell: pwsh
169+
run: |
170+
cargo build -p clan-cli --release
171+
New-Item -ItemType Directory -Force -Path app/src-tauri/binaries | Out-Null
172+
Copy-Item target/release/clan.exe app/src-tauri/binaries/clan-x86_64-pc-windows-msvc.exe
173+
174+
# Linux .deb / .rpm install the `clan` CLI to /usr/bin (on PATH) alongside
175+
# the viewer. tauri.linux.conf.json maps binaries/clan -> /usr/bin/clan via
176+
# deb.files / rpm.files. The AppImage stays viewer-only (it can't place
177+
# files on the host PATH), so the standalone CLI tarball is kept above.
178+
- name: Stage CLI into Linux packages (Linux)
179+
if: matrix.os == 'ubuntu-latest'
180+
run: |
181+
cargo build -p clan-cli --release
182+
mkdir -p app/src-tauri/binaries
183+
cp target/release/clan app/src-tauri/binaries/clan
184+
162185
- name: Build & publish desktop bundles
163186
uses: tauri-apps/tauri-action@v0
164187
env:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
target/
88
target-gnu/
99
Cargo.lock
10+
11+
# CLI sidecar staged into the viewer MSI during the release build (see release.yml).
12+
app/src-tauri/binaries/

TODO.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ Priority order: fix blockers first, then correctness, then packaging, then optim
114114
- [x] Viewer: attach `.dmg`, `.msi`, `.AppImage` to GitHub Release via `tauri-action`
115115
- [ ] Spec: host `spec/CLAN-SPEC.md` at a versioned URL and reference from crates.io docs
116116
- [ ] Packages on github for download : Discuss
117+
- [ ] Combined Installer for all the releases
118+
- [x] Windows
119+
- [x] Linux
120+
- [x] MacOs
117121

118122
### Launch announcements (drafts ready 2026-06-12, kept local until posted)
119123

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://schema.tauri.app/config/2",
3+
"bundle": {
4+
"linux": {
5+
"deb": {
6+
"files": {
7+
"/usr/bin/clan": "binaries/clan"
8+
}
9+
},
10+
"rpm": {
11+
"files": {
12+
"/usr/bin/clan": "binaries/clan"
13+
}
14+
}
15+
}
16+
}
17+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://schema.tauri.app/config/2",
3+
"bundle": {
4+
"targets": ["msi"],
5+
"externalBin": ["binaries/clan"],
6+
"windows": {
7+
"wix": {
8+
"fragmentPaths": ["wix/cli-path.wxs"],
9+
"componentGroupRefs": ["ClanCliPath"]
10+
}
11+
}
12+
}
13+
}

app/src-tauri/wix/cli-path.wxs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Adds the viewer install directory to the system PATH so the bundled `clan`
4+
CLI sidecar works from any terminal after a combined-MSI install.
5+
6+
Wired up in tauri.windows.conf.json:
7+
bundle.externalBin -> ["binaries/clan"] (puts clan.exe in INSTALLDIR)
8+
bundle.windows.wix.fragmentPaths -> ["wix/cli-path.wxs"]
9+
bundle.windows.wix.componentGroupRefs -> ["ClanCliPath"]
10+
11+
INSTALLDIR is the directory id Tauri's WiX template installs the app into.
12+
The <Environment> element is core MSI (no WiX extension required) and is
13+
removed on uninstall (Permanent="no"). System="yes" writes the machine PATH,
14+
which requires the per-machine elevation the Tauri MSI already performs.
15+
-->
16+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
17+
<Fragment>
18+
<ComponentGroup Id="ClanCliPath">
19+
<Component Id="ClanCliPathEnvironment" Directory="INSTALLDIR" Guid="7C9B2E14-3A6D-4F58-B1E0-9D2C4A7F8E51">
20+
<Environment Id="ClanCliPathEnvVar"
21+
Name="PATH"
22+
Value="[INSTALLDIR]"
23+
Action="set"
24+
Part="last"
25+
System="yes"
26+
Permanent="no" />
27+
<!-- A component needs a keypath; a PATH entry can't be one, so anchor
28+
to a small HKLM marker that owns this component. -->
29+
<RegistryValue Root="HKLM"
30+
Key="Software\CLAN\Viewer"
31+
Name="CliOnPath"
32+
Type="integer"
33+
Value="1"
34+
KeyPath="yes" />
35+
</Component>
36+
</ComponentGroup>
37+
</Fragment>
38+
</Wix>

0 commit comments

Comments
 (0)