本文整理汇总了C#中Candle.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Candle.Run方法的具体用法?C# Candle.Run怎么用?C# Candle.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Candle
的用法示例。
在下文中一共展示了Candle.Run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PayloadEmptySourceFileAttribute
public void PayloadEmptySourceFileAttribute()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(PayloadTests.TestDataDirectory, @"PayloadEmptySourceFileAttribute\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(6, "The Payload/@SourceFile attribute's value cannot be an empty string. If you want the value to be null or empty, simply remove the entire attribute.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 6;
candle.Run();
}
示例2: ComponentSearchGuidMissing
public void ComponentSearchGuidMissing()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(ComponentSearchTests.TestDataDirectory, @"ComponentSearchGuidMissing\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(10, "The util:ComponentSearch/@Guid attribute was not found; it is required.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 10;
candle.Extensions.Add("WixUtilExtension");
candle.Run();
}
示例3: DirectorySearchInvalidPath
public void DirectorySearchInvalidPath()
{
string sourceFile = Path.Combine(DirectorySearchTests.TestDataDirectory, @"DirectorySearchInvalidPath\Product.wxs");
Candle candle = new Candle();
candle.SourceFiles.Add(sourceFile);
candle.Extensions.Add("WixUtilExtension");
candle.ExpectedWixMessages.Add(new WixMessage(346, "The util:DirectorySearch/@Path attribute's value, '%windir%\\System|*32', is not a valid relative long name because it contains illegal characters. Legal relative long names contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: ? | > < : / * \".", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 346;
candle.Run();
}
示例4: ExampleTest2
public void ExampleTest2()
{
// Compile a wxs file
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(this.TestContext.DataDirectory, @"Examples\ExampleTest2\product.wxs"));
candle.Run();
// Create a Light object that uses some properties of the Candle object
Light light = new Light(candle);
// Define the Light warning that we expect to see
WixMessage LGHT1079 = new WixMessage(1079, WixMessage.MessageTypeEnum.Warning);
light.ExpectedWixMessages.Add(LGHT1079);
// Link
light.Run();
// Query the resulting MSI for verification
string query = "SELECT `Value` FROM `Property` WHERE `Property` = 'Manufacturer'";
Verifier.VerifyQuery(light.OutputFile, query, "Microsoft Corporation");
}
示例5: PackageInvalidVital
public void PackageInvalidVital()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(PackageTests.TestDataDirectory, @"PackageInvalidVital\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(15, "The MsiPackage/@Vital attribute's value, 'true', is not a legal yes/no value. The only legal values are 'no' and 'yes'.", Message.MessageTypeEnum.Error));
candle.ExpectedWixMessages.Add(new WixMessage(15, "The MspPackage/@Vital attribute's value, 'false', is not a legal yes/no value. The only legal values are 'no' and 'yes'.", Message.MessageTypeEnum.Error));
candle.ExpectedWixMessages.Add(new WixMessage(15, "The MsuPackage/@Vital attribute's value, 'vital', is not a legal yes/no value. The only legal values are 'no' and 'yes'.", Message.MessageTypeEnum.Error));
candle.ExpectedWixMessages.Add(new WixMessage(15, "The ExePackage/@Vital attribute's value, 'TRUE', is not a legal yes/no value. The only legal values are 'no' and 'yes'.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 15;
candle.Run();
}
示例6: PackageInvalidName
public void PackageInvalidName()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(PackageTests.TestDataDirectory, @"PackageInvalidName\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(346, "The MsiPackage/@Name attribute's value, 'MsiPackage|*?.msi', is not a valid relative long name because it contains illegal characters. Legal relative long names contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: ? | > < : / * \".", Message.MessageTypeEnum.Error));
candle.ExpectedWixMessages.Add(new WixMessage(346, "The MspPackage/@Name attribute's value, 'MspPackage|*?.msp', is not a valid relative long name because it contains illegal characters. Legal relative long names contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: ? | > < : / * \".", Message.MessageTypeEnum.Error));
candle.ExpectedWixMessages.Add(new WixMessage(346, "The MsuPackage/@Name attribute's value, 'MsuPackage|*?.msu', is not a valid relative long name because it contains illegal characters. Legal relative long names contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: ? | > < : / * \".", Message.MessageTypeEnum.Error));
candle.ExpectedWixMessages.Add(new WixMessage(346, "The ExePackage/@Name attribute's value, 'ExePackage|*?.exe', is not a valid relative long name because it contains illegal characters. Legal relative long names contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: ? | > < : / * \".", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 346;
candle.Run();
}
示例7: BuildPatch
/// <summary>
/// Builds a patch using given paths for the target and upgrade packages.
/// </summary>
/// <param name="targetPath">The path to the target MSI.</param>
/// <param name="upgradePath">The path to the upgrade MSI.</param>
/// <param name="name">The name of the patch to build.</param>
/// <param name="version">Optional version for the bundle.</param>
/// <returns>The path to the patch.</returns>
private string BuildPatch(string targetPath, string upgradePath, string name, string version)
{
// Get the name of the calling method.
StackTrace stack = new StackTrace();
string caller = stack.GetFrame(1).GetMethod().Name;
// Create paths.
string source = Path.Combine(this.TestContext.TestDataDirectory, String.Concat(name, ".wxs"));
string rootDirectory = FileUtilities.GetUniqueFileName();
string objDirectory = Path.Combine(rootDirectory, Settings.WixobjFolder);
string msiDirectory = Path.Combine(rootDirectory, Settings.MsiFolder);
string wixmst = Path.Combine(objDirectory, String.Concat(name, ".wixmst"));
string wixmsp = Path.Combine(objDirectory, String.Concat(name, ".wixmsp"));
string package = Path.Combine(msiDirectory, String.Concat(name, ".msp"));
// Add the root directory to be cleaned up.
this.TestArtifacts.Add(new DirectoryInfo(rootDirectory));
// Compile.
Candle candle = new Candle();
candle.Extensions.AddRange(DependencyExtensionTests.Extensions);
candle.OtherArguments = String.Concat("-dTestName=", caller);
if (!String.IsNullOrEmpty(version))
{
candle.OtherArguments = String.Concat(candle.OtherArguments, " -dVersion=", version);
}
candle.OutputFile = String.Concat(objDirectory, @"\");
candle.SourceFiles.Add(source);
candle.WorkingDirectory = this.TestContext.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(DependencyExtensionTests.Extensions);
light.ObjectFiles = candle.ExpectedOutputFiles;
light.OutputFile = wixmsp;
light.SuppressMSIAndMSMValidation = true;
light.WorkingDirectory = this.TestContext.TestDataDirectory;
light.Run();
// Make sure the output directory is cleaned up.
this.TestArtifacts.Add(new DirectoryInfo(msiDirectory));
// Torch.
Torch torch = new Torch();
torch.TargetInput = Path.ChangeExtension(targetPath, "wixpdb");
torch.UpdatedInput = Path.ChangeExtension(upgradePath, "wixpdb");
torch.PreserveUnmodified = true;
torch.XmlInput = true;
torch.OutputFile = wixmst;
torch.WorkingDirectory = this.TestContext.TestDataDirectory;
torch.Run();
// Pyro.
Pyro pyro = new Pyro();
pyro.Baselines.Add(torch.OutputFile, name);
pyro.InputFile = light.OutputFile;
pyro.OutputFile = package;
pyro.WorkingDirectory = this.TestContext.TestDataDirectory;
pyro.SuppressWarnings.Add("1079");
pyro.Run();
return pyro.OutputFile;
}
示例8: LayoutFileInvalidName
public void LayoutFileInvalidName()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(LayoutTests.TestDataDirectory, @"LayoutFileInvalidName\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(27, "The LayoutFile/@Name attribute's value, 'File?*|Name.txt', is not a valid long name because it contains illegal characters. Legal long names contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: \\ ? | > < : / * \".", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 27;
candle.Run();
}
示例9: LayoutDirectoryRefIdMissing
public void LayoutDirectoryRefIdMissing()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(LayoutTests.TestDataDirectory, @"LayoutDirectoryRefIdMissing\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(10, "The LayoutDirectoryRef/@Id attribute was not found; it is required.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 10;
candle.Run();
}
示例10: RegistrySearchInvalidFormatValue
public void RegistrySearchInvalidFormatValue()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(RegistrySearchTests.TestDataDirectory, @"RegistrySearchInvalidFormatValue\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(21, "The util:RegistrySearch/@Format attribute's value, 'Column', is not one of the legal options: 'Raw', or 'Compatible'.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 21;
candle.Extensions.Add("WixUtilExtension");
candle.Run();
}
示例11: ComponentSearchInvalidGuid
public void ComponentSearchInvalidGuid()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(ComponentSearchTests.TestDataDirectory, @"ComponentSearchInvalidGuid\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(9, "The util:ComponentSearch/@Guid attribute's value, 'Not_A_Product_Guid', is not a legal guid value.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 9;
candle.Extensions.Add("WixUtilExtension");
candle.Run();
}
示例12: ComponentSearchPredefinedVariable
public void ComponentSearchPredefinedVariable()
{
string expectedErrorMessage = @"The util:ComponentSearch/@Variable attribute's value, 'ProgramFilesFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'.";
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(ComponentSearchTests.TestDataDirectory, @"ComponentSearchPredefinedVariable\Product.wxs"));
candle.OutputFile = "Setup.exe";
candle.Extensions.Add("WixUtilExtension");
candle.ExpectedWixMessages.Add(new WixMessage(348, expectedErrorMessage, Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 348;
candle.Run();
}
示例13: ComponentSearchInvalidResultValue
public void ComponentSearchInvalidResultValue()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(ComponentSearchTests.TestDataDirectory, @"ComponentSearchInvalidResultValue\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(21, "The util:ComponentSearch/@Result attribute's value, 'NotState', is not one of the legal options: 'Directory', 'State', or 'KeyPath'.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 21;
candle.Extensions.Add("WixUtilExtension");
candle.Run();
}
示例14: VariableValueMissing
public void VariableValueMissing()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(VariableTests.TestDataDirectory, @"VariableValueMissing\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(10, "The Variable/@Value attribute was not found; it is required.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 10;
candle.Run();
}
示例15: RegistrySearchInvalidRootValue
public void RegistrySearchInvalidRootValue()
{
Candle candle = new Candle();
candle.SourceFiles.Add(Path.Combine(RegistrySearchTests.TestDataDirectory, @"RegistrySearchInvalidRootValue\Product.wxs"));
candle.ExpectedWixMessages.Add(new WixMessage(21, "The util:RegistrySearch/@Root attribute's value, 'HKEY_LOCAL_MACHINE', is not one of the legal options: 'HKCR', 'HKCU', 'HKLM', or 'HKU'.", Message.MessageTypeEnum.Error));
candle.ExpectedWixMessages.Add(new WixMessage(10, "The util:RegistrySearch/@Root attribute was not found; it is required.", Message.MessageTypeEnum.Error));
candle.ExpectedExitCode = 10;
candle.Extensions.Add("WixUtilExtension");
candle.Run();
}