aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2020-04-11 19:35:05 -0400
committerBob Arnson <bob@firegiant.com>2020-04-11 19:38:13 -0400
commit85a5fecdef50f18af8c8a87d270b6d55a02165d2 (patch)
tree8db67580081840af02a5dd62e7233bd0c53c9824 /src
parent7c04bfdb54ccf5b4b67995c9715a3f7f9e454206 (diff)
downloadwix-85a5fecdef50f18af8c8a87d270b6d55a02165d2.tar.gz
wix-85a5fecdef50f18af8c8a87d270b6d55a02165d2.tar.bz2
wix-85a5fecdef50f18af8c8a87d270b6d55a02165d2.zip
Remove partial WixPdb support.
Not as useful as intended and I'd rather remove it than potentially have to support something as weird as this.
Diffstat (limited to 'src')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs451
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs44
2 files changed, 219 insertions, 276 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
index 2ced48ea..5d1e89ac 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
@@ -22,7 +22,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
22 // As outlined in RFC 4122, this is our namespace for generating name-based (version 3) UUIDs. 22 // As outlined in RFC 4122, this is our namespace for generating name-based (version 3) UUIDs.
23 internal static readonly Guid WixComponentGuidNamespace = new Guid("{3064E5C6-FB63-4FE9-AC49-E446A792EFA5}"); 23 internal static readonly Guid WixComponentGuidNamespace = new Guid("{3064E5C6-FB63-4FE9-AC49-E446A792EFA5}");
24 24
25 public BindDatabaseCommand(IBindContext context, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtension, Validator validator):this(context, backendExtension, null, validator) 25 public BindDatabaseCommand(IBindContext context, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtension, Validator validator) : this(context, backendExtension, null, validator)
26 { 26 {
27 } 27 }
28 28
@@ -225,167 +225,155 @@ namespace WixToolset.Core.WindowsInstaller.Bind
225 } 225 }
226 226
227 WindowsInstallerData output; 227 WindowsInstallerData output;
228 if (this.PdbType == PdbType.Partial) 228 this.Intermediate.UpdateLevel(Data.WindowsInstaller.IntermediateLevels.FullyBound);
229 this.Messaging.Write(VerboseMessages.UpdatingFileInformation());
230
231 // Extract files that come from binary .wixlibs and WixExtensions (this does not extract files from merge modules).
229 { 232 {
230 // Time to create the output object, since we're bypassing everything that touches files. 233 var command = new ExtractEmbeddedFilesCommand(this.ExpectedEmbeddedFiles);
231 this.Intermediate.UpdateLevel(Data.WindowsInstaller.IntermediateLevels.PartiallyBound); 234 command.Execute();
235 }
232 236
233 var command = new CreateOutputFromIRCommand(this.Messaging, section, tableDefinitions, this.BackendExtensions); 237 // This must occur after all variables and source paths have been resolved.
238 List<FileFacade> fileFacades;
239 {
240 var command = new GetFileFacadesCommand(section);
234 command.Execute(); 241 command.Execute();
235 242
236 output = command.Output; 243 fileFacades = command.FileFacades;
237 } 244 }
238 else 245
246 // Retrieve file information from merge modules.
247 if (SectionType.Product == section.Type)
239 { 248 {
240 this.Intermediate.UpdateLevel(Data.WindowsInstaller.IntermediateLevels.FullyBound); 249 var wixMergeTuples = section.Tuples.OfType<WixMergeTuple>().ToList();
241 this.Messaging.Write(VerboseMessages.UpdatingFileInformation());
242 250
243 // Extract files that come from binary .wixlibs and WixExtensions (this does not extract files from merge modules). 251 if (wixMergeTuples.Any())
244 { 252 {
245 var command = new ExtractEmbeddedFilesCommand(this.ExpectedEmbeddedFiles); 253 containsMergeModules = true;
246 command.Execute();
247 }
248 254
249 // This must occur after all variables and source paths have been resolved. 255 var command = new ExtractMergeModuleFilesCommand(this.Messaging, section, wixMergeTuples);
250 List<FileFacade> fileFacades; 256 command.FileFacades = fileFacades;
251 { 257 command.OutputInstallerVersion = installerVersion;
252 var command = new GetFileFacadesCommand(section); 258 command.SuppressLayout = this.SuppressLayout;
259 command.IntermediateFolder = this.IntermediateFolder;
253 command.Execute(); 260 command.Execute();
254 261
255 fileFacades = command.FileFacades; 262 fileFacades.AddRange(command.MergeModulesFileFacades);
256 } 263 }
264 }
265 else if (SectionType.Patch == section.Type)
266 {
267 // Merge transform data into the output object.
268 //IEnumerable<FileFacade> filesFromTransform = this.CopyFromTransformData(this.Output);
269
270 //var command = new CopyTransformDataCommand(this.Messaging, /*output*/this.SubStorages, tableDefinitions, copyOutFileRows: true);
271 //command.Output = output;
272 //command.TableDefinitions = this.TableDefinitions;
273 //command.CopyOutFileRows = true;
274 var command = new GetFileFacadesFromTransforms(this.Messaging, this.SubStorages, tableDefinitions);
275 command.Execute();
276 var filesFromTransforms = command.FileFacades;
257 277
258 // Retrieve file information from merge modules. 278 fileFacades.AddRange(filesFromTransforms);
259 if (SectionType.Product == section.Type) 279 }
260 {
261 var wixMergeTuples = section.Tuples.OfType<WixMergeTuple>().ToList();
262
263 if (wixMergeTuples.Any())
264 {
265 containsMergeModules = true;
266
267 var command = new ExtractMergeModuleFilesCommand(this.Messaging, section, wixMergeTuples);
268 command.FileFacades = fileFacades;
269 command.OutputInstallerVersion = installerVersion;
270 command.SuppressLayout = this.SuppressLayout;
271 command.IntermediateFolder = this.IntermediateFolder;
272 command.Execute();
273
274 fileFacades.AddRange(command.MergeModulesFileFacades);
275 }
276 }
277 else if (SectionType.Patch == section.Type)
278 {
279 // Merge transform data into the output object.
280 //IEnumerable<FileFacade> filesFromTransform = this.CopyFromTransformData(this.Output);
281
282 //var command = new CopyTransformDataCommand(this.Messaging, /*output*/this.SubStorages, tableDefinitions, copyOutFileRows: true);
283 //command.Output = output;
284 //command.TableDefinitions = this.TableDefinitions;
285 //command.CopyOutFileRows = true;
286 var command = new GetFileFacadesFromTransforms(this.Messaging, this.SubStorages, tableDefinitions);
287 command.Execute();
288 var filesFromTransforms = command.FileFacades;
289
290 fileFacades.AddRange(filesFromTransforms);
291 }
292 280
293 // stop processing if an error previously occurred 281 // stop processing if an error previously occurred
294 if (this.Messaging.EncounteredError) 282 if (this.Messaging.EncounteredError)
295 { 283 {
296 return null; 284 return null;
297 } 285 }
298 286
299 // Gather information about files that do not come from merge modules. 287 // Gather information about files that do not come from merge modules.
300 { 288 {
301 var command = new UpdateFileFacadesCommand(this.Messaging, section); 289 var command = new UpdateFileFacadesCommand(this.Messaging, section);
302 command.FileFacades = fileFacades; 290 command.FileFacades = fileFacades;
303 command.UpdateFileFacades = fileFacades.Where(f => !f.FromModule); 291 command.UpdateFileFacades = fileFacades.Where(f => !f.FromModule);
304 command.OverwriteHash = true; 292 command.OverwriteHash = true;
305 command.TableDefinitions = tableDefinitions; 293 command.TableDefinitions = tableDefinitions;
306 command.VariableCache = variableCache; 294 command.VariableCache = variableCache;
307 command.Execute(); 295 command.Execute();
308 } 296 }
309 297
310 // Assign files to media. 298 // Assign files to media.
311 Dictionary<int, MediaTuple> assignedMediaRows; 299 Dictionary<int, MediaTuple> assignedMediaRows;
312 Dictionary<MediaTuple, IEnumerable<FileFacade>> filesByCabinetMedia; 300 Dictionary<MediaTuple, IEnumerable<FileFacade>> filesByCabinetMedia;
313 IEnumerable<FileFacade> uncompressedFiles; 301 IEnumerable<FileFacade> uncompressedFiles;
314 { 302 {
315 var command = new AssignMediaCommand(section, this.Messaging); 303 var command = new AssignMediaCommand(section, this.Messaging);
316 command.FileFacades = fileFacades; 304 command.FileFacades = fileFacades;
317 command.FilesCompressed = compressed; 305 command.FilesCompressed = compressed;
318 command.Execute(); 306 command.Execute();
319 307
320 assignedMediaRows = command.MediaRows; 308 assignedMediaRows = command.MediaRows;
321 filesByCabinetMedia = command.FileFacadesByCabinetMedia; 309 filesByCabinetMedia = command.FileFacadesByCabinetMedia;
322 uncompressedFiles = command.UncompressedFileFacades; 310 uncompressedFiles = command.UncompressedFileFacades;
323 } 311 }
324 312
325 // stop processing if an error previously occurred 313 // stop processing if an error previously occurred
326 if (this.Messaging.EncounteredError) 314 if (this.Messaging.EncounteredError)
327 { 315 {
328 return null; 316 return null;
329 } 317 }
330 318
331 // Now that the variable cache is populated, resolve any delayed fields. 319 // Now that the variable cache is populated, resolve any delayed fields.
332 if (this.DelayedFields.Any()) 320 if (this.DelayedFields.Any())
333 { 321 {
334 var command = new ResolveDelayedFieldsCommand(this.Messaging, this.DelayedFields, variableCache); 322 var command = new ResolveDelayedFieldsCommand(this.Messaging, this.DelayedFields, variableCache);
335 command.Execute(); 323 command.Execute();
336 } 324 }
337 325
338 // Set generated component guids. 326 // Set generated component guids.
339 { 327 {
340 var command = new CalculateComponentGuids(this.Messaging, this.BackendHelper, this.PathResolver, section); 328 var command = new CalculateComponentGuids(this.Messaging, this.BackendHelper, this.PathResolver, section);
341 command.Execute(); 329 command.Execute();
342 } 330 }
343 331
344 // Add missing CreateFolder tuples to null-keypath components. 332 // Add missing CreateFolder tuples to null-keypath components.
345 { 333 {
346 var command = new AddCreateFoldersCommand(section); 334 var command = new AddCreateFoldersCommand(section);
347 command.Execute(); 335 command.Execute();
348 } 336 }
349 337
350 // stop processing if an error previously occurred 338 // stop processing if an error previously occurred
351 if (this.Messaging.EncounteredError) 339 if (this.Messaging.EncounteredError)
352 { 340 {
353 return null; 341 return null;
354 } 342 }
355 343
356 // Time to create the output object. Try to put as much above here as possible, updating the IR is better. 344 // Time to create the output object. Try to put as much above here as possible, updating the IR is better.
357 { 345 {
358 var command = new CreateOutputFromIRCommand(this.Messaging, section, tableDefinitions, this.BackendExtensions); 346 var command = new CreateOutputFromIRCommand(this.Messaging, section, tableDefinitions, this.BackendExtensions);
359 command.Execute(); 347 command.Execute();
360 348
361 output = command.Output; 349 output = command.Output;
362 } 350 }
363 351
364 // Update file sequence. 352 // Update file sequence.
365 { 353 {
366 var command = new UpdateMediaSequencesCommand(output, fileFacades); 354 var command = new UpdateMediaSequencesCommand(output, fileFacades);
367 command.Execute(); 355 command.Execute();
368 } 356 }
369 357
370 // Modularize identifiers. 358 // Modularize identifiers.
371 if (OutputType.Module == output.Type) 359 if (OutputType.Module == output.Type)
372 { 360 {
373 var command = new ModularizeCommand(output, modularizationGuid, section.Tuples.OfType<WixSuppressModularizationTuple>()); 361 var command = new ModularizeCommand(output, modularizationGuid, section.Tuples.OfType<WixSuppressModularizationTuple>());
374 command.Execute(); 362 command.Execute();
375 } 363 }
376 else if (output.Type == OutputType.Patch) 364 else if (output.Type == OutputType.Patch)
365 {
366 foreach (var storage in this.SubStorages)
377 { 367 {
378 foreach (var storage in this.SubStorages) 368 output.SubStorages.Add(storage);
379 {
380 output.SubStorages.Add(storage);
381 }
382 } 369 }
383 else // we can create instance transforms since Component Guids are set. 370 }
384 { 371 else // we can create instance transforms since Component Guids are set.
372 {
385#if TODO_FIX_INSTANCE_TRANSFORM 373#if TODO_FIX_INSTANCE_TRANSFORM
386 this.CreateInstanceTransforms(this.Output); 374 this.CreateInstanceTransforms(this.Output);
387#endif 375#endif
388 } 376 }
389 377
390#if TODO_FINISH_UPDATE 378#if TODO_FINISH_UPDATE
391 // Extended binder extensions can be called now that fields are resolved. 379 // Extended binder extensions can be called now that fields are resolved.
@@ -423,48 +411,48 @@ namespace WixToolset.Core.WindowsInstaller.Bind
423 } 411 }
424#endif 412#endif
425 413
426 this.ValidateComponentGuids(output); 414 this.ValidateComponentGuids(output);
427 415
428 // Stop processing if an error previously occurred. 416 // Stop processing if an error previously occurred.
429 if (this.Messaging.EncounteredError) 417 if (this.Messaging.EncounteredError)
430 { 418 {
431 return null; 419 return null;
432 } 420 }
433 421
434 // Ensure the intermediate folder is created since delta patches will be 422 // Ensure the intermediate folder is created since delta patches will be
435 // created there. 423 // created there.
436 Directory.CreateDirectory(this.IntermediateFolder); 424 Directory.CreateDirectory(this.IntermediateFolder);
437 425
438 if (SectionType.Patch == section.Type && this.DeltaBinaryPatch) 426 if (SectionType.Patch == section.Type && this.DeltaBinaryPatch)
439 { 427 {
440 var command = new CreateDeltaPatchesCommand(fileFacades, this.IntermediateFolder, section.Tuples.OfType<WixPatchIdTuple>().FirstOrDefault()); 428 var command = new CreateDeltaPatchesCommand(fileFacades, this.IntermediateFolder, section.Tuples.OfType<WixPatchIdTuple>().FirstOrDefault());
441 command.Execute(); 429 command.Execute();
442 } 430 }
443 431
444 // create cabinet files and process uncompressed files 432 // create cabinet files and process uncompressed files
445 var layoutDirectory = Path.GetDirectoryName(this.OutputPath); 433 var layoutDirectory = Path.GetDirectoryName(this.OutputPath);
446 if (!this.SuppressLayout || OutputType.Module == output.Type) 434 if (!this.SuppressLayout || OutputType.Module == output.Type)
447 { 435 {
448 this.Messaging.Write(VerboseMessages.CreatingCabinetFiles()); 436 this.Messaging.Write(VerboseMessages.CreatingCabinetFiles());
449 437
450 var command = new CreateCabinetsCommand(this.ServiceProvider, this.BackendHelper); 438 var command = new CreateCabinetsCommand(this.ServiceProvider, this.BackendHelper);
451 command.CabbingThreadCount = this.CabbingThreadCount; 439 command.CabbingThreadCount = this.CabbingThreadCount;
452 command.CabCachePath = this.CabCachePath; 440 command.CabCachePath = this.CabCachePath;
453 command.DefaultCompressionLevel = this.DefaultCompressionLevel; 441 command.DefaultCompressionLevel = this.DefaultCompressionLevel;
454 command.Output = output; 442 command.Output = output;
455 command.Messaging = this.Messaging; 443 command.Messaging = this.Messaging;
456 command.BackendExtensions = this.BackendExtensions; 444 command.BackendExtensions = this.BackendExtensions;
457 command.LayoutDirectory = layoutDirectory; 445 command.LayoutDirectory = layoutDirectory;
458 command.Compressed = compressed; 446 command.Compressed = compressed;
459 command.FileRowsByCabinet = filesByCabinetMedia; 447 command.FileRowsByCabinet = filesByCabinetMedia;
460 command.ResolveMedia = this.ResolveMedia; 448 command.ResolveMedia = this.ResolveMedia;
461 command.TableDefinitions = tableDefinitions; 449 command.TableDefinitions = tableDefinitions;
462 command.TempFilesLocation = this.IntermediateFolder; 450 command.TempFilesLocation = this.IntermediateFolder;
463 command.Execute(); 451 command.Execute();
464 452
465 fileTransfers.AddRange(command.FileTransfers); 453 fileTransfers.AddRange(command.FileTransfers);
466 trackedFiles.AddRange(command.TrackedFiles); 454 trackedFiles.AddRange(command.TrackedFiles);
467 } 455 }
468 456
469#if DELETE 457#if DELETE
470 if (OutputType.Patch == output.Type) 458 if (OutputType.Patch == output.Type)
@@ -479,65 +467,65 @@ namespace WixToolset.Core.WindowsInstaller.Bind
479 } 467 }
480#endif 468#endif
481 469
482 // stop processing if an error previously occurred 470 // stop processing if an error previously occurred
483 if (this.Messaging.EncounteredError) 471 if (this.Messaging.EncounteredError)
484 { 472 {
485 return null; 473 return null;
486 } 474 }
487 475
488 // Generate database file. 476 // Generate database file.
489 this.Messaging.Write(VerboseMessages.GeneratingDatabase()); 477 this.Messaging.Write(VerboseMessages.GeneratingDatabase());
490 478
491 { 479 {
492 var trackMsi = this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.Final); 480 var trackMsi = this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.Final);
493 trackedFiles.Add(trackMsi); 481 trackedFiles.Add(trackMsi);
494 482
495 var temporaryFiles = this.GenerateDatabase(output, tableDefinitions, trackMsi.Path, false, false); 483 var temporaryFiles = this.GenerateDatabase(output, tableDefinitions, trackMsi.Path, false, false);
496 trackedFiles.AddRange(temporaryFiles); 484 trackedFiles.AddRange(temporaryFiles);
497 } 485 }
498 486
499 // Stop processing if an error previously occurred. 487 // Stop processing if an error previously occurred.
500 if (this.Messaging.EncounteredError) 488 if (this.Messaging.EncounteredError)
501 { 489 {
502 return null; 490 return null;
503 } 491 }
492
493 // Merge modules.
494 if (containsMergeModules)
495 {
496 this.Messaging.Write(VerboseMessages.MergingModules());
504 497
505 // Merge modules. 498 // Add back possibly suppressed sequence tables since all sequence tables must be present
506 if (containsMergeModules) 499 // for the merge process to work. We'll drop the suppressed sequence tables again as
500 // necessary.
501 foreach (SequenceTable sequence in Enum.GetValues(typeof(SequenceTable)))
507 { 502 {
508 this.Messaging.Write(VerboseMessages.MergingModules()); 503 var sequenceTableName = sequence.ToString();
504 var sequenceTable = output.Tables[sequenceTableName];
509 505
510 // Add back possibly suppressed sequence tables since all sequence tables must be present 506 if (null == sequenceTable)
511 // for the merge process to work. We'll drop the suppressed sequence tables again as
512 // necessary.
513 foreach (SequenceTable sequence in Enum.GetValues(typeof(SequenceTable)))
514 { 507 {
515 var sequenceTableName = sequence.ToString(); 508 sequenceTable = output.EnsureTable(tableDefinitions[sequenceTableName]);
516 var sequenceTable = output.Tables[sequenceTableName];
517
518 if (null == sequenceTable)
519 {
520 sequenceTable = output.EnsureTable(tableDefinitions[sequenceTableName]);
521 }
522
523 if (0 == sequenceTable.Rows.Count)
524 {
525 suppressedTableNames.Add(sequenceTableName);
526 }
527 } 509 }
528 510
529 var command = new MergeModulesCommand(); 511 if (0 == sequenceTable.Rows.Count)
530 command.FileFacades = fileFacades; 512 {
531 command.Output = output; 513 suppressedTableNames.Add(sequenceTableName);
532 command.OutputPath = this.OutputPath; 514 }
533 command.SuppressedTableNames = suppressedTableNames;
534 command.Execute();
535 } 515 }
536 516
537 if (this.Messaging.EncounteredError) 517 var command = new MergeModulesCommand();
538 { 518 command.FileFacades = fileFacades;
539 return null; 519 command.Output = output;
540 } 520 command.OutputPath = this.OutputPath;
521 command.SuppressedTableNames = suppressedTableNames;
522 command.Execute();
523 }
524
525 if (this.Messaging.EncounteredError)
526 {
527 return null;
528 }
541 529
542#if TODO_FINISH_VALIDATION 530#if TODO_FINISH_VALIDATION
543 // Validate the output if there is an MSI validator. 531 // Validate the output if there is an MSI validator.
@@ -563,26 +551,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind
563 } 551 }
564#endif 552#endif
565 553
566 // Process uncompressed files. 554 // Process uncompressed files.
567 if (!this.Messaging.EncounteredError && !this.SuppressLayout && uncompressedFiles.Any()) 555 if (!this.Messaging.EncounteredError && !this.SuppressLayout && uncompressedFiles.Any())
568 { 556 {
569 var command = new ProcessUncompressedFilesCommand(section, this.BackendHelper, this.PathResolver); 557 var command = new ProcessUncompressedFilesCommand(section, this.BackendHelper, this.PathResolver);
570 command.Compressed = compressed; 558 command.Compressed = compressed;
571 command.FileFacades = uncompressedFiles; 559 command.FileFacades = uncompressedFiles;
572 command.LayoutDirectory = layoutDirectory; 560 command.LayoutDirectory = layoutDirectory;
573 command.LongNamesInImage = longNames; 561 command.LongNamesInImage = longNames;
574 command.ResolveMedia = this.ResolveMedia; 562 command.ResolveMedia = this.ResolveMedia;
575 command.DatabasePath = this.OutputPath; 563 command.DatabasePath = this.OutputPath;
576 command.Execute(); 564 command.Execute();
577
578 fileTransfers.AddRange(command.FileTransfers);
579 trackedFiles.AddRange(command.TrackedFiles);
580 }
581 565
582 // TODO: this is not sufficient to collect all Input files (for example, it misses Binary and Icon tables). 566 fileTransfers.AddRange(command.FileTransfers);
583 trackedFiles.AddRange(fileFacades.Select(f => this.BackendHelper.TrackFile(f.SourcePath, TrackedFileType.Input, f.SourceLineNumber))); 567 trackedFiles.AddRange(command.TrackedFiles);
584 } 568 }
585 569
570 // TODO: this is not sufficient to collect all Input files (for example, it misses Binary and Icon tables).
571 trackedFiles.AddRange(fileFacades.Select(f => this.BackendHelper.TrackFile(f.SourcePath, TrackedFileType.Input, f.SourceLineNumber)));
572
586 var result = this.ServiceProvider.GetService<IBindResult>(); 573 var result = this.ServiceProvider.GetService<IBindResult>();
587 result.FileTransfers = fileTransfers; 574 result.FileTransfers = fileTransfers;
588 result.TrackedFiles = trackedFiles; 575 result.TrackedFiles = trackedFiles;
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs
index 64b3fa93..44488a8a 100644
--- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs
@@ -436,50 +436,6 @@ namespace WixToolsetTest.CoreIntegration
436 } 436 }
437 437
438 [Fact] 438 [Fact]
439 public void CanBuildWithPartialWixpdbInput()
440 {
441 var folder = TestData.Get(@"TestData\SingleFile");
442
443 using (var fs = new DisposableFileSystem())
444 {
445 var baseFolder = fs.GetFolder();
446 var intermediateFolder = Path.Combine(baseFolder, "obj");
447 var wixpdbPath = Path.Combine(baseFolder, @"partial\test.wixpdb");
448
449 var result = WixRunner.Execute(new[]
450 {
451 "build",
452 Path.Combine(folder, "Package.wxs"),
453 Path.Combine(folder, "PackageComponents.wxs"),
454 "-loc", Path.Combine(folder, "Package.en-us.wxl"),
455 "-bindpath", Path.Combine(folder, "data"),
456 "-intermediateFolder", intermediateFolder,
457 //"-o", Path.Combine(baseFolder, @"partial\test.msi"),
458 "-pdb", wixpdbPath,
459 "-pdbtype", "Partial",
460 }, out var messages);
461 Assert.Equal(0, result);
462
463 result = WixRunner.Execute(new[]
464 {
465 "build",
466 wixpdbPath,
467 "-loc", Path.Combine(folder, "Package.en-us.wxl"),
468 "-bindpath", Path.Combine(folder, "data"),
469 "-intermediateFolder", intermediateFolder,
470 "-o", Path.Combine(baseFolder, @"bin\test.msi"),
471 }, out messages);
472 Assert.Equal(0, result);
473
474 var builtFiles = Directory.GetFiles(Path.Combine(baseFolder, @"bin"));
475 Assert.Equal(new[]{
476 "test.msi",
477 "test.wixpdb",
478 }, builtFiles.Select(Path.GetFileName).ToArray());
479 }
480 }
481
482 [Fact]
483 public void CanBuildWixlib() 439 public void CanBuildWixlib()
484 { 440 {
485 var folder = TestData.Get(@"TestData\SingleFile"); 441 var folder = TestData.Get(@"TestData\SingleFile");