Esempio n. 1
0
 public void NoErrorOnSpecifyingMinSizeInFileSearch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory,@"NoErrorOnSpecifyingMinSizeInFileSearch\FileSearch.wxs"));
     candle.ExpectedExitCode = 0;
     candle.Run();
 }
Esempio n. 2
0
 public void SuppressAllWarningsSwitch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.SuppressAllWarnings = true;
     candle.Run();
 }
Esempio n. 3
0
 public void FileNameWithSpace()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(Tests.WixTests.SharedAuthoringDirectory, "BasicProduct.wxs"));
     candle.OutputFile = Path.Combine(Utilities.FileUtilities.GetUniqueFileName(), "Pro  duct.wixobj");
     candle.Run();
 }
Esempio n. 4
0
        public void LongIdentifiers()
        {
            string longDirectoryName = "Directory_01234567890123456789012345678901234567890123456789012345678901234567890123456789";
            string longComponentName = "Component_01234567890123456789012345678901234567890123456789012345678901234567890123456789";
            string longFileName = "Test_txt_01234567890123456789012345678901234567890123456789012345678901234567890123456789";

            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(IdentifierTests.TestDataDirectory, @"LongIdentifiers\product.wxs"));
            candle.ExpectedWixMessages.Add(new WixMessage(1026, string.Format("The Directory/@Id attribute's value, '{0}', is too long for an identifier.  Standard identifiers are 72 characters long or less.", longDirectoryName),WixMessage.MessageTypeEnum.Warning));
            candle.ExpectedWixMessages.Add(new WixMessage(1026, string.Format("The Component/@Id attribute's value, '{0}', is too long for an identifier.  Standard identifiers are 72 characters long or less.", longComponentName), WixMessage.MessageTypeEnum.Warning));
            candle.ExpectedWixMessages.Add(new WixMessage(1026, string.Format("The File/@Id attribute's value, '{0}', is too long for an identifier.  Standard identifiers are 72 characters long or less.", longFileName), WixMessage.MessageTypeEnum.Warning));
            candle.ExpectedWixMessages.Add(new WixMessage(1026, string.Format("The ComponentRef/@Id attribute's value, '{0}', is too long for an identifier.  Standard identifiers are 72 characters long or less.", longComponentName), WixMessage.MessageTypeEnum.Warning));
            candle.Run();

            Light light = new Light(candle);
            light.SuppressedICEs.Add("ICE03");
            light.Run();

            // verify long names in the resulting msi
            string query = string.Format("SELECT `Directory` FROM `Directory` WHERE `Directory` = '{0}'", longDirectoryName);
            string queryResult = Verifier.Query(light.OutputFile, query);
            Assert.Equal(longDirectoryName, queryResult);

            query = string.Format("SELECT `Component` FROM `Component` WHERE `Component` = '{0}'", longComponentName);
            queryResult = Verifier.Query(light.OutputFile, query);
            Assert.Equal(longComponentName, queryResult);

            query = string.Format("SELECT `File` FROM `File` WHERE `File` = '{0}'", longFileName);
            queryResult = Verifier.Query(light.OutputFile, query);
            Assert.Equal(longFileName, queryResult);

            query = string.Format("SELECT `Component_` FROM `FeatureComponents` WHERE `Component_` = '{0}'", longComponentName);
            queryResult = Verifier.Query(light.OutputFile, query);
            Assert.Equal(longComponentName, queryResult);
        }
Esempio n. 5
0
 public void NoPedanticSwitch()
 {
     Candle candle = new Candle();
     candle.Pedantic = false;
     candle.SourceFiles.Add(PedanticTests.TestFile);
     candle.Run();
 }
