diff options
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs')
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs index a3d3ecf7..e4e66559 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs | |||
@@ -12,6 +12,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
12 | using WixToolset.Extensibility; | 12 | using WixToolset.Extensibility; |
13 | using WixToolset.Msi; | 13 | using WixToolset.Msi; |
14 | using WixToolset.Core.Native; | 14 | using WixToolset.Core.Native; |
15 | using WixToolset.Data.WindowsInstaller; | ||
15 | 16 | ||
16 | internal class GenerateDatabaseCommand | 17 | internal class GenerateDatabaseCommand |
17 | { | 18 | { |
@@ -44,14 +45,56 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
44 | // Add the _Validation rows. | 45 | // Add the _Validation rows. |
45 | if (!this.SuppressAddingValidationRows) | 46 | if (!this.SuppressAddingValidationRows) |
46 | { | 47 | { |
47 | Table validationTable = this.Output.EnsureTable(this.TableDefinitions["_Validation"]); | 48 | var validationTable = this.Output.EnsureTable(this.TableDefinitions["_Validation"]); |
48 | 49 | ||
49 | foreach (Table table in this.Output.Tables) | 50 | foreach (var table in this.Output.Tables) |
50 | { | 51 | { |
51 | if (!table.Definition.Unreal) | 52 | if (!table.Definition.Unreal) |
52 | { | 53 | { |
53 | // Add the validation rows for this table. | 54 | // Add the validation rows for this table. |
54 | table.Definition.AddValidationRows(validationTable); | 55 | foreach (ColumnDefinition columnDef in table.Definition.Columns) |
56 | { | ||
57 | var row = validationTable.CreateRow(null); | ||
58 | |||
59 | row[0] = table.Name; | ||
60 | |||
61 | row[1] = columnDef.Name; | ||
62 | |||
63 | if (columnDef.Nullable) | ||
64 | { | ||
65 | row[2] = "Y"; | ||
66 | } | ||
67 | else | ||
68 | { | ||
69 | row[2] = "N"; | ||
70 | } | ||
71 | |||
72 | if (columnDef.MinValue.HasValue) | ||
73 | { | ||
74 | row[3] = columnDef.MinValue.Value; | ||
75 | } | ||
76 | |||
77 | if (columnDef.MaxValue.HasValue) | ||
78 | { | ||
79 | row[4] = columnDef.MaxValue.Value; | ||
80 | } | ||
81 | |||
82 | row[5] = columnDef.KeyTable; | ||
83 | |||
84 | if (columnDef.KeyColumn.HasValue) | ||
85 | { | ||
86 | row[6] = columnDef.KeyColumn.Value; | ||
87 | } | ||
88 | |||
89 | if (ColumnCategory.Unknown != columnDef.Category) | ||
90 | { | ||
91 | row[7] = columnDef.Category.ToString(); | ||
92 | } | ||
93 | |||
94 | row[8] = columnDef.Possibilities; | ||
95 | |||
96 | row[9] = columnDef.Description; | ||
97 | } | ||
55 | } | 98 | } |
56 | } | 99 | } |
57 | } | 100 | } |
@@ -133,7 +176,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
133 | { | 176 | { |
134 | try | 177 | try |
135 | { | 178 | { |
136 | db.ImportTable(this.Output.Codepage, importTable, baseDirectory, this.KeepAddedColumns); | 179 | //db.ImportTable(this.Output.Codepage, importTable, baseDirectory, this.KeepAddedColumns); |
180 | var command = new CreateIdtFileCommand(importTable, this.Output.Codepage, baseDirectory, this.KeepAddedColumns); | ||
181 | command.Execute(); | ||
182 | |||
183 | db.Import(command.IdtPath); | ||
137 | } | 184 | } |
138 | catch (WixInvalidIdtException) | 185 | catch (WixInvalidIdtException) |
139 | { | 186 | { |