Files
craft-launcher/crates/native
JeremyandClaude Opus 5.5 8c651be747 fix(windows): read an MSI's install context without starting PowerShell (#1082)
* fix(windows): read an MSI's install context without starting PowerShell

The update path ran a hidden PowerShell that asked the WindowsInstaller COM
object which context a product was installed in. That is the pattern
behavioural antivirus flagged in #1045. The context now comes from
Windows Installer's own registration keys, read the way ProductsEx reads
them: this account's managed and unmanaged products and the machine's,
under the product code's packed name. A key the launcher may not read is
still a lookup that didn't run, so the uninstall-record fallback is
unchanged. Nothing in an update starts PowerShell any more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(windows): declare winsafe's advapi feature and avoid a panicking split

From review:
- current_user_sid uses HACCESSTOKEN and TokenInfo, which need winsafe's advapi
  feature. It built only because craft-update enables it; now declared here.
- packed_code uses split_at_checked, like the .get() calls after it.
- The incident note lists the replaced lookup under "What changed", not "Still open".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: accept any well-formed account SID, not only S-1-5-

A Microsoft Entra ID account's SID starts S-1-12-1-, so the test failed on
those machines although the lookup works. It now checks the SID's shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 22:42:43 -05:00
..