Skip to content

fix: the MSI package can add the mrdocs bin/ directory to the PATH - #1324

Open
gennaroprota wants to merge 2 commits into
cppalliance:developfrom
gennaroprota:fix/the_msi_package_can_add_the_mrdocs_installation_directory_to_the_path
Open

gennaroprota wants to merge 2 commits into
cppalliance:developfrom
gennaroprota:fix/the_msi_package_can_add_the_mrdocs_installation_directory_to_the_path

Conversation

@gennaroprota

Copy link
Copy Markdown
Collaborator

Installing MrDocs from the MSI didn't add mrdocs to the PATH, so it couldn't be run by name. This PR makes the MSI offer to add it. It also fixes a related problem: each MSI had a new upgrade code, so a newer MSI didn't replace the install already there. This means that entries for both old and new installations would be added to PATH.

Changes

  • Build:
    • The MSI has a fixed upgrade code, so installing a newer one replaces the previous install.
    • A new dialog in the installer asks, with a checkbox checked by default, whether to add the installation's bin/ directory to the system PATH. The checkbox selects a hidden feature that holds the PATH entry, so:
      • Uninstalling removes the entry;
      • Change can add or remove it later;
      • A silent install can leave it out with REMOVE=AddToPath.
    • The dialog is added by a CPack patch file, utils/cmake/wix-patch.xml.in, on top of CPack's standard installer UI.
    • Only a per-machine install may change the system PATH, so the MSI now declares that scope. It declared none before.

Testing

Built the MSI locally with CPack and WiX 3.14, and checked its tables:

  • The upgrade code is fixed, and the install is per-machine.
  • The PATH entry is appended to the system PATH on install and removed on uninstall.
  • The installer's buttons lead through the new dialog for a first install and for Change, and bypass it for Repair and Remove.

WiX's validation passes, with only the ICE61 warning, which comes from CPack's own MSI template. CI builds the MSI on every Windows build.

Documentation

The Windows tip on the Install page says that the MSI adds bin\ to the PATH, and how to add it later.

Closes #1018.

This fixes a bug for which installing MrDocs from a newer MSI did not
replace the MrDocs already installed, because CPack gave every MSI a new
upgrade code, so Windows saw each as an unrelated product. CI's logs
warn about it: "CPACK_WIX_UPGRADE_GUID implicitly set".

With a fixed upgrade code, the major upgrade that CPack's MSI template
declares finds the previous install and removes it.
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🧰 Tooling 96% 110 110 - 2 1 1 - -
📄 Docs 4% 4 3 1 1 - 1 - -
Total 100% 114 113 1 3 1 2 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • utils/cmake/wix-patch.xml.in (Tooling): 96 lines Δ (+96 / -0)
  • utils/cmake/install.cmake (Tooling): 14 lines Δ (+14 / -0)
  • docs/modules/ROOT/pages/install.adoc (Docs): 4 lines Δ (+3 / -1)

Generated by 🚫 dangerJS against ec8f18a

@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.12%. Comparing base (adc6242) to head (ec8f18a).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1324   +/-   ##
========================================
  Coverage    83.12%   83.12%           
========================================
  Files           35       35           
  Lines         3662     3662           
  Branches       844      844           
========================================
  Hits          3044     3044           
  Misses         410      410           
  Partials       208      208           
Flag Coverage Δ
bootstrap 83.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The MSI now asks, with a checkbox checked by default, whether to add the
mrdocs installation directory to the system PATH, and uninstalling
MrDocs removes it again.

Only a per-machine install may change the system PATH, so the MSI now
declares that scope (it declared no scope before).

Fixes cppalliance#1018.
@gennaroprota
gennaroprota force-pushed the fix/the_msi_package_can_add_the_mrdocs_installation_directory_to_the_path branch from 357d7f8 to ec8f18a Compare September 25, 2026 15:50
@gennaroprota gennaroprota changed the title fix: the MSI package can add the mrdocs installation directory to the PATH fix: the MSI package can add the mrdocs bin/ directory to the PATH Sep 25, 2026
@cppalliance-bot

cppalliance-bot commented Sep 25, 2026 •

Copy link
Copy Markdown

An automated preview of the documentation is available at https://1324.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-09-25 16:02:22 UTC

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mrdocs not in the PATH after installing from MSI

2 participants