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 93352da1d0
commit 5fd47421f9
2 files changed
+36 -2

No files matched your search

@@ -601,8 +601,14 @@ class Installer:
def put(self, source, rel):
target = self.out / rel
# A DuplicateFile row can name the file's own folder and name (the .NET host packages copy
# dotnet.exe onto itself); Windows Installer takes that as nothing to do. Found and diagnosed
# by whatsupbros on the DroidDeck Discord.
if target.exists() and Path(source).samefile(target):
return False
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(source, target)
return True
def install_files(self, unpacked):
assemblies = self.assemblies()
@@ -664,8 +670,7 @@ class Installer:
folder = self.directory(row["DestFolder"]) if row.get("DestFolder") else self.files[row["File_"]].rsplit("/", 1)[0]
name = long_name(row.get("DestName", "")) or self.files[row["File_"]].rsplit("/", 1)[1]
source = self.out / self.files[row["File_"]]
if folder and source.is_file() and "/" not in name:
self.put(source, folder + "/" + name)
if folder and source.is_file() and "/" not in name and self.put(source, folder + "/" + name):
self.counts["files"] += 1
if missing:
self.notes.append("%d file(s) were not in the package's cabinets" % missing)