public void UxMultiplePayloadChildren() { string sourceFile = Path.Combine(UXTests.TestDataDirectory, @"UxMultiplePayloadChildren\product.wxs"); string[] filenames = new string[50]; string variables = string.Empty; //create 50 temp files and generate the args for candle for (int i = 1; i < 51; i++) { filenames[i - 1] = Utilities.FileUtilities.CreateSizedFile(0); variables += " -dMyVariable" + i.ToString() + "=" + filenames[i - 1]; } string outputDirectory = this.TestContext.TestDirectory; string bootstrapper = Builder.BuildBundlePackage(outputDirectory, sourceFile, null, variables, null, true); for (int i = 1; i < 51; i++) { UXTests.VerifyUXPayloadInformation(outputDirectory, filenames[i - 1], "PayloadFile" + i.ToString(), false); } //remove the created temp file using try statement //for some file would be failed to be remove for it still occupied by testing thread. for (int i = 1; i < 51; i++) { try { File.Delete(filenames[i - 1]); } catch { } } }
public void PayloadNameSpecified() { string sourceFile = Path.Combine(PayloadTests.TestDataDirectory, @"PayloadNameSpecified\Product.wxs"); string testFile = Path.Combine(BundleTests.BundleSharedFilesDirectory, @"Bootstrapper.exe"); string outputDirectory = this.TestContext.TestDirectory; // build the bootstrapper string bootstrapper = Builder.BuildBundlePackage(outputDirectory, sourceFile); // verify the ParameterInfo and burnManifest has the correct information UXTests.VerifyUXPayloadInformation(outputDirectory, testFile, "Setup.exe"); }
public void UXPayloadChild() { string sourceFile = Path.Combine(UXTests.TestDataDirectory, @"UXPayloadChild\Product.wxs"); string payloadFile = Path.Combine(BundleTests.BundleSharedFilesDirectory, @"UXPayload\PayloadFile1.txt"); string outputDirectory = this.TestContext.TestDirectory; // build the bootstrapper string bootstrapper = Builder.BuildBundlePackage(outputDirectory, sourceFile); // verify the ParameterInfo and burnManifest has the correct information UXTests.VerifyUXPayloadInformation(outputDirectory, payloadFile, "PayloadFile1.txt", true); }
public void PayloadRelativeSourceFilePath() { string sourceFile = Path.Combine(PayloadTests.TestDataDirectory, @"PayloadRelativeSourceFilePath\Product.wxs"); string testFile = Path.Combine(BundleTests.BundleSharedFilesDirectory, @"Bootstrapper.exe"); string outputDirectory = this.TestContext.TestDirectory; // Copy a file to the current directory. This file is used to verify relative paths in source files. File.Copy(testFile, Path.Combine(outputDirectory, "Bootstrapper.exe"), true); // build the bootstrapper string bootstrapper = Builder.BuildBundlePackage(outputDirectory, sourceFile); // verify the ParameterInfo and burnManifest has the correct information UXTests.VerifyUXPayloadInformation(outputDirectory, testFile, "Bootstrapper.exe"); }
public void NestedPayloadGroups() { string sourceFile = Path.Combine(PayloadTests.TestDataDirectory, @"NestedPayloadGroups\Product.wxs"); string PayloadFile1 = Path.Combine(BundleTests.BundleSharedFilesDirectory, @"UXPayload\PayloadFile1.txt"); string PayloadFile2 = Path.Combine(BundleTests.BundleSharedFilesDirectory, @"UXPayload\PayloadFile2.txt"); string PayloadFile3 = Path.Combine(BundleTests.BundleSharedFilesDirectory, @"UXPayload\PayloadFile3.txt"); string PayloadFile4 = Path.Combine(BundleTests.BundleSharedFilesDirectory, @"UXPayload\PayloadFile4.txt"); string PayloadFile5 = Path.Combine(BundleTests.BundleSharedFilesDirectory, @"UXPayload\PayloadFile5.txt"); string outputDirectory = this.TestContext.TestDirectory; // build the bootstrapper string bootstrapper = Builder.BuildBundlePackage(outputDirectory, sourceFile); // verify the ParameterInfo and burnManifest has the correct information UXTests.VerifyUXPayloadInformation(outputDirectory, PayloadFile1, "PayloadFile1.txt", false); UXTests.VerifyUXPayloadInformation(outputDirectory, PayloadFile2, "PayloadFile2.txt", false); UXTests.VerifyUXPayloadInformation(outputDirectory, PayloadFile3, "PayloadFile3.txt", false); UXTests.VerifyUXPayloadInformation(outputDirectory, PayloadFile4, "PayloadFile4.txt", false); UXTests.VerifyUXPayloadInformation(outputDirectory, PayloadFile5, "PayloadFile5.txt", false); }
/// <summary> /// Verifies UX Payload file information in ParameterInfo.xml and Burn_Manifest.xml /// </summary> /// <param name="embededResourcesDirectoryPath">Output folder where all the embeded resources are.</param> /// <param name="acctualFilePath">Path to the acctual file that was packed in the cab.</param> /// <param name="expectedFileName">Expected file name of the file.</param> public static void VerifyUXPayloadInformation(string embededResourcesDirectoryPath, string acctualFilePath, string expectedFileName) { UXTests.VerifyUXPayloadInformation(embededResourcesDirectoryPath, acctualFilePath, expectedFileName, true); }