| 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 | |
| 3 | using System.Collections.Generic; |
| 4 | using System.IO; |
| 5 | using WixInternal.Core.TestPackage; |
| 6 | |
| 7 | namespace CompileCoreTestExtensionWixlib |
| 8 | { |
| 9 | // We want to be able to test Core with extensions, but there's no easy way to build an extension without Tools. |
| 10 | // So we have this helper exe. |
| 11 | public class Program |
| 12 | { |
| 13 | public static void Main(string[] args) |
| 14 | { |
| 15 | var intermediateFolder = args[0]; |
| 16 | var wixlibPath = args[1]; |
| 17 | |
| 18 | var buildArgs = new List<string>(); |
| 19 | buildArgs.Add("build"); |
| 20 | buildArgs.Add("-bindfiles"); |
| 21 | buildArgs.Add("-intermediateFolder"); |
| 22 | buildArgs.Add(intermediateFolder); |
| 23 | buildArgs.Add("-o"); |
| 24 | buildArgs.Add(wixlibPath); |
| 25 | |
| 26 | foreach (var path in args[2].Split(';')) |
| 27 | { |
| 28 | var folder = Path.GetDirectoryName(Path.GetFullPath(path)); |
| 29 | |
| 30 | buildArgs.Add("-bindpath"); |
| 31 | buildArgs.Add(folder); |
| 32 | |
| 33 | buildArgs.Add(path); |
| 34 | } |
| 35 | |
| 36 | var result = WixRunner.Execute(buildArgs.ToArray()); |
| 37 | |
| 38 | result.AssertSuccess(); |
| 39 | } |
| 40 | } |
| 41 | } |