diff options
author | Rob Mensching <rob@firegiant.com> | 2020-06-15 15:42:49 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2020-06-16 12:15:13 -0700 |
commit | 3c4ccd506d6c7d62e64c633d03a5bace2ebcbcd1 (patch) | |
tree | 6eebf222f1ae20114f6284bf6d6cd9665fbb9501 /src | |
parent | 7e6a03798ec0e2a67c203dda0ae1d0df667db076 (diff) | |
download | wix-3c4ccd506d6c7d62e64c633d03a5bace2ebcbcd1.tar.gz wix-3c4ccd506d6c7d62e64c633d03a5bace2ebcbcd1.tar.bz2 wix-3c4ccd506d6c7d62e64c633d03a5bace2ebcbcd1.zip |
Ensure unreal columns are not added to _Validation table
Diffstat (limited to 'src')
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs index 6edbdd1c..c8fa0370 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs | |||
@@ -6,6 +6,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using System.ComponentModel; | 7 | using System.ComponentModel; |
8 | using System.IO; | 8 | using System.IO; |
9 | using System.Linq; | ||
9 | using System.Text; | 10 | using System.Text; |
10 | using WixToolset.Core.WindowsInstaller.Msi; | 11 | using WixToolset.Core.WindowsInstaller.Msi; |
11 | using WixToolset.Data; | 12 | using WixToolset.Data; |
@@ -131,54 +132,51 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
131 | { | 132 | { |
132 | var validationTable = this.Data.EnsureTable(this.TableDefinitions["_Validation"]); | 133 | var validationTable = this.Data.EnsureTable(this.TableDefinitions["_Validation"]); |
133 | 134 | ||
134 | foreach (var table in this.Data.Tables) | 135 | // Add the validation rows for real tables and columns. |
136 | foreach (var table in this.Data.Tables.Where(t => !t.Definition.Unreal)) | ||
135 | { | 137 | { |
136 | if (!table.Definition.Unreal) | 138 | foreach (var columnDef in table.Definition.Columns.Where(c => !c.Unreal)) |
137 | { | 139 | { |
138 | // Add the validation rows for this table. | 140 | var row = validationTable.CreateRow(null); |
139 | foreach (var columnDef in table.Definition.Columns) | ||
140 | { | ||
141 | var row = validationTable.CreateRow(null); | ||
142 | 141 | ||
143 | row[0] = table.Name; | 142 | row[0] = table.Name; |
144 | 143 | ||
145 | row[1] = columnDef.Name; | 144 | row[1] = columnDef.Name; |
146 | 145 | ||
147 | if (columnDef.Nullable) | 146 | if (columnDef.Nullable) |
148 | { | 147 | { |
149 | row[2] = "Y"; | 148 | row[2] = "Y"; |
150 | } | 149 | } |
151 | else | 150 | else |
152 | { | 151 | { |
153 | row[2] = "N"; | 152 | row[2] = "N"; |
154 | } | 153 | } |
155 | 154 | ||
156 | if (columnDef.MinValue.HasValue) | 155 | if (columnDef.MinValue.HasValue) |
157 | { | 156 | { |
158 | row[3] = columnDef.MinValue.Value; | 157 | row[3] = columnDef.MinValue.Value; |
159 | } | 158 | } |
160 | 159 | ||
161 | if (columnDef.MaxValue.HasValue) | 160 | if (columnDef.MaxValue.HasValue) |
162 | { | 161 | { |
163 | row[4] = columnDef.MaxValue.Value; | 162 | row[4] = columnDef.MaxValue.Value; |
164 | } | 163 | } |
165 | 164 | ||
166 | row[5] = columnDef.KeyTable; | 165 | row[5] = columnDef.KeyTable; |
167 | 166 | ||
168 | if (columnDef.KeyColumn.HasValue) | 167 | if (columnDef.KeyColumn.HasValue) |
169 | { | 168 | { |
170 | row[6] = columnDef.KeyColumn.Value; | 169 | row[6] = columnDef.KeyColumn.Value; |
171 | } | 170 | } |
172 | 171 | ||
173 | if (ColumnCategory.Unknown != columnDef.Category) | 172 | if (ColumnCategory.Unknown != columnDef.Category) |
174 | { | 173 | { |
175 | row[7] = columnDef.Category.ToString(); | 174 | row[7] = columnDef.Category.ToString(); |
176 | } | 175 | } |
177 | 176 | ||
178 | row[8] = columnDef.Possibilities; | 177 | row[8] = columnDef.Possibilities; |
179 | 178 | ||
180 | row[9] = columnDef.Description; | 179 | row[9] = columnDef.Description; |
181 | } | ||
182 | } | 180 | } |
183 | } | 181 | } |
184 | } | 182 | } |