Skip to content

Build the MSI with cimipkg instead of WiX - #16

Open
rodchristiansen wants to merge 1 commit into
mainfrom
cimipkg-msi
Open

rodchristiansen wants to merge 1 commit into
mainfrom
cimipkg-msi

Conversation

@rodchristiansen

Copy link
Copy Markdown
Contributor

This PR stays a draft until a choice is made: move the MSI to cimipkg (this PR), or first fix the WiX build's UpgradeCode.

Why

Every WiX-built release gets a random UpgradeCode, because .wix-upgrade-code is never committed and CI generates a new one each time. There is no MajorUpgrade either, so each release installs alongside the previous ones instead of replacing them. For example, v2026.10.07.1517 has {F93C3305-…} and v2026.10.07.1403 has {7FC5FA55-…}.

What changed

  • build.ps1 -Msi uses cimipkg. It stages the publish output, scripts/ and build-info.yaml (with ${TIMESTAMP} and architecture filled in), then runs cimipkg. cimipkg is found in tools\ (gitignored) or on PATH. cimipkg derives a stable UpgradeCode from the identifier ({0e959fd4-b21a-53e2-bc69-23eada0614ce}) and supersedes older builds. All the WiX authoring code is removed.
  • No new install logic. scripts/postinstall.ps1 already handled the PATH entry, the Start menu shortcut and the ManagedNotifications ACLs. scripts/uninstall.ps1 already removes the shortcut and PATH entry.
  • Release workflow. release.yml downloads cimipkg instead of installing WiX.
  • Cleanup script. deploy/Remove-WixCsharpDialog.ps1 uninstalls the side-by-side WiX installs, matching DisplayName csharpDialog and Publisher windowsadmins. cimipkg builds are never touched, because their publisher is Windows Admins Open Source. Run it before the first cimipkg release lands: a WiX uninstall removes the files, PATH entry and shortcut that the cimipkg package also uses. sbin-installer already removes same-name products before it installs, in that order.

Tested

  • Build. build.ps1 -Build -Msi on a Windows 11 x64 build host produced csharpdialog-x64 and csharpdialog-arm64 MSIs through cimipkg.
    • Both carry UpgradeCode {0e959fd4-b21a-53e2-bc69-23eada0614ce} and version 26.10.801.
    • The x64 MSI holds 762 files plus the pre-, post- and uninstall scripts.
  • Install in Windows Sandbox (Windows 11 26100, msiexec as SYSTEM). This used an MSI from the VBScript-free cimipkg (cimian-pkg#51), because Sandbox has no VBScript:
Step Exit ARP PATH entry Start menu shortcut dialog.exe ManagedNotifications DACL
WiX release v2026.10.07.1517 installed 0 26.10.7.1517 / windowsadmins yes yes yes D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
Remove-WixCsharpDialog.ps1 0 none no no no unchanged (folder is kept)
cimipkg build installed 0 26.10.801 / Windows Admins Open Source yes yes yes D:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
cimipkg build uninstalled 0 none no no no kept
WiX release reinstalled, then sbin-installer installs the cimipkg build 0 26.10.801 only; the WiX product was removed by name yes yes yes D:PAI…
  • The one difference. The WiX MSI wrote the ManagedNotifications DACL as D:P, and postinstall.ps1 writes it as D:PAI. The ACEs are identical, and both are protected (no inheritance from ProgramData). AI only marks the DACL as auto-inherited for propagation to children.

Not tested

  • A machine holding several side-by-side WiX installs. Only one WiX release MSI was available. The cleanup script loops over every match.
  • arm64. No device is available here.
  • The release workflow. It was not run.

The WiX MSI generated a new UpgradeCode for every release (.wix-upgrade-code is never committed) and had no MajorUpgrade, so each release installed beside the previous ones. build.ps1 -Msi now stages the publish output, scripts/ and build-info.yaml and runs cimipkg, which gives a stable UpgradeCode from the identifier and supersedes older builds; scripts/postinstall.ps1 already does the PATH entry, Start menu shortcut and ManagedNotifications ACLs the WiX source declared. The release workflow downloads cimipkg instead of installing WiX.

deploy/Remove-WixCsharpDialog.ps1 uninstalls the side-by-side WiX installs (DisplayName csharpDialog, Publisher windowsadmins) and is meant to run before the first cimipkg release lands.
@rodchristiansen
rodchristiansen marked this pull request as ready for review October 8, 2026 13:30
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.

1 participant