From 21d8d2278b2f8083bc161e6704b207582cc1c339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger-Stelzer?= Date: Fri, 18 Sep 2026 19:01:48 +0200 Subject: [PATCH] Pin SfxCA to DTF 5.0.2 so non-elevated setup can extract custom actions. Co-authored-by: Cursor --- BthPS3Installer/InstallScript.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/BthPS3Installer/InstallScript.cs b/BthPS3Installer/InstallScript.cs index 72f74c5..3ae42e5 100644 --- a/BthPS3Installer/InstallScript.cs +++ b/BthPS3Installer/InstallScript.cs @@ -306,6 +306,32 @@ private static void Main() project.ResolveWildCards(); + // WiX 4.0.5+ extracts the SFXCA payload into C:\Windows\Installer, which an + // impersonated standard-user token cannot write, so every non-elevated launch + // fails with "SFXCA: Failed to create temp directory. Error code 5" (1603). + // Fixed in the v5 custom-action tooling; see wixtoolset/issues#8078. + WixTools.WixDtfPackages = new[] + { + // PackageDir() matches this array case-sensitively against lowercase + // nuget cache folder names (wixtoolset.dtf.customaction). PascalCase IDs + // restore the nupkg but still resolve SfxCA.dll from GlobalWixVersion (4.0.6). + ("wixtoolset.dtf.customaction", "5.0.2"), + ("wixtoolset.dtf.windowsinstaller", "4.0.6"), + ("wixtoolset.heat", "*"), + ("wixtoolset.mba.core", "*") + }; + WixTools.RestoreDtfPackages(); + + string sfxCa = WixTools.SfxCAFor(true); + FileVersionInfo sfxCaVersion = FileVersionInfo.GetVersionInfo(sfxCa); + Console.WriteLine($"SfxCA.dll: {sfxCaVersion.FileVersion} ({sfxCa})"); + if (sfxCaVersion.FileMajorPart < 5) + { + throw new InvalidOperationException( + $"SfxCA.dll {sfxCaVersion.FileVersion} at '{sfxCa}' predates the WiX v5 temp-folder fix; " + + "non-elevated installs would fail with 1603."); + } + project.BuildMsi(); }