Esempio n. 6
0
        public void LongFilePath()
        {
            //the max length of a path is 247 chars, the filepath is 259 chars

            string OutputPath = Utilities.FileUtilities.GetUniqueFileName();
            //add initial 170 chars
            OutputPath = Path.Combine(OutputPath, @"FilePathNewfolder11(20chars)\Newfolder12(20chars)Newfolder12(20chars)Newfolder13(20chars)Newfolder13(20chars)\Newfolder14(20chars)Newfolder15(20chars)Newfolder16(20chars)");

            int i = 245 - OutputPath.Length;
            while (i > 0)
            {
                OutputPath = Path.Combine(OutputPath, @"pt");
                i = 245 - OutputPath.Length;
            }
            if (OutputPath.Length < 246)
            {
                OutputPath = Path.Combine(OutputPath, "T");
            }

            Assert.True(OutputPath.Length  <248, "The output path is not less than 248 chars");
            Directory.CreateDirectory(OutputPath);

            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(Tests.WixTests.SharedAuthoringDirectory, "BasicProduct.wxs"));
            candle.OutputFile = Path.Combine(OutputPath, "Prod.wixobj");

            Assert.True((candle.OutputFile.Length > 256) && (candle.OutputFile.Length < 260), String.Format("The output filepath{0} is not between 256 and 260 chars",candle .OutputFile .Length));

            candle.Run();
        }
        public void PreMsi50ShortcutProperty()
        {
            // Loop through a list of pre-MSI 5.0 Windows Installer version
            foreach (MSIVersions.Versions version in Enum.GetValues(typeof(MSIVersions.Versions)))
            {
                // Skip MSI 5.0 and later
                if (MSIVersions.GetVersion(version) >= MSIVersions.GetVersion(MSIVersions.Versions.MSI50))
                {
                    continue;
                }

                Candle candle = new Candle();
                candle.SourceFiles.Add(Path.Combine(ShortcutPropertyTests.TestDataDirectory, @"PreMsi50ShortcutProperty\product.wxs"));
                candle.PreProcessorParams.Add("InstallerVersion", MSIVersions.GetVersionInMSIFormat(version));
                candle.Run();

                Light light = new Light(candle);

                // Only run validation on MSIs built with the current or earlier than current versions of Windows Installer
                if (DTF.Installer.Version < MSIVersions.GetVersion(version))
                {
                    light.SuppressMSIAndMSMValidation = true;
                }

                light.Run();
            }
        }
Esempio n. 8
0
 public void VerifyDeprecatedSwitch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.OtherArguments = "-swall";
     candle.ExpectedWixMessages.Add(new WixMessage(1108, "The command line switch 'swall' is deprecated. Please use 'sw' instead.", WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
Esempio n. 9
0
 public void SuppressSpecificWarnings()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.SuppressWarnings.Add(1075);
     candle.ExpectedWixMessages.Add(new WixMessage(1096, WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
Esempio n. 10
0
 public void NoSuppressWarningsSwitch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.ExpectedWixMessages.Add(new WixMessage(1096, WixMessage.MessageTypeEnum.Warning));
     candle.ExpectedWixMessages.Add(new WixMessage(1075, WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
Esempio n. 11
0
 public void MultipleWxsFiles()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(WixTests.SharedAuthoringDirectory, "BasicProduct.wxs"));
     candle.SourceFiles.Add(Path.Combine(Path.Combine(InputTests.TestDataDirectory, @"MultipleWxsFiles\product.wxs")));
     candle.SourceFiles.Add(Path.Combine(Path.Combine(InputTests.TestDataDirectory, @"MultipleWxsFiles\feature.wxs")));
     candle.Run();
 }
Esempio n. 12
0
 public void InvalidWxsFile()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(InputTests.TestDataDirectory, @"InvalidWxsFile\Product.wxs"));
     candle.ExpectedWixMessages.Add(new WixMessage(104, "Not a valid source file; detail: Data at the root level is invalid. Line 1, position 1.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 104;
     candle.Run();
 }
Esempio n. 13
0
 public void EmptyWxsFile()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(InputTests.TestDataDirectory, @"EmptyWxsFile\Product.wxs"));
     candle.ExpectedWixMessages.Add(new WixMessage(104, "Not a valid source file; detail: Root element is missing.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 104;
     candle.Run();
 }
Esempio n. 14
0
 public void OutSwitch()
 {
     string outputDirectory = Utilities.FileUtilities.GetUniqueFileName();
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(Tests.WixTests.SharedAuthoringDirectory, "BasicProduct.wxs"));
     candle.OutputFile = Path.Combine(outputDirectory, "BasicProduct.wixobj"); ;
     candle.Run();
 }
Esempio n. 15
0
 public void ProductVersionAttributeNotPopulated()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory,@"ProductVersionAttributeNotPopulated\ProductVersionAttributeMissing.wxs"));
     candle.ExpectedWixMessages.Add(new WixMessage(10, "The Product/@Version attribute was not found; it is required.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 10;
     candle.Run();
 }
Esempio n. 16
0
 public void EmbedCabAttrWithoutCabinetAttr()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(RegressionTests.TestDataDirectory,@"EmbedCabAttrWithoutCabinetAttr\EmbedCabProduct.wxs"));
     candle.ExpectedExitCode = 10;
     candle.ExpectedWixMessages.Add(new WixMessage(10, "The Media/@Cabinet attribute was not found; it is required when attribute EmbedCab has a value of 'yes'.", WixMessage.MessageTypeEnum.Error));
     candle.Run();
 }
