From ad30eb12b99e44014e6a1e1df718ad28e7ee0655 Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 11 Sep 2026 15:37:56 -0400 Subject: [PATCH] fix(msi): set install directory during silent installs and upgrades SetInstallDirProperty only ran in InstallUISequence, which Windows Installer skips for /passive and /qn (the modes winget uses). With MSI_INSTALLATIONDIRECTORY unset, the files and the service went to the root of the drive with the most free space. Upgrades from releases that did not store MSI_INSTALLATIONDIRECTORY in the registry hit the same path, even with the full UI. The action now runs before CostFinalize in both sequences, whenever the registry search did not find a saved directory, and defaults to [ProgramFiles64Folder]Navidrome\ (ProgramFilesFolder on x86) so it does not depend on INSTALLDIR being resolved. The unused INSTALLDIR directory is removed. Verified on a GitHub Actions Windows runner: fresh installs with /passive, /qn and /qr, upgrades from 0.63.1 with /passive and /qr, and an upgrade between two fixed builds that keeps a custom directory and port. --- release/wix/navidrome.wxs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/release/wix/navidrome.wxs b/release/wix/navidrome.wxs index 8c20e109d..71a6de6b5 100644 --- a/release/wix/navidrome.wxs +++ b/release/wix/navidrome.wxs @@ -37,14 +37,9 @@ - + - - - - - @@ -97,8 +92,12 @@ + + NOT MSI_INSTALLATIONDIRECTORY + + - (Not Installed AND NOT WIX_UPGRADE_DETECTED) OR (MSI_INSTALLATIONDIRECTORY=TARGETDIR) + NOT MSI_INSTALLATIONDIRECTORY Not Installed AND NOT WIX_UPGRADE_DETECTED