Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions common/src/model/installer_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ pub struct InstallerPayload {
pub payload_blake3: String,
pub created_at_unix: i64,
pub manifest: Manifest,
/// Optional EULA text shown on the License page of the installer UI.
/// Optional EULA source shown as CommonMark on the License page.
/// `None` falls back to a built-in placeholder.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub license_text: Option<String>,
/// Per-language EULA translations, keyed by 2-letter UI language code
/// (`"fr"`). See [`license_for`](Self::license_for).
/// Per-language CommonMark EULA translations, keyed by 2-letter UI
/// language code (`"fr"`). See [`license_for`](Self::license_for).
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
pub license_texts: BTreeMap<String, String>,
/// File-type associations to register under `HKCU\Software\Classes`.
Expand Down Expand Up @@ -106,8 +106,8 @@ pub struct InstallerPayload {
}

impl InstallerPayload {
/// EULA to show for UI language `lang`: its translation, else the default
/// `license_text`. `None` (or empty) = built-in placeholder.
/// CommonMark EULA source for UI language `lang`: its translation, else
/// the default `license_text`. `None` (or empty) = built-in placeholder.
pub fn license_for(&self, lang: &str) -> Option<&str> {
self.license_texts
.get(lang)
Expand Down
6 changes: 3 additions & 3 deletions docs/src/building/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ one of `pub_key` / `pub_key_literal` is also required. An invalid

| Key | Type | Default | Description |
|---|---|---|---|
| `license` | path | built-in placeholder | UTF-8 EULA text shown on the License page. |
| `licenses` | table | `{}` | Per-language EULA translations, `{ fr = "EULA-fr.txt" }`. See [Branding](../packaging/branding.md#translations). |
| `license` | path | built-in placeholder | UTF-8 plain-text or CommonMark EULA shown on the License page. |
| `licenses` | table | `{}` | Per-language EULA translations, `{ fr = "EULA-fr.md" }`. See [Branding](../packaging/branding.md#translations). |
| `banner` | path | flat gray header | PNG painted across the wizard header. See [Branding](../packaging/branding.md). |
| `banner_dark` | path | same as `banner` | Dark-theme variant of `banner` for the WinUI wizard. Needs `banner`. See [Branding](../packaging/branding.md#dark-theme-variant). |
| `assoc` | array | `[]` | File associations: `".ext:Description"` strings and/or `[[assoc]]` tables with an icon choice. See [File associations](../packaging/associations.md). |
Expand Down Expand Up @@ -123,7 +123,7 @@ out = "dist/setup-myapp-1.0.exe"
priv_key = "keys/priv.key"
pub_key = "keys/pub.key"

license = "legal/EULA-myapp-en.txt"
license = "legal/EULA-myapp-en.md"
banner = "branding/header-1400x144.png"
banner_dark = "branding/header-dark-1400x144.png"
assoc = [".myx:MyApp Document", ".myz:MyApp Archive"]
Expand Down
21 changes: 15 additions & 6 deletions docs/src/packaging/branding.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ required. All are driven from `pack`, on the CLI or in the

## License text

Pass `--license <path>` and the UTF-8 text in that file becomes the EULA shown
on the installer's License page. Without it, the page shows a built-in
placeholder text.
Pass `--license <path>` and the UTF-8 plain text or CommonMark in that file becomes the
EULA shown on the installer's License page. Both `.txt` and `.md` use the same
CommonMark renderer, so existing plain-text files remain supported without a
configuration change. Paragraphs, headings (levels 1–6), ordered and unordered
lists (including nested lists), block quotes, emphasis, strong text, inline and
fenced code, thematic breaks and links are supported. Clickable links are
limited to `http`, `https` and `mailto`. Images are ignored, table syntax stays
plain text, and raw HTML is displayed rather than interpreted. Without a
license file, the page shows a built-in placeholder text.

```pwsh
installer_builder.exe pack `
--product "My App" --product-id myapp --publisher "My Company" --to-version 1.0 `
--input .\build\myapp --exe myapp.exe `
--license .\legal\EULA-myapp-en.txt `
--license .\legal\EULA-myapp-en.md `
--priv-key .\keys\priv.key --pub-key .\keys\pub.key `
--out .\dist\setup-myapp-1.0.exe
```
Expand All @@ -28,8 +34,8 @@ file per language with `--license-lang <lang>=<path>` (repeatable), or a
`licenses` table in the config file:

```toml
license = "legal/EULA-en.txt" # fallback for every other language
licenses = { fr = "legal/EULA-fr.txt", de = "legal/EULA-de.txt" }
license = "legal/EULA-en.md" # fallback for every other language
licenses = { fr = "legal/EULA-fr.md", de = "legal/EULA-de.md" }
```

The installer shows the file for its UI language, falling back to `license`
Expand Down Expand Up @@ -125,6 +131,9 @@ $env:INSTALLWAY_PREVIEW_BANNER_DARK = ".\branding\header-dark-1400x144.png"
.\target\debug\installer.exe --preview license
```

On a machine with WinUI available, append `-win32` to compare the fallback
renderer with the same sample: `--preview license-win32`.

Switch Windows between light and dark mode (Settings > Personalization >
Colors) to check both.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ wins. Required fields are checked after merging. See

| Option | Default | Description |
|---|---|---|
| `--license <FILE>` | Built-in placeholder | UTF-8 EULA shown on the License page. |
| `--license <FILE>` | Built-in placeholder | UTF-8 plain-text or CommonMark EULA shown on the License page. |
| `--license-lang <LANG=FILE>` | None | EULA translation for one UI language. Repeatable. See [Branding](../packaging/branding.md#translations). |
| `--banner <FILE.png>` | Flat gray header | PNG painted across the wizard header. Author at 1400 x 144 px; see [Branding](../packaging/branding.md#header-banner). |
| `--banner-dark <FILE.png>` | Same as `--banner` | Dark-theme variant of `--banner`, shown by the WinUI wizard when Windows runs dark (with light title text). Needs `--banner`; see [Branding](../packaging/branding.md#dark-theme-variant). |
Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference/payload.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ serializer-determinism trap.
| `payload_blake3` | `String` | BLAKE3 of the payload archive, re-verified before extraction. |
| `created_at_unix` | `i64` | |
| `manifest` | `Manifest` | The per-file table; see below. |
| `license_text` | `Option<String>` | EULA shown on the License page. |
| `license_texts` | `BTreeMap<String, String>` | EULA translations by UI language code; picked over `license_text` for that language. |
| `license_text` | `Option<String>` | UTF-8 EULA source rendered as CommonMark on the License page. |
| `license_texts` | `BTreeMap<String, String>` | CommonMark EULA translations by UI language code; picked over `license_text` for that language. |
| `associations` | `Vec<FileAssoc>` | File types to register under `Software\Classes`. Each has `ext`, `description`, and optional `icon` (token template, empty means the main exe) and `icon_index` (`>= 0` an index, `< 0` a negated resource id; default `0`). |
| `plugins` | `Vec<PluginEntry>` | Bundled [plugins](../packaging/plugins.md) and their phases. |
| `shortcuts` | `Vec<ShortcutEntry>` | [Shortcuts](../packaging/shortcuts.md) to create. `dir`, `name`, `target`, and `args` are token templates. None are created unless declared. |
Expand Down
2 changes: 2 additions & 0 deletions installer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mslnk = "0.1"
fs4 = "1"
memmap2 = "0.9"
rayon = "1.12"
pulldown-cmark = { version = "0.13", default-features = false }

[target.'cfg(windows)'.dependencies]
windows = { version = "0.62.2", features = [
Expand All @@ -37,6 +38,7 @@ windows = { version = "0.62.2", features = [
"Win32_System_Com",
"Win32_UI_WindowsAndMessaging",
"Win32_UI_Controls",
"Win32_UI_Controls_RichEdit",
"Win32_UI_Input_KeyboardAndMouse",
"Win32_UI_HiDpi",
"Win32_UI_Shell",
Expand Down
3 changes: 2 additions & 1 deletion installer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ struct Cli {
force_show_path_window: bool,

/// Dev-only: render one UI view with sample data, no payload needed
/// (`license` | `choose` | `progress` | `done` | `error` | `minimal`).
/// (`license` | `choose` | `progress` | `done` | `error` | `minimal`),
/// optionally suffixed with `-win32` to force the legacy backend.
#[cfg(debug_assertions)]
#[arg(long)]
preview: Option<String>,
Expand Down
Loading
Loading