Esempio n. 17
0
 public void NoTraceSwitch()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.Trace = false;
     candle.ExpectedWixMessages.Add(new WixMessage(1075, "The Product/@UpgradeCode attribute was not found; it is strongly recommended to ensure that this product can be upgraded.", WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
 public void Warning()
 {
     string testFile = Environment.ExpandEnvironmentVariables(Path.Combine(ErrorsAndWarningsTests.TestDataDirectory, @"Warning\Product.wxs"));
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.ExpectedWixMessages.Add(new WixMessage(1096, "Preprocessor warning", WixMessage.MessageTypeEnum.Warning));
     candle.Run();
 }
 public void DirectoryAttributeWithPropertyAttribute()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(RemoveFolderTests.TestDataDirectory, @"DirectoryAttributeWithPropertyAttribute\product.wxs"));
     candle.ExpectedWixMessages.Add(new WixMessage(35, "The RemoveFolder/@Property attribute cannot be specified when attribute Directory is present with value 'WixTestFolder'.", WixMessage.MessageTypeEnum.Error));
     candle .ExpectedExitCode = 35;
     candle.Run();
 }
Esempio n. 20
0
 public void AuthoringVariableRedefinition()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(VariableTests.TestDataDirectory, @"AuthoringVariableRedefinition\Product.wxs"));
     candle.ExpectedWixMessages.Add(new WixMessage(1118, "The variable 'Var' with value 'value2' was previously declared with value 'value1'.", WixMessage.MessageTypeEnum.Warning));
     candle.ExpectedExitCode = 0;
     candle.Run();
 }
 public void MissingRequiredAttributes()
 {
     // Run Candle
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(CustomActionTests.TestDataDirectory, @"MissingRequiredAttributes\product.wxs"));
     candle.ExpectedWixMessages.Add(new WixMessage(37, "The CustomAction/@ExeCommand attribute cannot be specified without attribute BinaryKey, Directory, FileKey, or Property present.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 37;
     candle.Run();
 }
Esempio n. 22
0
 public void CommandlineVariableRedefinition()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(WixTests.BasicProductWxs);
     candle.OtherArguments = " -dVar=value1 -dVar=value2";
     candle.ExpectedWixMessages.Add(new WixMessage(288, "The variable 'Var' with value 'value2' was previously declared with value 'value1'.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 288;
     candle.Run();
 }
Esempio n. 23
0
 public void WxAndSw()
 {
     string testFile = Environment.ExpandEnvironmentVariables(@"%WIX_ROOT%\test\data\Tools\Candle\MultipleInputSwitchesTests\WxAndSw\Product.wxs");
     Candle candle = new Candle();
     candle.TreatAllWarningsAsErrors = true;
     candle.SuppressAllWarnings = true;
     candle.SourceFiles.Add(testFile);
     candle.Run();
 }
 public void Error()
 {
     string testFile = Environment.ExpandEnvironmentVariables(Path.Combine(ErrorsAndWarningsTests.TestDataDirectory, @"Error\Product.wxs"));
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.ExpectedWixMessages.Add(new WixMessage(250, "Preprocessor error", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 250;
     candle.Run();
 }
 public void PermissionEx_GroupRefMissingParentComponent()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(PermissionExTests.TestDataDirectory, @"GroupRefMissingParentComponent.wxs"));
     candle.Extensions.Add("WixUtilExtension");
     candle.ExpectedWixMessages.Add(new WixMessage(5051, @"The util:GroupRef element cannot be specified unless the element has a Component as an ancestor. A util:GroupRef that does not have a Component ancestor is not installed.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 5051;
     candle.Run();
 }
Esempio n. 26
0
        public void SuppressSchemaValidation()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(testFile);

            // The authoring does not contain a package element which is normally a schema validation error
            candle.SuppressSchemaValidation = true;
            candle.Run();
        }
Esempio n. 27
0
 public void DoNotSuppressSchemaValidation()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(testFile);
     candle.SuppressSchemaValidation = false;
     candle.ExpectedWixMessages.Add(new WixMessage(107, "Schema validation failed with the following error at line 1, column 542: The element 'Product' in namespace 'http://schemas.microsoft.com/wix/2006/wi' has invalid child element 'Media' in namespace 'http://schemas.microsoft.com/wix/2006/wi'. List of possible elements expected: 'Package'.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 107;
     candle.Run();
 }
Esempio n. 28
0
 public void SqlScript_DeprecatedBinaryElement()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(SqlScriptTests.TestDataDirectory, @"DeprecatedBinaryElement.wxs"));
     candle.Extensions.Add("WixSqlExtension");
     candle.ExpectedWixMessages.Add(new WixMessage(5103, @"The sql:SqlScript element contains a deprecated child Binary element.  Please move the Binary element under a Fragment, Module, or Product element and set the sql:SqlScript/@BinaryKey attribute to the value of the Binary/@Id attribute.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 5103;
     candle.Run();
 }
Esempio n. 29
0
 public void SqlDatabase_MissingAttributes()
 {
     Candle candle = new Candle();
     candle.SourceFiles.Add(Path.Combine(SqlDatabaseTests.TestDataDirectory, @"MissingAttributes.wxs"));
     candle.Extensions.Add("WixSqlExtension");
     candle.ExpectedWixMessages.Add(new WixMessage(5102, @"When nested under a Component, the sql:SqlDatabase element must have one of the following attributes specified: CreateOnInstall, CreateOnUninstall, DropOnInstall or DropOnUninstall.", WixMessage.MessageTypeEnum.Error));
     candle.ExpectedExitCode = 5102;
     candle.Run();
 }
Esempio n. 30
0
        public void SimpleSuppressICE()
        {
            Candle candle = new Candle();
            candle.SourceFiles.Add(Path.Combine(SuppressICEsTests.TestDataDirectory, @"SimpleSuppressICE\product.wxs"));
            candle.Run();

            Light light = new Light(candle);
            light.SuppressedICEs.Add("ICE18");
            light.Run();
        }
Esempio n. 31
0
        /// <summary>
        /// Builds the package.
        /// </summary>
        /// <returns>The path to the built MSI package.</returns>
        protected override BundleBuilder BuildItem()
        {
            // Create paths.
            string rootDirectory = FileUtilities.GetUniqueFileName();
            string objDirectory  = Path.Combine(rootDirectory, Settings.WixobjFolder);
            string exeDirectory  = Path.Combine(rootDirectory, "Bundles");
            string bundle        = Path.Combine(exeDirectory, String.Concat(this.Name, ".exe"));

            // Add the root directory to be cleaned up.
            this.Artifacts.Add(new DirectoryInfo(rootDirectory));

            // Compile.
            Candle candle = new Candle();

            candle.Extensions.AddRange(this.Extensions);
            candle.OtherArguments = String.Concat("-dTestName=", this.TestName);
            this.PreprocessorVariables.ToList().ForEach(kv => candle.OtherArguments = String.Concat(candle.OtherArguments, " -d", kv.Key, "=", kv.Value));
            candle.OutputFile = String.Concat(objDirectory, @"\");
            candle.SourceFiles.Add(this.SourceFile);
            candle.SourceFiles.AddRange(this.AdditionalSourceFiles);
            candle.WorkingDirectory = this.DataFolder;
            candle.Run();

            // Make sure the output directory is cleaned up.
            this.Artifacts.Add(new DirectoryInfo(objDirectory));

            // Link.
            Light light = new Light();

            light.Extensions.AddRange(this.Extensions);
            light.OtherArguments = String.Format("-b build={0} -b data={1}", Settings.WixBuildDirectory, Environment.ExpandEnvironmentVariables(@"%WIX_ROOT%\test\data\"));
            this.BindPaths.ToList().ForEach(kv => light.OtherArguments = String.Concat(light.OtherArguments, " -b ", kv.Key, "=", kv.Value));
            light.ObjectFiles = candle.ExpectedOutputFiles;
            light.OutputFile  = bundle;
            light.SuppressMSIAndMSMValidation = true;
            light.WorkingDirectory            = this.DataFolder;
            light.Run();

            // Make sure the output directory is cleaned up.
            this.Artifacts.Add(new DirectoryInfo(exeDirectory));

            this.Output = light.OutputFile;
            return(this);
        }
Esempio n. 32
0
        /// <summary>
        /// Build a setup package from the specified sources
        /// </summary>
        /// <param name="workingDirectory">The working directory from where Candle and Light are run</param>
        /// <param name="sourceFiles">The .wxs files to compile</param>
        /// <param name="outputFile">The name of the output file</param>
        /// <param name="outputToTemp">Save the output to temp</param>
        /// <param name="otherCandleArgs">Additional arguments to pass to Candle.exe</param>
        /// <param name="otherLightArgs">Additional arguments to pass to Light.exe</param>
        /// <returns>The path to the output file</returns>
        public static string BuildPackage(string workingDirectory, string[] sourceFiles, string outputFile, bool outputToTemp, string otherCandleArgs, string otherLightArgs)
        {
            // Determine where to save the output
            string outputDirectory = Environment.CurrentDirectory;

            if (outputToTemp && Path.IsPathRooted(outputFile))
            {
                outputDirectory = FileUtilities.GetUniqueFileName();
            }

            // Create a directory for intermediate wixobj output
            string wixobjDirectory = Path.Combine(outputDirectory, Settings.WixobjFolder);

            FileUtilities.CreateOutputDirectory(wixobjDirectory);

            // Compile
            Candle candle = new Candle();

            candle.WorkingDirectory = workingDirectory;
            candle.SourceFiles      = new List <string>(sourceFiles);
            candle.OutputFile       = String.Concat(wixobjDirectory, @"\");
            candle.OtherArguments   = otherCandleArgs;
            candle.Run();

            // Link
            Light light = new Light();

            light.WorkingDirectory = workingDirectory;
            light.ObjectFiles      = candle.ExpectedOutputFiles;
            light.OutputFile       = Path.Combine(outputDirectory, outputFile);
            FileUtilities.CreateOutputDirectory(Path.GetDirectoryName(light.OutputFile));
            light.OutputFile     = Path.Combine(outputDirectory, outputFile);
            light.OtherArguments = otherLightArgs;
            light.Run();

            return(light.OutputFile);
        }
Esempio n. 33
0
        /// <summary>
        /// Builds a patch using given paths for the target and upgrade packages.
        /// </summary>
        /// <returns>The path to the patch.</returns>
        protected override PatchBuilder BuildItem()
        {
            // Create paths.
            string source        = String.IsNullOrEmpty(this.SourceFile) ? Path.Combine(this.TestDataDirectory, String.Concat(this.Name, ".wxs")) : this.SourceFile;
            string rootDirectory = FileUtilities.GetUniqueFileName();
            string objDirectory  = Path.Combine(rootDirectory, Settings.WixobjFolder);
            string msiDirectory  = Path.Combine(rootDirectory, Settings.MspFolder);
            string wixmsp        = Path.Combine(objDirectory, String.Concat(this.Name, ".wixmsp"));
            string package       = Path.Combine(msiDirectory, String.Concat(this.Name, ".msp"));

            // Add the root directory to be cleaned up.
            this.TestArtifacts.Add(new DirectoryInfo(rootDirectory));

            // Compile.
            Candle candle = new Candle();

            candle.Extensions.AddRange(this.Extensions);
            candle.OtherArguments = String.Concat("-dTestName=", this.TestName);
            this.PreprocessorVariables.ToList().ForEach(kv => candle.OtherArguments = String.Concat(candle.OtherArguments, " -d", kv.Key, "=", kv.Value));
            candle.OutputFile = String.Concat(objDirectory, @"\");
            candle.SourceFiles.Add(source);
            candle.WorkingDirectory = this.TestDataDirectory;
            candle.Run();

            // Make sure the output directory is cleaned up.
            this.TestArtifacts.Add(new DirectoryInfo(objDirectory));

            // Link.
            Light light = new Light();

            light.Extensions.AddRange(this.Extensions);
            light.OtherArguments = String.Concat("-b data=", Environment.ExpandEnvironmentVariables(@"%WIX_ROOT%\test\data\"));
            this.BindPaths.ToList().ForEach(kv => light.OtherArguments = String.Concat(light.OtherArguments, " -b ", kv.Key, "=", kv.Value));
            light.ObjectFiles = candle.ExpectedOutputFiles;
            light.OutputFile  = wixmsp;
            light.SuppressMSIAndMSMValidation = true;
            light.WorkingDirectory            = this.TestDataDirectory;
            light.Run();

            // Make sure the output directory is cleaned up.
            this.TestArtifacts.Add(new DirectoryInfo(msiDirectory));

            // Pyro.
            Pyro pyro = new Pyro();

            Assert.NotNull(this.TargetPaths);
            Assert.NotNull(this.UpgradePaths);
            Assert.Equal <int>(this.TargetPaths.Length, this.UpgradePaths.Length);

            for (int i = 0; i < this.TargetPaths.Length; ++i)
            {
                // Torch.
                Torch torch = new Torch();
                torch.TargetInput        = Path.ChangeExtension(this.TargetPaths[i], "wixpdb");
                torch.UpdatedInput       = Path.ChangeExtension(this.UpgradePaths[i], "wixpdb");
                torch.PreserveUnmodified = true;
                torch.XmlInput           = true;
                torch.OutputFile         = Path.Combine(objDirectory, String.Concat(Path.GetRandomFileName(), ".wixmst"));
                torch.WorkingDirectory   = this.TestDataDirectory;
                torch.Run();

                pyro.Baselines.Add(torch.OutputFile, this.Name);
            }

            pyro.InputFile        = light.OutputFile;
            pyro.OutputFile       = package;
            pyro.WorkingDirectory = this.TestDataDirectory;
            pyro.SuppressWarnings.Add("1079");
            pyro.Run();

            this.Output = pyro.OutputFile;
            return(this);
        }
Esempio n. 34
0
        public static string[] Compile(
            string[] sourceFiles,
            bool fips = false,
            WixMessage[] expectedWixMessages = null,
            string[] extensions         = null,
            string[] includeSearchPaths = null,
            bool onlyValidateDocuments  = false,
            string otherArguments       = null,
            bool pedantic         = false,
            string preProcessFile = null,
            Dictionary <string, string> preProcessorParams = null,
            bool setOutputFileIfNotSpecified = true,
            bool suppressAllWarnings         = false,
            bool suppressMarkingVitalDefault = false,
            bool suppressSchemaValidation    = false,
            int[] suppressWarnings           = null,
            bool trace = false,
            int[] treatWarningsAsErrors   = null,
            bool treatAllWarningsAsErrors = false,
            bool verbose = false)
        {
            Candle candle = new Candle();

            if (null == sourceFiles || sourceFiles.Length == 0)
            {
                throw new ArgumentException("sourceFiles cannot be null or empty");
            }

            // set the passed arrguments
            candle.SourceFiles.AddRange(sourceFiles);
            if (null != expectedWixMessages)
            {
                candle.ExpectedWixMessages.AddRange(expectedWixMessages);
            }
            if (null != extensions)
            {
                candle.Extensions.AddRange(extensions);
            }
            candle.FIPS = fips;
            if (null != includeSearchPaths)
            {
                candle.IncludeSearchPaths.AddRange(includeSearchPaths);
            }
            candle.OnlyValidateDocuments = onlyValidateDocuments;
            candle.OtherArguments        = otherArguments;
            candle.Pedantic       = pedantic;
            candle.PreProcessFile = preProcessFile;
            if (null != preProcessorParams)
            {
                candle.PreProcessorParams = preProcessorParams;
            }
            candle.SetOutputFileIfNotSpecified = setOutputFileIfNotSpecified;
            candle.SuppressAllWarnings         = suppressAllWarnings;
            candle.SuppressMarkingVitalDefault = suppressMarkingVitalDefault;
            candle.SuppressSchemaValidation    = suppressSchemaValidation;
            if (null != suppressWarnings)
            {
                candle.SuppressWarnings.AddRange(suppressWarnings);
            }
            candle.Trace = trace;
            if (null != treatWarningsAsErrors)
            {
                candle.TreatWarningsAsErrors.AddRange(treatWarningsAsErrors);
            }
            candle.TreatAllWarningsAsErrors = treatAllWarningsAsErrors;
            candle.Verbose = verbose;

            candle.Run();

            return(candle.ExpectedOutputFiles.ToArray());
        }