aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2021-04-12 15:13:08 -0400
committerBob Arnson <bob@firegiant.com>2021-04-12 15:22:15 -0400
commit3f4bd928ab4c048792bf4c5c10004a1f22e8aa19 (patch)
treea884ad428b3db891adefb3111dc8819e90c83855 /src/WixToolset.Core.WindowsInstaller
parentd77302d94b356a1db2b2b834e45c8962381eae6b (diff)
downloadwix-3f4bd928ab4c048792bf4c5c10004a1f22e8aa19.tar.gz
wix-3f4bd928ab4c048792bf4c5c10004a1f22e8aa19.tar.bz2
wix-3f4bd928ab4c048792bf4c5c10004a1f22e8aa19.zip
Fix decompilation of directories as children TARGETDIR.
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
index eb23f497..0b45a8b3 100644
--- a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
@@ -4352,7 +4352,7 @@ namespace WixToolset.Core.WindowsInstaller.Decompile
4352 4352
4353 if (id == "TARGETDIR") 4353 if (id == "TARGETDIR")
4354 { 4354 {
4355 // Skip TARGETDIR. 4355 // Skip TARGETDIR (but see below!).
4356 } 4356 }
4357 else if (row.IsColumnNull(1) || WindowsInstallerStandard.IsStandardDirectory(id)) 4357 else if (row.IsColumnNull(1) || WindowsInstallerStandard.IsStandardDirectory(id))
4358 { 4358 {
@@ -4360,7 +4360,9 @@ namespace WixToolset.Core.WindowsInstaller.Decompile
4360 } 4360 }
4361 else 4361 else
4362 { 4362 {
4363 if (!this.TryGetIndexedElement("Directory", out var xParentDirectory, row.FieldAsString(1))) 4363 var parentDirectoryId = row.FieldAsString(1);
4364
4365 if (!this.TryGetIndexedElement("Directory", out var xParentDirectory, parentDirectoryId))
4364 { 4366 {
4365 this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Directory_Parent", row.FieldAsString(1), "Directory")); 4367 this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Directory_Parent", row.FieldAsString(1), "Directory"));
4366 } 4368 }
@@ -4370,7 +4372,15 @@ namespace WixToolset.Core.WindowsInstaller.Decompile
4370 } 4372 }
4371 else 4373 else
4372 { 4374 {
4373 xParentDirectory.Add(xDirectory); 4375 // TARGETDIR is omitted but if this directory is a first-generation descendant, add it as a root.
4376 if (parentDirectoryId == "TARGETDIR")
4377 {
4378 this.RootElement.Add(xDirectory);
4379 }
4380 else
4381 {
4382 xParentDirectory.Add(xDirectory);
4383 }
4374 } 4384 }
4375 } 4385 }
4376 } 4386 }