aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/FileTuple.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/Tuples/FileTuple.cs')
-rw-r--r--src/WixToolset.Data/Tuples/FileTuple.cs173
1 files changed, 137 insertions, 36 deletions
diff --git a/src/WixToolset.Data/Tuples/FileTuple.cs b/src/WixToolset.Data/Tuples/FileTuple.cs
index 43de8b46..caae7b34 100644
--- a/src/WixToolset.Data/Tuples/FileTuple.cs
+++ b/src/WixToolset.Data/Tuples/FileTuple.cs
@@ -16,15 +16,26 @@ namespace WixToolset.Data
16 new IntermediateFieldDefinition(nameof(FileTupleFields.FileSize), IntermediateFieldType.Number), 16 new IntermediateFieldDefinition(nameof(FileTupleFields.FileSize), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(FileTupleFields.Version), IntermediateFieldType.String), 17 new IntermediateFieldDefinition(nameof(FileTupleFields.Version), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(FileTupleFields.Language), IntermediateFieldType.String), 18 new IntermediateFieldDefinition(nameof(FileTupleFields.Language), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(FileTupleFields.ReadOnly), IntermediateFieldType.Bool), 19 new IntermediateFieldDefinition(nameof(FileTupleFields.Attributes), IntermediateFieldType.Number),
20 new IntermediateFieldDefinition(nameof(FileTupleFields.Hidden), IntermediateFieldType.Bool), 20 new IntermediateFieldDefinition(nameof(FileTupleFields.DirectoryRef), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(FileTupleFields.System), IntermediateFieldType.Bool), 21 new IntermediateFieldDefinition(nameof(FileTupleFields.DiskId), IntermediateFieldType.Number),
22 new IntermediateFieldDefinition(nameof(FileTupleFields.Vital), IntermediateFieldType.Bool), 22 new IntermediateFieldDefinition(nameof(FileTupleFields.Source), IntermediateFieldType.Path),
23 new IntermediateFieldDefinition(nameof(FileTupleFields.Checksum), IntermediateFieldType.Bool), 23
24 new IntermediateFieldDefinition(nameof(FileTupleFields.Compressed), IntermediateFieldType.Bool),
25 new IntermediateFieldDefinition(nameof(FileTupleFields.FontTitle), IntermediateFieldType.String), 24 new IntermediateFieldDefinition(nameof(FileTupleFields.FontTitle), IntermediateFieldType.String),
26 new IntermediateFieldDefinition(nameof(FileTupleFields.SelfRegCost), IntermediateFieldType.Number), 25 new IntermediateFieldDefinition(nameof(FileTupleFields.SelfRegCost), IntermediateFieldType.Number),
27 new IntermediateFieldDefinition(nameof(FileTupleFields.BindPath), IntermediateFieldType.String), 26 new IntermediateFieldDefinition(nameof(FileTupleFields.BindPath), IntermediateFieldType.String),
27
28 new IntermediateFieldDefinition(nameof(FileTupleFields.Sequence), IntermediateFieldType.Number),
29
30 new IntermediateFieldDefinition(nameof(FileTupleFields.PatchGroup), IntermediateFieldType.Number),
31 new IntermediateFieldDefinition(nameof(FileTupleFields.PatchAttributes), IntermediateFieldType.Number),
32 new IntermediateFieldDefinition(nameof(FileTupleFields.DeltaPatchHeaderSource), IntermediateFieldType.String),
33
34 new IntermediateFieldDefinition(nameof(FileTupleFields.RetainLengths), IntermediateFieldType.String),
35 new IntermediateFieldDefinition(nameof(FileTupleFields.IgnoreOffsets), IntermediateFieldType.String),
36 new IntermediateFieldDefinition(nameof(FileTupleFields.IgnoreLengths), IntermediateFieldType.String),
37 new IntermediateFieldDefinition(nameof(FileTupleFields.RetainOffsets), IntermediateFieldType.String),
38 new IntermediateFieldDefinition(nameof(FileTupleFields.SymbolPaths), IntermediateFieldType.String),
28 }, 39 },
29 typeof(FileTuple)); 40 typeof(FileTuple));
30 } 41 }
@@ -32,6 +43,8 @@ namespace WixToolset.Data
32 43
33namespace WixToolset.Data.Tuples 44namespace WixToolset.Data.Tuples
34{ 45{
46 using System;
47
35 public enum FileTupleFields 48 public enum FileTupleFields
36 { 49 {
37 ComponentRef, 50 ComponentRef,
@@ -40,15 +53,61 @@ namespace WixToolset.Data.Tuples
40 FileSize, 53 FileSize,
41 Version, 54 Version,
42 Language, 55 Language,
43 ReadOnly, 56 Attributes,
44 Hidden, 57 DirectoryRef,
45 System, 58 DiskId,
46 Vital, 59 Source,
47 Checksum, 60
48 Compressed,
49 FontTitle, 61 FontTitle,
50 SelfRegCost, 62 SelfRegCost,
51 BindPath, 63 BindPath,
64
65 Sequence,
66
67 PatchGroup,
68 PatchAttributes,
69 DeltaPatchHeaderSource,
70
71 RetainLengths,
72 IgnoreOffsets,
73 IgnoreLengths,
74 RetainOffsets,
75 SymbolPaths,
76 }
77
78 [Flags]
79 public enum FileTupleAttributes : int
80 {
81 None,
82 ReadOnly = 0x1,
83 Hidden = 0x2,
84 System = 0x4,
85 Vital = 0x8,
86 Compressed = 0x10,
87 Uncompressed = 0x20,
88 Checksum = 0x40,
89 GeneratedShortFileName = 0x80,
90 }
91
92 /// <summary>
93 /// PatchAttribute values
94 /// </summary>
95 [Flags]
96 public enum PatchAttributeType
97 {
98 None = 0,
99
100 /// <summary>Prevents the updating of the file that is in fact changed in the upgraded image relative to the target images.</summary>
101 Ignore = 1,
102
103 /// <summary>Set if the entire file should be installed rather than creating a binary patch.</summary>
104 IncludeWholeFile = 2,
105
106 /// <summary>Set to indicate that the patch is non-vital.</summary>
107 AllowIgnoreOnError = 4,
108
109 /// <summary>Allowed bits.</summary>
110 Defined = Ignore | IncludeWholeFile | AllowIgnoreOnError
52 } 111 }
53 112
54 public class FileTuple : IntermediateTuple 113 public class FileTuple : IntermediateTuple
@@ -99,40 +158,28 @@ namespace WixToolset.Data.Tuples
99 set => this.Set((int)FileTupleFields.Language, value); 158 set => this.Set((int)FileTupleFields.Language, value);
100 } 159 }
101 160
102 public bool ReadOnly 161 public FileTupleAttributes Attributes
103 { 162 {
104 get => (bool)this.Fields[(int)FileTupleFields.ReadOnly]; 163 get => (FileTupleAttributes)this.Fields[(int)FileTupleFields.Attributes].AsNumber();
105 set => this.Set((int)FileTupleFields.ReadOnly, value); 164 set => this.Set((int)FileTupleFields.Attributes, (int)value);
106 } 165 }
107 166
108 public bool Hidden 167 public string DirectoryRef
109 { 168 {
110 get => (bool)this.Fields[(int)FileTupleFields.Hidden]; 169 get => (string)this.Fields[(int)FileTupleFields.DirectoryRef];
111 set => this.Set((int)FileTupleFields.Hidden, value); 170 set => this.Set((int)FileTupleFields.DirectoryRef, value);
112 } 171 }
113 172
114 public bool System 173 public int? DiskId
115 { 174 {
116 get => (bool)this.Fields[(int)FileTupleFields.System]; 175 get => (int?)this.Fields[(int)FileTupleFields.DiskId];
117 set => this.Set((int)FileTupleFields.System, value); 176 set => this.Set((int)FileTupleFields.DiskId, value);
118 } 177 }
119 178
120 public bool Vital 179 public IntermediateFieldPathValue Source
121 { 180 {
122 get => (bool)this.Fields[(int)FileTupleFields.Vital]; 181 get => this.Fields[(int)FileTupleFields.Source].AsPath();
123 set => this.Set((int)FileTupleFields.Vital, value); 182 set => this.Set((int)FileTupleFields.Source, value);
124 }
125
126 public bool Checksum
127 {
128 get => (bool)this.Fields[(int)FileTupleFields.Checksum];
129 set => this.Set((int)FileTupleFields.Checksum, value);
130 }
131
132 public bool? Compressed
133 {
134 get => (bool?)this.Fields[(int)FileTupleFields.Compressed];
135 set => this.Set((int)FileTupleFields.Compressed, value);
136 } 183 }
137 184
138 public string FontTitle 185 public string FontTitle
@@ -152,5 +199,59 @@ namespace WixToolset.Data.Tuples
152 get => (string)this.Fields[(int)FileTupleFields.BindPath]; 199 get => (string)this.Fields[(int)FileTupleFields.BindPath];
153 set => this.Set((int)FileTupleFields.BindPath, value); 200 set => this.Set((int)FileTupleFields.BindPath, value);
154 } 201 }
202
203 public int Sequence
204 {
205 get => (int)this.Fields[(int)FileTupleFields.Sequence];
206 set => this.Set((int)FileTupleFields.Sequence, value);
207 }
208
209 public int? PatchGroup
210 {
211 get => (int?)this.Fields[(int)FileTupleFields.PatchGroup];
212 set => this.Set((int)FileTupleFields.PatchGroup, value);
213 }
214
215 public PatchAttributeType? PatchAttributes
216 {
217 get => (PatchAttributeType?)this.Fields[(int)FileTupleFields.PatchAttributes].AsNullableNumber();
218 set => this.Set((int)FileTupleFields.PatchAttributes, (int?)value);
219 }
220
221 public string DeltaPatchHeaderSource
222 {
223 get => (string)this.Fields[(int)FileTupleFields.DeltaPatchHeaderSource];
224 set => this.Set((int)FileTupleFields.DeltaPatchHeaderSource, value);
225 }
226
227 public string RetainLengths
228 {
229 get => (string)this.Fields[(int)FileTupleFields.RetainLengths];
230 set => this.Set((int)FileTupleFields.RetainLengths, value);
231 }
232
233 public string IgnoreOffsets
234 {
235 get => (string)this.Fields[(int)FileTupleFields.IgnoreOffsets];
236 set => this.Set((int)FileTupleFields.IgnoreOffsets, value);
237 }
238
239 public string IgnoreLengths
240 {
241 get => (string)this.Fields[(int)FileTupleFields.IgnoreLengths];
242 set => this.Set((int)FileTupleFields.IgnoreLengths, value);
243 }
244
245 public string RetainOffsets
246 {
247 get => (string)this.Fields[(int)FileTupleFields.RetainOffsets];
248 set => this.Set((int)FileTupleFields.RetainOffsets, value);
249 }
250
251 public string SymbolPaths
252 {
253 get => (string)this.Fields[(int)FileTupleFields.SymbolPaths];
254 set => this.Set((int)FileTupleFields.SymbolPaths, value);
255 }
155 } 256 }
156} 257}