diff options
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs')
-rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs index e4e66559..ee7cc61b 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs | |||
@@ -13,6 +13,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
13 | using WixToolset.Msi; | 13 | using WixToolset.Msi; |
14 | using WixToolset.Core.Native; | 14 | using WixToolset.Core.Native; |
15 | using WixToolset.Data.WindowsInstaller; | 15 | using WixToolset.Data.WindowsInstaller; |
16 | using WixToolset.Extensibility.Services; | ||
16 | 17 | ||
17 | internal class GenerateDatabaseCommand | 18 | internal class GenerateDatabaseCommand |
18 | { | 19 | { |
@@ -25,6 +26,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
25 | /// </summary> | 26 | /// </summary> |
26 | public bool KeepAddedColumns { private get; set; } | 27 | public bool KeepAddedColumns { private get; set; } |
27 | 28 | ||
29 | public IMessaging Messaging { private get; set; } | ||
30 | |||
28 | public Output Output { private get; set; } | 31 | public Output Output { private get; set; } |
29 | 32 | ||
30 | public string OutputPath { private get; set; } | 33 | public string OutputPath { private get; set; } |
@@ -177,7 +180,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
177 | try | 180 | try |
178 | { | 181 | { |
179 | //db.ImportTable(this.Output.Codepage, importTable, baseDirectory, this.KeepAddedColumns); | 182 | //db.ImportTable(this.Output.Codepage, importTable, baseDirectory, this.KeepAddedColumns); |
180 | var command = new CreateIdtFileCommand(importTable, this.Output.Codepage, baseDirectory, this.KeepAddedColumns); | 183 | var command = new CreateIdtFileCommand(this.Messaging, importTable, this.Output.Codepage, baseDirectory, this.KeepAddedColumns); |
181 | command.Execute(); | 184 | command.Execute(); |
182 | 185 | ||
183 | db.Import(command.IdtPath); | 186 | db.Import(command.IdtPath); |
@@ -262,11 +265,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
262 | { | 265 | { |
263 | if (0xA1 == e.NativeErrorCode) // ERROR_BAD_PATHNAME | 266 | if (0xA1 == e.NativeErrorCode) // ERROR_BAD_PATHNAME |
264 | { | 267 | { |
265 | throw new WixException(WixErrors.FileNotFound(row.SourceLineNumbers, (string)row[i])); | 268 | throw new WixException(ErrorMessages.FileNotFound(row.SourceLineNumbers, (string)row[i])); |
266 | } | 269 | } |
267 | else | 270 | else |
268 | { | 271 | { |
269 | throw new WixException(WixErrors.Win32Exception(e.NativeErrorCode, e.Message)); | 272 | throw new WixException(ErrorMessages.Win32Exception(e.NativeErrorCode, e.Message)); |
270 | } | 273 | } |
271 | } | 274 | } |
272 | } | 275 | } |
@@ -279,7 +282,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
279 | // check for a stream name that is more than 62 characters long (the maximum allowed length) | 282 | // check for a stream name that is more than 62 characters long (the maximum allowed length) |
280 | if (needStream && MsiInterop.MsiMaxStreamNameLength < streamName.Length) | 283 | if (needStream && MsiInterop.MsiMaxStreamNameLength < streamName.Length) |
281 | { | 284 | { |
282 | Messaging.Instance.OnMessage(WixErrors.StreamNameTooLong(row.SourceLineNumbers, table.Name, streamName.ToString(), streamName.Length)); | 285 | this.Messaging.Write(ErrorMessages.StreamNameTooLong(row.SourceLineNumbers, table.Name, streamName.ToString(), streamName.Length)); |
283 | } | 286 | } |
284 | else // add the row to the database | 287 | else // add the row to the database |
285 | { | 288 | { |
@@ -309,7 +312,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
309 | // Bind the transform. | 312 | // Bind the transform. |
310 | this.BindTransform(subStorage.Data, transformFile); | 313 | this.BindTransform(subStorage.Data, transformFile); |
311 | 314 | ||
312 | if (Messaging.Instance.EncounteredError) | 315 | if (this.Messaging.EncounteredError) |
313 | { | 316 | { |
314 | continue; | 317 | continue; |
315 | } | 318 | } |
@@ -338,7 +341,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
338 | 341 | ||
339 | private void BindTransform(Output transform, string outputPath) | 342 | private void BindTransform(Output transform, string outputPath) |
340 | { | 343 | { |
341 | BindTransformCommand command = new BindTransformCommand(); | 344 | var command = new BindTransformCommand(); |
345 | command.Messaging = this.Messaging; | ||
342 | command.Extensions = this.Extensions; | 346 | command.Extensions = this.Extensions; |
343 | command.TempFilesLocation = this.TempFilesLocation; | 347 | command.TempFilesLocation = this.TempFilesLocation; |
344 | command.Transform = transform; | 348 | command.Transform = transform; |
@@ -372,7 +376,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
372 | catch (WixInvalidIdtException) | 376 | catch (WixInvalidIdtException) |
373 | { | 377 | { |
374 | // the IDT should be valid, so an invalid code page was given | 378 | // the IDT should be valid, so an invalid code page was given |
375 | throw new WixException(WixErrors.IllegalCodepage(codepage)); | 379 | throw new WixException(ErrorMessages.IllegalCodepage(codepage)); |
376 | } | 380 | } |
377 | } | 381 | } |
378 | } | 382 | } |