aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/WixFileTuple.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-11-01 10:56:09 -0700
committerRob Mensching <rob@firegiant.com>2017-11-01 10:56:09 -0700
commit69b15d96cebdbb7201b1849b4f62786633d70b8d (patch)
tree4b65de8679e4b4ab81b69edcccbac1ae9f55a16d /src/WixToolset.Data/Tuples/WixFileTuple.cs
parenta8656a87887d6cb2c54f4bbeacee37f7074f1032 (diff)
downloadwix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.gz
wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.bz2
wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.zip
Introduce WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Data/Tuples/WixFileTuple.cs')
-rw-r--r--src/WixToolset.Data/Tuples/WixFileTuple.cs170
1 files changed, 170 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/WixFileTuple.cs b/src/WixToolset.Data/Tuples/WixFileTuple.cs
new file mode 100644
index 00000000..5ffc5d7f
--- /dev/null
+++ b/src/WixToolset.Data/Tuples/WixFileTuple.cs
@@ -0,0 +1,170 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Data
4{
5 using WixToolset.Data.Tuples;
6
7 public static partial class TupleDefinitions
8 {
9 public static readonly IntermediateTupleDefinition WixFile = new IntermediateTupleDefinition(
10 TupleDefinitionType.WixFile,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(WixFileTupleFields.File_), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(WixFileTupleFields.AssemblyType), IntermediateFieldType.Number),
15 new IntermediateFieldDefinition(nameof(WixFileTupleFields.File_AssemblyManifest), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixFileTupleFields.File_AssemblyApplication), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(WixFileTupleFields.Directory_), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(WixFileTupleFields.DiskId), IntermediateFieldType.Number),
19 new IntermediateFieldDefinition(nameof(WixFileTupleFields.Source), IntermediateFieldType.Path),
20 new IntermediateFieldDefinition(nameof(WixFileTupleFields.ProcessorArchitecture), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(WixFileTupleFields.PatchGroup), IntermediateFieldType.Number),
22 new IntermediateFieldDefinition(nameof(WixFileTupleFields.Attributes), IntermediateFieldType.Number),
23 new IntermediateFieldDefinition(nameof(WixFileTupleFields.PatchAttributes), IntermediateFieldType.Number),
24 new IntermediateFieldDefinition(nameof(WixFileTupleFields.DeltaPatchHeaderSource), IntermediateFieldType.String),
25 },
26 typeof(WixFileTuple));
27 }
28}
29
30namespace WixToolset.Data.Tuples
31{
32 using System;
33
34 public enum WixFileTupleFields
35 {
36 File_,
37 AssemblyType,
38 File_AssemblyManifest,
39 File_AssemblyApplication,
40 Directory_,
41 DiskId,
42 Source,
43 ProcessorArchitecture,
44 PatchGroup,
45 Attributes,
46 PatchAttributes,
47 DeltaPatchHeaderSource,
48 }
49
50 /// <summary>
51 /// Every file row has an assembly type.
52 /// </summary>
53 public enum FileAssemblyType
54 {
55 /// <summary>File is not an assembly.</summary>
56 NotAnAssembly,
57
58 /// <summary>File is a Common Language Runtime Assembly.</summary>
59 DotNetAssembly,
60
61 /// <summary>File is Win32 SxS assembly.</summary>
62 Win32Assembly,
63 }
64
65 /// <summary>
66 /// PatchAttribute values
67 /// </summary>
68 [Flags]
69 public enum PatchAttributeType
70 {
71 None = 0,
72
73 /// <summary>Prevents the updating of the file that is in fact changed in the upgraded image relative to the target images.</summary>
74 Ignore = 1,
75
76 /// <summary>Set if the entire file should be installed rather than creating a binary patch.</summary>
77 IncludeWholeFile = 2,
78
79 /// <summary>Set to indicate that the patch is non-vital.</summary>
80 AllowIgnoreOnError = 4,
81
82 /// <summary>Allowed bits.</summary>
83 Defined = Ignore | IncludeWholeFile | AllowIgnoreOnError
84 }
85
86 public class WixFileTuple : IntermediateTuple
87 {
88 public WixFileTuple() : base(TupleDefinitions.WixFile, null, null)
89 {
90 }
91
92 public WixFileTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixFile, sourceLineNumber, id)
93 {
94 }
95
96 public IntermediateField this[WixFileTupleFields index] => this.Fields[(int)index];
97
98 public string File_
99 {
100 get => (string)this.Fields[(int)WixFileTupleFields.File_]?.Value;
101 set => this.Set((int)WixFileTupleFields.File_, value);
102 }
103
104 public FileAssemblyType AssemblyType
105 {
106 get => (FileAssemblyType)(int)this.Fields[(int)WixFileTupleFields.AssemblyType]?.Value;
107 set => this.Set((int)WixFileTupleFields.AssemblyType, (int)value);
108 }
109
110 public string File_AssemblyManifest
111 {
112 get => (string)this.Fields[(int)WixFileTupleFields.File_AssemblyManifest]?.Value;
113 set => this.Set((int)WixFileTupleFields.File_AssemblyManifest, value);
114 }
115
116 public string File_AssemblyApplication
117 {
118 get => (string)this.Fields[(int)WixFileTupleFields.File_AssemblyApplication]?.Value;
119 set => this.Set((int)WixFileTupleFields.File_AssemblyApplication, value);
120 }
121
122 public string Directory_
123 {
124 get => (string)this.Fields[(int)WixFileTupleFields.Directory_]?.Value;
125 set => this.Set((int)WixFileTupleFields.Directory_, value);
126 }
127
128 public int DiskId
129 {
130 get => (int)this.Fields[(int)WixFileTupleFields.DiskId]?.Value;
131 set => this.Set((int)WixFileTupleFields.DiskId, value);
132 }
133
134 public string Source
135 {
136 get => (string)this.Fields[(int)WixFileTupleFields.Source]?.Value;
137 set => this.Set((int)WixFileTupleFields.Source, value);
138 }
139
140 public string ProcessorArchitecture
141 {
142 get => (string)this.Fields[(int)WixFileTupleFields.ProcessorArchitecture]?.Value;
143 set => this.Set((int)WixFileTupleFields.ProcessorArchitecture, value);
144 }
145
146 public int PatchGroup
147 {
148 get => (int)this.Fields[(int)WixFileTupleFields.PatchGroup]?.Value;
149 set => this.Set((int)WixFileTupleFields.PatchGroup, value);
150 }
151
152 public int Attributes
153 {
154 get => (int)this.Fields[(int)WixFileTupleFields.Attributes]?.Value;
155 set => this.Set((int)WixFileTupleFields.Attributes, value);
156 }
157
158 public PatchAttributeType PatchAttributes
159 {
160 get => (PatchAttributeType)(int)this.Fields[(int)WixFileTupleFields.PatchAttributes]?.Value;
161 set => this.Set((int)WixFileTupleFields.PatchAttributes, (int)value);
162 }
163
164 public string DeltaPatchHeaderSource
165 {
166 get => (string)this.Fields[(int)WixFileTupleFields.DeltaPatchHeaderSource]?.Value;
167 set => this.Set((int)WixFileTupleFields.DeltaPatchHeaderSource, value);
168 }
169 }
170} \ No newline at end of file