diff options
Diffstat (limited to 'src/wixext/UtilCompiler.cs')
-rw-r--r-- | src/wixext/UtilCompiler.cs | 104 |
1 files changed, 33 insertions, 71 deletions
diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs index cc51733a..19f4af06 100644 --- a/src/wixext/UtilCompiler.cs +++ b/src/wixext/UtilCompiler.cs | |||
@@ -34,55 +34,12 @@ namespace WixToolset.Util | |||
34 | internal const int UserDontCreateUser = 0x00000200; | 34 | internal const int UserDontCreateUser = 0x00000200; |
35 | internal const int UserNonVital = 0x00000400; | 35 | internal const int UserNonVital = 0x00000400; |
36 | 36 | ||
37 | [Flags] | ||
38 | internal enum WixFileSearchAttributes | ||
39 | { | ||
40 | Default = 0x001, | ||
41 | MinVersionInclusive = 0x002, | ||
42 | MaxVersionInclusive = 0x004, | ||
43 | MinSizeInclusive = 0x008, | ||
44 | MaxSizeInclusive = 0x010, | ||
45 | MinDateInclusive = 0x020, | ||
46 | MaxDateInclusive = 0x040, | ||
47 | WantVersion = 0x080, | ||
48 | WantExists = 0x100, | ||
49 | IsDirectory = 0x200, | ||
50 | } | ||
51 | |||
52 | internal enum WixRegistrySearchFormat | 37 | internal enum WixRegistrySearchFormat |
53 | { | 38 | { |
54 | Raw, | 39 | Raw, |
55 | Compatible, | 40 | Compatible, |
56 | } | 41 | } |
57 | 42 | ||
58 | [Flags] | ||
59 | internal enum WixRegistrySearchAttributes | ||
60 | { | ||
61 | Raw = 0x01, | ||
62 | Compatible = 0x02, | ||
63 | ExpandEnvironmentVariables = 0x04, | ||
64 | WantValue = 0x08, | ||
65 | WantExists = 0x10, | ||
66 | Win64 = 0x20, | ||
67 | } | ||
68 | |||
69 | internal enum WixComponentSearchAttributes | ||
70 | { | ||
71 | KeyPath = 0x1, | ||
72 | State = 0x2, | ||
73 | WantDirectory = 0x4, | ||
74 | } | ||
75 | |||
76 | [Flags] | ||
77 | internal enum WixProductSearchAttributes | ||
78 | { | ||
79 | Version = 0x01, | ||
80 | Language = 0x02, | ||
81 | State = 0x04, | ||
82 | Assignment = 0x08, | ||
83 | UpgradeCode = 0x10, | ||
84 | } | ||
85 | |||
86 | internal enum WixRestartResourceAttributes | 43 | internal enum WixRestartResourceAttributes |
87 | { | 44 | { |
88 | Filename = 1, | 45 | Filename = 1, |
@@ -505,10 +462,12 @@ namespace WixToolset.Util | |||
505 | break; | 462 | break; |
506 | } | 463 | } |
507 | 464 | ||
508 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixComponentSearch", id); | 465 | section.Tuples.Add(new WixComponentSearchTuple(sourceLineNumbers, id) |
509 | row.Set(1, guid); | 466 | { |
510 | row.Set(2, productCode); | 467 | Guid = guid, |
511 | row.Set(3, (int)attributes); | 468 | ProductCode = productCode, |
469 | Attributes = attributes, | ||
470 | }); | ||
512 | } | 471 | } |
513 | } | 472 | } |
514 | 473 | ||
@@ -1087,16 +1046,11 @@ namespace WixToolset.Util | |||
1087 | /// <param name="attributes"></param> | 1046 | /// <param name="attributes"></param> |
1088 | private void CreateWixFileSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string path, WixFileSearchAttributes attributes) | 1047 | private void CreateWixFileSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string path, WixFileSearchAttributes attributes) |
1089 | { | 1048 | { |
1090 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixFileSearch", id); | 1049 | section.Tuples.Add(new WixFileSearchTuple(sourceLineNumbers, id) |
1091 | row.Set(1, path); | 1050 | { |
1092 | //row.Set(2, minVersion; | 1051 | Path = path, |
1093 | //row.Set(3, maxVersion; | 1052 | Attributes = attributes, |
1094 | //row.Set(4, minSize; | 1053 | }); |
1095 | //row.Set(5, maxSize; | ||
1096 | //row.Set(6, minDate; | ||
1097 | //row.Set(7, maxDate; | ||
1098 | //row.Set(8, languages; | ||
1099 | row.Set(9, (int)attributes); | ||
1100 | } | 1054 | } |
1101 | 1055 | ||
1102 | /// <summary> | 1056 | /// <summary> |
@@ -1108,9 +1062,11 @@ namespace WixToolset.Util | |||
1108 | /// <param name="condition">A condition to test before evaluating the search.</param> | 1062 | /// <param name="condition">A condition to test before evaluating the search.</param> |
1109 | private void CreateWixSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string variable, string condition) | 1063 | private void CreateWixSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string variable, string condition) |
1110 | { | 1064 | { |
1111 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixSearch", id); | 1065 | section.Tuples.Add(new WixSearchTuple(sourceLineNumbers, id) |
1112 | row.Set(1, variable); | 1066 | { |
1113 | row.Set(2, condition); | 1067 | Variable = variable, |
1068 | Condition = condition, | ||
1069 | }); | ||
1114 | } | 1070 | } |
1115 | 1071 | ||
1116 | /// <summary> | 1072 | /// <summary> |
@@ -1122,9 +1078,11 @@ namespace WixToolset.Util | |||
1122 | /// <param name="attributes">Further details about the relation between id and parentId.</param> | 1078 | /// <param name="attributes">Further details about the relation between id and parentId.</param> |
1123 | private void CreateWixSearchRelationRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, int attributes) | 1079 | private void CreateWixSearchRelationRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, int attributes) |
1124 | { | 1080 | { |
1125 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixSearchRelation", id); | 1081 | section.Tuples.Add(new WixSearchRelationTuple(sourceLineNumbers, id) |
1126 | row.Set(1, parentId); | 1082 | { |
1127 | row.Set(2, attributes); | 1083 | ParentSearchRef = parentId, |
1084 | Attributes = attributes, | ||
1085 | }); | ||
1128 | } | 1086 | } |
1129 | 1087 | ||
1130 | /// <summary> | 1088 | /// <summary> |
@@ -2680,9 +2638,11 @@ namespace WixToolset.Util | |||
2680 | attributes |= WixProductSearchAttributes.UpgradeCode; | 2638 | attributes |= WixProductSearchAttributes.UpgradeCode; |
2681 | } | 2639 | } |
2682 | 2640 | ||
2683 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixProductSearch", id); | 2641 | section.Tuples.Add(new WixProductSearchTuple(sourceLineNumbers, id) |
2684 | row.Set(1, productCode ?? upgradeCode); | 2642 | { |
2685 | row.Set(2, (int)attributes); | 2643 | Guid = productCode ?? upgradeCode, |
2644 | Attributes = attributes, | ||
2645 | }); | ||
2686 | } | 2646 | } |
2687 | } | 2647 | } |
2688 | 2648 | ||
@@ -2836,11 +2796,13 @@ namespace WixToolset.Util | |||
2836 | this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2); | 2796 | this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2); |
2837 | } | 2797 | } |
2838 | 2798 | ||
2839 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixRegistrySearch", id); | 2799 | section.Tuples.Add(new WixRegistrySearchTuple(sourceLineNumbers, id) |
2840 | row.Set(1, (int)root); | 2800 | { |
2841 | row.Set(2, key); | 2801 | Root = (RegistryRootType)root, |
2842 | row.Set(3, value); | 2802 | Key = key, |
2843 | row.Set(4, (int)attributes); | 2803 | Value = value, |
2804 | Attributes = attributes, | ||
2805 | }); | ||
2844 | } | 2806 | } |
2845 | } | 2807 | } |
2846 | 2808 | ||