Shell 42: packaging-windows-shortcuts-and (#834) #864

Closed
charles wants to merge 0 commits from shell-42-packaging-windows-shortcuts-and into shell
Owner

Stacked on: shell-18-platform-desktop-entry-and (already merged into shell, so the merge was a no-op)

What this builds (Task 42, spec §10.1, §10.4, §18 Q9)

  • Windows shortcuts (#614): vpk pack --shortcuts Desktop,StartMenuRoot (new velopack::SHORTCUTS), both with --aumid Forked.Flaxative (#544). The flag and value names were checked against the pinned vpk 1.2.161: vpk [win] pack -H lists --shortcuts <LOC> (default Desktop,StartMenuRoot) and --aumid, and Velopack.xml documents StartMenuRoot as the Start-menu root and StartMenu as a publisher subfolder (until now that was Programs\Charles Daoust\Flaxative.lnk).
  • packaging/windows/check-install.ps1 (works in Windows PowerShell 5.1 and makes no changes). It prints the install folder; the Desktop, Start-menu and old publisher-folder shortcuts with each target and System.AppUserModel.ID; the uninstall entry HKCU\…\Uninstall\Flaxative; the Run value Forked.Flaxative; and the owner of the flaxative and fluxer schemes (HKCU, then HKLM). Exit codes: 1 when a shortcut's AUMID differs or cannot be read, or nothing is installed; 2 for a missing shortcut, only with -RequireShortcuts. -ShortcutFile <lnk> checks a single shortcut, for example a pinned one. The script reads the AUMID by parsing the .lnk itself ([MS-SHLLINK] PropertyStoreDataBlock and [MS-PROPSTORE]), not through the Windows shell, so it also works on Server Core.
  • Release workflow: the Windows installer smoke test runs the script after --debug-info and before the uninstall. A wrong AUMID fails the run. A missing shortcut is only reported, because the runner account may have no Desktop folder. The release notes now say "Start-menu and Desktop shortcuts".
  • packaging/linux/flaxative.desktop: adds Version=1.5, MimeType=x-scheme-handler/flaxative;, SingleMainWindow=true, Actions=open-settings; and [Desktop Action open-settings] (Name=Open settings, Exec=flaxative --task open-settings). Keys are in the order fluxer_platform::desktop_entry writes them. desktop-file-validate reports no errors.
  • READMEs (top level for installing, xtask for package and tests) are updated.

Strings copied: "Open settings" (D/MainI18n.ts:99, as Task 18 already does). The script's output text is new and was written for this check.

Tests

  • vpk_args_have_both_shortcuts_and_aumid and packaged_desktop_file_matches_written_one in xtask/src/package.rs. Both failed first: the first got StartMenu, the second found 12 packaged keys against the writer's 18.
  • check_install_script_expects_the_packed_identity: the script names the AUMID, package id, shortcut name, exe, legacy folder and both schemes that xtask packs.
  • Existing test vpk_args_are_per_user_start_menu_no_delta updated to the new value.
  • Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passes.
  • check-install.ps1 was run with pwsh 7 on Linux:
    • The parser reports no errors.
    • -ShortcutFile was run on hand-built .lnk files (target in Unicode LinkInfo, target in ANSI LinkInfo, arguments, two property storages, AUMID Forked.Flaxative / velopack.Flaxative / none, truncated file). Results: 0 / 1 / 1 / error.
    • The full report was run against a fake install folder (no registry and no known folders on Linux): it reports and exits 0.
  • No FLUXER_DESKTOP_TESTS were needed or run.

Deviations from the plan

  • The packaged desktop file has the same groups and keys as the written one except two that only the writer can have. TryExec is an absolute path to the AppImage, and inside the image a bare flaxative is not on PATH, so a launcher would hide the entry. NoDisplay is conditional. The xtask test lists both as writer-only.
  • The packaged MimeType lists flaxative only. The writer adds fluxer only when nothing else handles it (spec §10.3), and the image cannot know that.
  • xtask does not depend on the client crates. So packaged_desktop_file_matches_written_one reads the writer's fn body from crates/fluxer-platform/src/desktop_entry/linux.rs as text, the same way the existing PACK_TITLE and AUMID tests do.
  • Outside the Files list:
    • crates/fluxer-platform/tests/desktop_entry.rs (Task 18's test): it compared every key=value line of the packaged file with the written main group. It now stops at the action group and skips MimeType, which it already checks separately. Without this, the new action's Name=Open settings would be compared with the main Name.
    • .forgejo/workflows/release.yaml: smoke-test step and release-note text.
    • README.md.

For Charles to check by hand (Task 44)

On a real install, run powershell -NoProfile -ExecutionPolicy Bypass -File packaging\windows\check-install.ps1 -RequireShortcuts. Expected result:

  • the Desktop shortcut and Programs\Flaxative.lnk both show Forked.Flaxative and point into %LocalAppData%\Flaxative
  • the uninstall entry is listed
  • flaxative is owned by Flaxative

Also check whether an update from an older install leaves Programs\Charles Daoust\Flaxative.lnk behind. Velopack's handling of shortcut locations that were removed is not verified; the script reports that shortcut as "older installs".

Refs #544
Refs #614

Closes #834

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

Stacked on: shell-18-platform-desktop-entry-and (already merged into `shell`, so the merge was a no-op) ## What this builds (Task 42, spec §10.1, §10.4, §18 Q9) - **Windows shortcuts** (#614): `vpk pack --shortcuts Desktop,StartMenuRoot` (new `velopack::SHORTCUTS`), both with `--aumid Forked.Flaxative` (#544). The flag and value names were checked against the pinned vpk 1.2.161: `vpk [win] pack -H` lists `--shortcuts <LOC>` (default `Desktop,StartMenuRoot`) and `--aumid`, and `Velopack.xml` documents `StartMenuRoot` as the Start-menu root and `StartMenu` as a publisher subfolder (until now that was `Programs\Charles Daoust\Flaxative.lnk`). - **`packaging/windows/check-install.ps1`** (works in Windows PowerShell 5.1 and makes no changes). It prints the install folder; the Desktop, Start-menu and old publisher-folder shortcuts with each target and `System.AppUserModel.ID`; the uninstall entry `HKCU\…\Uninstall\Flaxative`; the `Run` value `Forked.Flaxative`; and the owner of the `flaxative` and `fluxer` schemes (HKCU, then HKLM). Exit codes: 1 when a shortcut's AUMID differs or cannot be read, or nothing is installed; 2 for a missing shortcut, only with `-RequireShortcuts`. `-ShortcutFile <lnk>` checks a single shortcut, for example a pinned one. The script reads the AUMID by parsing the .lnk itself ([MS-SHLLINK] PropertyStoreDataBlock and [MS-PROPSTORE]), not through the Windows shell, so it also works on Server Core. - **Release workflow**: the Windows installer smoke test runs the script after `--debug-info` and before the uninstall. A wrong AUMID fails the run. A missing shortcut is only reported, because the runner account may have no Desktop folder. The release notes now say "Start-menu and Desktop shortcuts". - **`packaging/linux/flaxative.desktop`**: adds `Version=1.5`, `MimeType=x-scheme-handler/flaxative;`, `SingleMainWindow=true`, `Actions=open-settings;` and `[Desktop Action open-settings]` (`Name=Open settings`, `Exec=flaxative --task open-settings`). Keys are in the order `fluxer_platform::desktop_entry` writes them. `desktop-file-validate` reports no errors. - READMEs (top level for installing, xtask for package and tests) are updated. Strings copied: "Open settings" (`D/MainI18n.ts:99`, as Task 18 already does). The script's output text is new and was written for this check. ## Tests - `vpk_args_have_both_shortcuts_and_aumid` and `packaged_desktop_file_matches_written_one` in `xtask/src/package.rs`. Both failed first: the first got `StartMenu`, the second found 12 packaged keys against the writer's 18. - `check_install_script_expects_the_packed_identity`: the script names the AUMID, package id, shortcut name, exe, legacy folder and both schemes that xtask packs. - Existing test `vpk_args_are_per_user_start_menu_no_delta` updated to the new value. - Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passes. - `check-install.ps1` was run with pwsh 7 on Linux: - The parser reports no errors. - `-ShortcutFile` was run on hand-built .lnk files (target in Unicode LinkInfo, target in ANSI LinkInfo, arguments, two property storages, AUMID `Forked.Flaxative` / `velopack.Flaxative` / none, truncated file). Results: 0 / 1 / 1 / error. - The full report was run against a fake install folder (no registry and no known folders on Linux): it reports and exits 0. - No FLUXER_DESKTOP_TESTS were needed or run. ## Deviations from the plan - The packaged desktop file has the same groups and keys as the written one except two that only the writer can have. `TryExec` is an absolute path to the AppImage, and inside the image a bare `flaxative` is not on PATH, so a launcher would hide the entry. `NoDisplay` is conditional. The xtask test lists both as writer-only. - The packaged `MimeType` lists `flaxative` only. The writer adds `fluxer` only when nothing else handles it (spec §10.3), and the image cannot know that. - xtask does not depend on the client crates. So `packaged_desktop_file_matches_written_one` reads the writer's `fn body` from `crates/fluxer-platform/src/desktop_entry/linux.rs` as text, the same way the existing `PACK_TITLE` and AUMID tests do. - Outside the Files list: - `crates/fluxer-platform/tests/desktop_entry.rs` (Task 18's test): it compared every `key=value` line of the packaged file with the written main group. It now stops at the action group and skips `MimeType`, which it already checks separately. Without this, the new action's `Name=Open settings` would be compared with the main `Name`. - `.forgejo/workflows/release.yaml`: smoke-test step and release-note text. - `README.md`. ## For Charles to check by hand (Task 44) On a real install, run `powershell -NoProfile -ExecutionPolicy Bypass -File packaging\windows\check-install.ps1 -RequireShortcuts`. Expected result: - the Desktop shortcut and `Programs\Flaxative.lnk` both show `Forked.Flaxative` and point into `%LocalAppData%\Flaxative` - the uninstall entry is listed - `flaxative` is owned by Flaxative Also check whether an update from an older install leaves `Programs\Charles Daoust\Flaxative.lnk` behind. Velopack's handling of shortcut locations that were removed is not verified; the script reports that shortcut as "older installs". Refs #544 Refs #614 Closes #834 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
- vpk pack --shortcuts Desktop,StartMenuRoot (names checked against `vpk [win] pack -H`
  of vpk 1.2.161), both with --aumid Forked.Flaxative.
- packaging/windows/check-install.ps1: shortcut targets and AUMIDs (read from the .lnk
  property store), uninstall entry, Run value, flaxative/fluxer scheme owners, install
  folder; non-zero when a shortcut's AUMID differs. Run by the release workflow's
  installer smoke test.
- packaging/linux/flaxative.desktop: Version, MimeType, SingleMainWindow, Actions and the
  open-settings action, in the keys and order fluxer_platform::desktop_entry writes.

Refs #834

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Author
Owner

Independent review: Task 42 (packaging: Windows shortcuts and checks, desktop file)

I reviewed only 158c90dd..aaf5e0fd (one commit).

Plan tests

  • vpk_args_have_both_shortcuts_and_aumid is present. It goes through windows_pack_args, the same function package_windows passes to vpk, and asserts --shortcuts Desktop,StartMenuRoot (exactly once) and --aumid Forked.Flaxative. These are the values in spec §10.4 and §18 Q9.
  • packaged_desktop_file_matches_written_one is present. It compares groups, keys and order with Task 18's fn body, and compares values wherever the writer uses a literal or a const.
  • check_install_script_expects_the_packed_identity is extra. It ties the script to SHORTCUT_AUMID, PACK_ID, PACK_TITLE, MAIN_EXE, PACK_AUTHORS and both schemes.

Interfaces

  • Shortcuts go to the Desktop and to the Start menu root, both carrying Forked.Flaxative.
  • check-install.ps1 prints each shortcut's target and AUMID, the uninstall entry, the Run value (Forked.Flaxative, matching Task 19's interface and spec §5), the flaxative and fluxer scheme owners, and the install folder. It exits non-zero when an AUMID differs.
  • The release workflow runs it after the install smoke test and before the uninstall.

Invariants

  • No Rust client code or cfg(windows) code changed, and no new dependencies were added.
  • There are no secrets or tokens. Charles Daoust is the existing PACK_AUTHORS value.
  • The script makes no changes.

Parity checks against /home/cdaoust/src/fluxer-soundboard:

  1. D/LinuxDesktopEntry.ts:145-165 (Version=1.5, SingleMainWindow=true, Categories, MimeType, Actions, and the [Desktop Action …] group). The packaged file has the same keys.
  2. D/MainI18n.ts:99 gives "Open settings" for the action name.
  3. D/Autostart.ts:117-143 names the Windows Run value after WINDOWS_APP_USER_MODEL_ID. The script reads Run\Forked.Flaxative.

Review Focus 8

  • No client-written file is touched.
  • The packaged entry contains no paths.

Other checks I ran

  • I built .lnk files following [MS-SHLLINK] (Unicode LinkInfo, arguments, a property storage holding a VT_CLSID value ahead of the VT_LPWSTR AUMID) and ran pwsh -File check-install.ps1 -ShortcutFile … on them:
    • the Forked.Flaxative file gave rc=0 with the correct target
    • the velopack.Flaxative file gave rc=1
  • I checked these offsets against the spec: LinkInfo 16/24/28/32, PropertyStore signature 0xA0000009, the serialized value's type at +9 and the string at +17.
  • $LASTEXITCODE after cmd /c … | Log is still cmd's exit code, because Log only calls cmdlets.

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci on aaf5e0fd: all steps passed. That run included appimage_has_flaxative_desktop_icon_and_binary (appimagetool accepted the new desktop file with its action group) and Task 18's writes_entry_with_expected_keys.

Findings

  • minor: the PR title is Shell 42: packaging-windows-shortcuts-and (#834). The plan's convention is Shell 42: Packaging: Windows shortcuts and checks, desktop file (#834), which is the issue's title.
  • minor (.forgejo/workflows/release.yaml): if check-install.ps1 fails, the throw skips Update.exe --uninstall. That leaves the temp install and its Desktop/Start-menu shortcuts on the runner account. The earlier throws in that step already behave this way, and a stale shortcut never trips the next run's AUMID check because it still carries Forked.Flaxative. Not blocking.
  • minor (xtask/src/package.rs): packaged_desktop_file_matches_written_one parses fn body's source text, so reformatting the writer, such as renaming a const or splitting a literal, breaks it. It fails loudly, through the key-order assert and >= 18, never silently. This is an accepted, documented deviation.
  • note: whether a Velopack update removes the old Programs\Charles Daoust\Flaxative.lnk is not verified. The PR already lists it for Charles's hand check (Task 44).

Verdict: approved. There are no blocking findings, and the local gate is green.

## Independent review: Task 42 (packaging: Windows shortcuts and checks, desktop file) I reviewed only `158c90dd..aaf5e0fd` (one commit). **Plan tests** - `vpk_args_have_both_shortcuts_and_aumid` is present. It goes through `windows_pack_args`, the same function `package_windows` passes to `vpk`, and asserts `--shortcuts Desktop,StartMenuRoot` (exactly once) and `--aumid Forked.Flaxative`. These are the values in spec §10.4 and §18 Q9. - `packaged_desktop_file_matches_written_one` is present. It compares groups, keys and order with Task 18's `fn body`, and compares values wherever the writer uses a literal or a const. - `check_install_script_expects_the_packed_identity` is extra. It ties the script to `SHORTCUT_AUMID`, `PACK_ID`, `PACK_TITLE`, `MAIN_EXE`, `PACK_AUTHORS` and both schemes. **Interfaces** - Shortcuts go to the Desktop and to the Start menu root, both carrying `Forked.Flaxative`. - `check-install.ps1` prints each shortcut's target and AUMID, the uninstall entry, the `Run` value (`Forked.Flaxative`, matching Task 19's interface and spec §5), the `flaxative` and `fluxer` scheme owners, and the install folder. It exits non-zero when an AUMID differs. - The release workflow runs it after the install smoke test and before the uninstall. **Invariants** - No Rust client code or `cfg(windows)` code changed, and no new dependencies were added. - There are no secrets or tokens. `Charles Daoust` is the existing `PACK_AUTHORS` value. - The script makes no changes. **Parity checks** against `/home/cdaoust/src/fluxer-soundboard`: 1. `D/LinuxDesktopEntry.ts:145-165` (`Version=1.5`, `SingleMainWindow=true`, `Categories`, `MimeType`, `Actions`, and the `[Desktop Action …]` group). The packaged file has the same keys. 2. `D/MainI18n.ts:99` gives "Open settings" for the action name. 3. `D/Autostart.ts:117-143` names the Windows Run value after `WINDOWS_APP_USER_MODEL_ID`. The script reads `Run\Forked.Flaxative`. **Review Focus 8** - No client-written file is touched. - The packaged entry contains no paths. **Other checks I ran** - I built `.lnk` files following [MS-SHLLINK] (Unicode LinkInfo, arguments, a property storage holding a VT_CLSID value ahead of the VT_LPWSTR AUMID) and ran `pwsh -File check-install.ps1 -ShortcutFile …` on them: - the `Forked.Flaxative` file gave rc=0 with the correct target - the `velopack.Flaxative` file gave rc=1 - I checked these offsets against the spec: LinkInfo 16/24/28/32, PropertyStore signature 0xA0000009, the serialized value's type at +9 and the string at +17. - `$LASTEXITCODE` after `cmd /c … | Log` is still cmd's exit code, because `Log` only calls cmdlets. **Local gate**: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` on aaf5e0fd: **all steps passed**. That run included `appimage_has_flaxative_desktop_icon_and_binary` (appimagetool accepted the new desktop file with its action group) and Task 18's `writes_entry_with_expected_keys`. ### Findings - **minor**: the PR title is `Shell 42: packaging-windows-shortcuts-and (#834)`. The plan's convention is `Shell 42: Packaging: Windows shortcuts and checks, desktop file (#834)`, which is the issue's title. - **minor** (`.forgejo/workflows/release.yaml`): if `check-install.ps1` fails, the `throw` skips `Update.exe --uninstall`. That leaves the temp install and its Desktop/Start-menu shortcuts on the runner account. The earlier throws in that step already behave this way, and a stale shortcut never trips the next run's AUMID check because it still carries `Forked.Flaxative`. Not blocking. - **minor** (`xtask/src/package.rs`): `packaged_desktop_file_matches_written_one` parses `fn body`'s source text, so reformatting the writer, such as renaming a const or splitting a literal, breaks it. It fails loudly, through the key-order assert and `>= 18`, never silently. This is an accepted, documented deviation. - **note**: whether a Velopack update removes the old `Programs\Charles Daoust\Flaxative.lnk` is not verified. The PR already lists it for Charles's hand check (Task 44). **Verdict: approved.** There are no blocking findings, and the local gate is green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into shell by hand (the merge API returns 405); the commits are in the branch.

Merged into `shell` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-18 06:57:32 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.