aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Util/wixext
diff options
context:
space:
mode:
authorBevan Weiss <bevan.weiss@gmail.com>2024-07-06 21:03:57 +1000
committerRob Mensching <rob@firegiant.com>2025-02-11 23:14:49 -0800
commit644276562dcadd65fcb0e9a7c06c704cdda36423 (patch)
treef42af115bf5354d1c1691c44d517388f6c369b16 /src/ext/Util/wixext
parent7b1bb025dea1d1e9e144cce0dcbba2d86f053b8f (diff)
downloadwix-644276562dcadd65fcb0e9a7c06c704cdda36423.tar.gz
wix-644276562dcadd65fcb0e9a7c06c704cdda36423.tar.bz2
wix-644276562dcadd65fcb0e9a7c06c704cdda36423.zip
Group Add/Remove working.
Local group membership Add/Remove working, however with BUILTIN local system groups .NET doesn't appear to locate them as either groups nor basic security Principals. Still needs work to fix the test for nested groups. Ideally with some way to test for domain groups. Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
Diffstat (limited to 'src/ext/Util/wixext')
-rw-r--r--src/ext/Util/wixext/UtilCompiler.cs7
-rw-r--r--src/ext/Util/wixext/UtilDecompiler.cs18
2 files changed, 20 insertions, 5 deletions
diff --git a/src/ext/Util/wixext/UtilCompiler.cs b/src/ext/Util/wixext/UtilCompiler.cs
index aff7dd0d..4b1e43b5 100644
--- a/src/ext/Util/wixext/UtilCompiler.cs
+++ b/src/ext/Util/wixext/UtilCompiler.cs
@@ -1475,7 +1475,7 @@ namespace WixToolset.Util
1475 1475
1476 if (null != componentId) 1476 if (null != componentId)
1477 { 1477 {
1478 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4ConfigureGroups", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64); 1478 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix6ConfigureGroups", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64);
1479 } 1479 }
1480 1480
1481 foreach (var child in element.Elements()) 1481 foreach (var child in element.Elements())
@@ -1488,7 +1488,7 @@ namespace WixToolset.Util
1488 this.ParseGroupRefElement(intermediate, section, child, id.Id, groupType:true); 1488 this.ParseGroupRefElement(intermediate, section, child, id.Id, groupType:true);
1489 break; 1489 break;
1490 default: 1490 default:
1491 //this.ParseHelper.UnexpectedElement(element, child); 1491 this.ParseHelper.UnexpectedElement(element, child);
1492 break; 1492 break;
1493 } 1493 }
1494 } 1494 }
@@ -1561,6 +1561,9 @@ namespace WixToolset.Util
1561 } 1561 }
1562 else 1562 else
1563 { 1563 {
1564 // Add reference to bring in fragment
1565 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix6AddGroupMembership", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64);
1566
1564 section.AddSymbol(new GroupGroupSymbol(sourceLineNumbers) 1567 section.AddSymbol(new GroupGroupSymbol(sourceLineNumbers)
1565 { 1568 {
1566 ChildGroupRef = childId, 1569 ChildGroupRef = childId,
diff --git a/src/ext/Util/wixext/UtilDecompiler.cs b/src/ext/Util/wixext/UtilDecompiler.cs
index 53b75b8d..a236ece9 100644
--- a/src/ext/Util/wixext/UtilDecompiler.cs
+++ b/src/ext/Util/wixext/UtilDecompiler.cs
@@ -478,14 +478,26 @@ namespace WixToolset.Util
478 { 478 {
479 foreach (var row in table.Rows) 479 foreach (var row in table.Rows)
480 { 480 {
481 var parentId = row.FieldAsString(0);
482 var parentExists = this.DecompilerHelper.TryGetIndexedElement("Group", parentId, out var parentGroup);
483
481 var childId = row.FieldAsString(1); 484 var childId = row.FieldAsString(1);
482 if (this.DecompilerHelper.TryGetIndexedElement("Group", childId, out var group)) 485 var childExists = this.DecompilerHelper.TryGetIndexedElement("Group", childId, out var childGroup);
486
487 if (parentExists && childExists)
483 { 488 {
484 group.Add(new XElement(UtilConstants.GroupRefName, new XAttribute("Id", row.FieldAsString(0)))); 489 childGroup.Add(new XElement(UtilConstants.GroupRefName, new XAttribute("Id", parentId)));
485 } 490 }
486 else 491 else
487 { 492 {
488 this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(), "Parent_", childId, "Group")); 493 if(!parentExists)
494 {
495 this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(), "Parent_", parentId, "Group"));
496 }
497 if (!childExists)
498 {
499 this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(), "Child_", childId, "Group"));
500 }
489 } 501 }
490 } 502 }
491 } 503 }