aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Decompile
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-01-13 14:41:17 -0800
committerRob Mensching <rob@firegiant.com>2020-02-05 16:15:47 -0800
commit6e2e67ab55c75f4655397588c0dcc64f50d22f92 (patch)
tree01290e7b07ec6e4e4384e8fed568f14283f65d61 /src/WixToolset.Core.WindowsInstaller/Decompile
parentc9c3ab2776252d3131fea561bd3f3fac8c045f5e (diff)
downloadwix-6e2e67ab55c75f4655397588c0dcc64f50d22f92.tar.gz
wix-6e2e67ab55c75f4655397588c0dcc64f50d22f92.tar.bz2
wix-6e2e67ab55c75f4655397588c0dcc64f50d22f92.zip
Remove WixActionRowCollection and duplicate actions.xml
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Decompile')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
index b1222d3d..aa8921ed 100644
--- a/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
@@ -13,7 +13,6 @@ namespace WixToolset.Core.WindowsInstaller
13 using System.Text.RegularExpressions; 13 using System.Text.RegularExpressions;
14 using System.Xml.Linq; 14 using System.Xml.Linq;
15 using WixToolset.Core; 15 using WixToolset.Core;
16 using WixToolset.Core.WindowsInstaller.Rows;
17 using WixToolset.Data; 16 using WixToolset.Data;
18 using WixToolset.Data.Tuples; 17 using WixToolset.Data.Tuples;
19 using WixToolset.Data.WindowsInstaller; 18 using WixToolset.Data.WindowsInstaller;
@@ -104,7 +103,7 @@ namespace WixToolset.Core.WindowsInstaller
104 { 103 {
105 if (null == output) 104 if (null == output)
106 { 105 {
107 throw new ArgumentNullException("output"); 106 throw new ArgumentNullException(nameof(output));
108 } 107 }
109 108
110 this.OutputType = output.Type; 109 this.OutputType = output.Type;
@@ -1534,9 +1533,7 @@ namespace WixToolset.Core.WindowsInstaller
1534 1533
1535 foreach (Wix.ISchemaElement element in component.Children) 1534 foreach (Wix.ISchemaElement element in component.Children)
1536 { 1535 {
1537 var file = element as Wix.File; 1536 if (element is Wix.File file && Wix.YesNoType.yes == file.KeyPath)
1538
1539 if (null != file && Wix.YesNoType.yes == file.KeyPath)
1540 { 1537 {
1541 file.AddChild(typeLib); 1538 file.AddChild(typeLib);
1542 } 1539 }
@@ -2511,10 +2508,10 @@ namespace WixToolset.Core.WindowsInstaller
2511 2508
2512 if (null != table) 2509 if (null != table)
2513 { 2510 {
2514 var actionRows = new ArrayList(); 2511 var actionRows = new List<WixActionRow>();
2515 var needAbsoluteScheduling = this.SuppressRelativeActionSequencing; 2512 var needAbsoluteScheduling = this.SuppressRelativeActionSequencing;
2516 var nonSequencedActionRows = new WixActionRowCollection(); 2513 var nonSequencedActionRows = new Dictionary<string, WixActionRow>();
2517 var suppressedRelativeActionRows = new WixActionRowCollection(); 2514 var suppressedRelativeActionRows = new Dictionary<string, WixActionRow>();
2518 2515
2519 // create a sorted array of actions in this table 2516 // create a sorted array of actions in this table
2520 foreach (var row in table.Rows) 2517 foreach (var row in table.Rows)
@@ -2538,7 +2535,7 @@ namespace WixToolset.Core.WindowsInstaller
2538 2535
2539 for (var i = 0; i < actionRows.Count && !needAbsoluteScheduling; i++) 2536 for (var i = 0; i < actionRows.Count && !needAbsoluteScheduling; i++)
2540 { 2537 {
2541 var actionRow = (WixActionRow)actionRows[i]; 2538 var actionRow = actionRows[i];
2542 this.StandardActions.TryGetValue(actionRow.GetPrimaryKey(), out var standardActionRow); 2539 this.StandardActions.TryGetValue(actionRow.GetPrimaryKey(), out var standardActionRow);
2543 2540
2544 // create actions for custom actions, dialogs, AppSearch when its moved, and standard actions with non-standard conditions 2541 // create actions for custom actions, dialogs, AppSearch when its moved, and standard actions with non-standard conditions
@@ -2550,13 +2547,13 @@ namespace WixToolset.Core.WindowsInstaller
2550 // find the previous action row if there is one 2547 // find the previous action row if there is one
2551 if (0 <= i - 1) 2548 if (0 <= i - 1)
2552 { 2549 {
2553 previousActionRow = (WixActionRow)actionRows[i - 1]; 2550 previousActionRow = actionRows[i - 1];
2554 } 2551 }
2555 2552
2556 // find the next action row if there is one 2553 // find the next action row if there is one
2557 if (actionRows.Count > i + 1) 2554 if (actionRows.Count > i + 1)
2558 { 2555 {
2559 nextActionRow = (WixActionRow)actionRows[i + 1]; 2556 nextActionRow = actionRows[i + 1];
2560 } 2557 }
2561 2558
2562 // the logic for setting the before or after attribute for an action: 2559 // the logic for setting the before or after attribute for an action:
@@ -2594,7 +2591,7 @@ namespace WixToolset.Core.WindowsInstaller
2594 } 2591 }
2595 else if (null != standardActionRow && actionRow.Condition != standardActionRow.Condition) // standard actions get their standard sequence numbers 2592 else if (null != standardActionRow && actionRow.Condition != standardActionRow.Condition) // standard actions get their standard sequence numbers
2596 { 2593 {
2597 nonSequencedActionRows.Add(actionRow); 2594 nonSequencedActionRows.Add(actionRow.GetPrimaryKey(), actionRow);
2598 } 2595 }
2599 else if (0 < actionRow.Sequence) 2596 else if (0 < actionRow.Sequence)
2600 { 2597 {
@@ -2603,25 +2600,27 @@ namespace WixToolset.Core.WindowsInstaller
2603 } 2600 }
2604 else 2601 else
2605 { 2602 {
2606 suppressedRelativeActionRows.Add(actionRow); 2603 suppressedRelativeActionRows.Add(actionRow.GetPrimaryKey(), actionRow);
2607 } 2604 }
2608 } 2605 }
2609 2606
2610 // create the actions now that we know if they must be absolutely or relatively scheduled 2607 // create the actions now that we know if they must be absolutely or relatively scheduled
2611 foreach (WixActionRow actionRow in actionRows) 2608 foreach (var actionRow in actionRows)
2612 { 2609 {
2610 var key = actionRow.GetPrimaryKey();
2611
2613 if (needAbsoluteScheduling) 2612 if (needAbsoluteScheduling)
2614 { 2613 {
2615 // remove any before/after information to ensure this is absolutely sequenced 2614 // remove any before/after information to ensure this is absolutely sequenced
2616 actionRow.Before = null; 2615 actionRow.Before = null;
2617 actionRow.After = null; 2616 actionRow.After = null;
2618 } 2617 }
2619 else if (nonSequencedActionRows.Contains(actionRow.SequenceTable, actionRow.Action)) 2618 else if (nonSequencedActionRows.ContainsKey(key))
2620 { 2619 {
2621 // clear the sequence attribute to ensure this action is scheduled without a sequence number (or before/after) 2620 // clear the sequence attribute to ensure this action is scheduled without a sequence number (or before/after)
2622 actionRow.Sequence = 0; 2621 actionRow.Sequence = 0;
2623 } 2622 }
2624 else if (suppressedRelativeActionRows.Contains(actionRow.SequenceTable, actionRow.Action)) 2623 else if (suppressedRelativeActionRows.ContainsKey(key))
2625 { 2624 {
2626 // skip the suppressed relatively scheduled action rows 2625 // skip the suppressed relatively scheduled action rows
2627 continue; 2626 continue;