fix: Windows components: .NET Core / Desktop runtimes install again (#740)

droiddeck-msi-install: a DuplicateFile entry onto the file itself (dotnet.exe in the .NET host MSI) is skipped like Windows Installer does, instead of stopping the whole install with SameFileError. Fixes .NET Desktop 3/6/7/8, .NET Core 3 and .NET 5. Thanks to whatsupbros for finding and tracing it.
This commit is contained in:
The412Banner authored and GitHub committed 2026-10-13 19:03:38 -04:00
1 parent 02888834d4
commit 4163b31b02
2 files changed
+36 -2

No files matched your search

+29
View File
@@ -119,6 +119,35 @@ class LayoutTest(unittest.TestCase):
inst.select()
self.assertEqual(inst.included_components, {"Up", "Wide"})
def test_a_duplicate_onto_the_file_itself_is_skipped(self):
# The .NET host packages (dotnet-host-*-win-x86.msi) duplicate dotnet.exe into its own
# folder under its own name; copying it onto itself raised SameFileError and stopped every
# .NET Core / Desktop runtime install.
with tempfile.TemporaryDirectory() as tmp:
src = Path(tmp) / "cab" / "dotnet.exe"
src.parent.mkdir()
src.write_bytes(b"MZ")
out = Path(tmp) / "out"
inst = installer({
"Directory": rows("Directory Directory_Parent DefaultDir",
("TARGETDIR", "", "SourceDir"),
("ProgramFilesFolder", "TARGETDIR", "PFiles"),
("DOTNETHOME", "ProgramFilesFolder", "dotnet"),
("DOTNETHOME_X86", "ProgramFilesFolder", "dotnet")),
"Component": rows("Component Directory_ Attributes Condition KeyPath",
("Host", "DOTNETHOME", "0", "", "DotnetExe")),
"Feature": rows("Feature Feature_Parent Level", ("Main", "", "1")),
"FeatureComponents": rows("Feature_ Component_", ("Main", "Host")),
"File": rows("File Component_ FileName", ("DotnetExe", "Host", "dotnet.exe")),
"DuplicateFile": rows("FileKey Component_ File_ DestName DestFolder",
("Dup", "Host", "DotnetExe", "", "DOTNETHOME_X86")),
}, out=str(out))
inst.select()
inst.install_files({"DotnetExe": src})
placed = out / "drive_c/Program Files (x86)/dotnet/dotnet.exe"
self.assertEqual(placed.read_bytes(), b"MZ")
self.assertEqual(inst.counts["files"], 1)
def test_global_assembly_paths(self):
with tempfile.TemporaryDirectory() as tmp:
dll = Path(tmp) / "a.dll"