当前位置: 首页>>代码示例>>C#>>正文


C# Light.Run方法代码示例

本文整理汇总了C#中Light.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Light.Run方法的具体用法?C# Light.Run怎么用?C# Light.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Light的用法示例。


在下文中一共展示了Light.Run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DuplicateLayoutDirectoryRef

        public void DuplicateLayoutDirectoryRef()
        {
            string candleOutput = Candle.Compile(Path.Combine(LayoutTests.TestDataDirectory, @"DuplicateLayoutDirectoryRef\Product.wxs"));

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(130, "The primary key 'LayoutDirectory1/LayoutDirectory2' is duplicated in table 'WixLayoutDirRef'.  Please remove one of the entries or rename a part of the primary key to avoid the collision.", Message.MessageTypeEnum.Error)); //Unresolved reference to symbol error
            light.ExpectedExitCode = 130;
            light.Run();
        }
开发者ID:zooba,项目名称:wix3,代码行数:11,代码来源:Bundle.LayoutTests.cs

示例2: MissingPayloadGroupRef

        public void MissingPayloadGroupRef()
        {
            string candleOutput = Candle.Compile(Path.Combine(PayloadTests.TestDataDirectory, @"MissingPayloadGroupRef\Product.wxs"));

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(94, Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 94;
            light.Run();
        }
开发者ID:bleissem,项目名称:wix3,代码行数:11,代码来源:Bundle.PayloadTests.cs

示例3: DuplicateLayoutDirectory

        public void DuplicateLayoutDirectory()
        {
            string candleOutput = Candle.Compile(Path.Combine(LayoutTests.TestDataDirectory, @"DuplicateLayoutDirectory\Product.wxs"));

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(91, "Duplicate symbol 'WixLayoutDirectory:LayoutDirectory1' found.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(92, "Location of symbol related to previous error.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 92;
            light.Run();
        }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:12,代码来源:Bundle.LayoutTests.cs

示例4: ComponentSearchAfterUndefinedSearch

        public void ComponentSearchAfterUndefinedSearch()
        {
            string sourceFile = Path.Combine(ComponentSearchTests.TestDataDirectory, @"ComponentSearchAfterUndefinedSearch\Product.wxs");
            string[] candleOutputs = Candle.Compile(sourceFiles: new string[] { sourceFile }, extensions: new string[] { "WixUtilExtension" });

            Light light = new Light();
            light.ObjectFiles.AddRange(candleOutputs);
            light.OutputFile = "Setup.exe";
            light.Extensions.Add("WixUtilExtension");
            light.ExpectedWixMessages.Add(new WixMessage(94, Message.MessageTypeEnum.Error));  //  Unresolved reference to symbol 'WixSearch:UndefinedSearch'
            light.ExpectedExitCode = 94;
            light.Run();
        }
开发者ID:zooba,项目名称:wix3,代码行数:13,代码来源:Bundle.ComponentSearchTests.cs

示例5: DuplicateProductSearch

        public void DuplicateProductSearch()
        {
            string sourceFile = Path.Combine(ProductSearchTests.TestDataDirectory, @"DuplicateProductSearch\Product.wxs");
            string[] candleOutputs = Candle.Compile(sourceFiles: new string[] { sourceFile }, extensions: new string[] { "WixUtilExtension" });

            Light light = new Light();
            light.ObjectFiles.AddRange(candleOutputs);
            light.OutputFile = "Setup.exe";
            light.Extensions.Add("WixUtilExtension");
            light.ExpectedWixMessages.Add(new WixMessage(91, Message.MessageTypeEnum.Error));  //  duplicate symbol error
            light.ExpectedWixMessages.Add(new WixMessage(92, Message.MessageTypeEnum.Error));  //  Location of symbol related to previous error.
            light.ExpectedExitCode = 92;
            light.IgnoreWixMessageOrder = true;
            light.Run();
        }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:15,代码来源:Bundle.ProductSearchTests.cs

示例6: 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");
        }
开发者ID:bleissem,项目名称:wix3,代码行数:21,代码来源:ExampleTests.cs

示例7: PackageRecursiveAfter

        public void PackageRecursiveAfter()
        {
            string sourceFile = Path.Combine(PackageTests.TestDataDirectory, @"PackageRecursiveAfter\Product.wxs");
            string candleOutput = Candle.Compile(sourceFile);

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "Setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(343, "A circular reference of ordering dependencies was detected. The infinite loop includes: Package:MsuPackage -> Package:MspPackage -> Package:MsuPackage. Ordering dependency references must form a directed acyclic graph.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(343, "A circular reference of ordering dependencies was detected. The infinite loop includes: Package:MspPackage -> Package:ExePackage -> Package:MspPackage. Ordering dependency references must form a directed acyclic graph.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(343, "A circular reference of ordering dependencies was detected. The infinite loop includes: Package:MspPackage -> Package:MsiPackage -> Package:MspPackage. Ordering dependency references must form a directed acyclic graph.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(343, "A circular reference of ordering dependencies was detected. The infinite loop includes: Package:MsiPackage -> Package:MsuPackage -> Package:MsiPackage. Ordering dependency references must form a directed acyclic graph.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(343, Message.MessageTypeEnum.Error));
            light.IgnoreWixMessageOrder = true;
            light.ExpectedExitCode = 343;
            light.Run();
        }
开发者ID:zooba,项目名称:wix3,代码行数:17,代码来源:Bundle.PackageTests.cs

示例8: RecursiveLayoutDirectoryRef

        public void RecursiveLayoutDirectoryRef()
        {
            string candleOutput = Candle.Compile(Path.Combine(LayoutTests.TestDataDirectory, @"RecursiveLayoutDirectoryRef\Product.wxs"));

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(332, @"A circular reference of layout directories was detected. The infinite loop includes: OutputDirectory1 and OutputDirectory2. layout directories references must form a directed acyclic graph.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 332;
            light.Run();
        }
开发者ID:Jeremiahf,项目名称:wix3,代码行数:11,代码来源:Bundle.LayoutTests.cs

示例9: PackageInvalidSourceFile

        public void PackageInvalidSourceFile()
        {
            string sourceFile = Path.Combine(PackageTests.TestDataDirectory, @"PackageInvalidSourceFile\Product.wxs");
            string candleOutput = Candle.Compile(sourceFile);

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "Setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(300, @"Illegal characters in path 'MsiPackage|*?.msi'. Ensure you provided a valid path to the file.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 300;
            light.Run();
        }
开发者ID:zooba,项目名称:wix3,代码行数:12,代码来源:Bundle.PackageTests.cs

示例10: PackageNonexistingSourceFile

        public void PackageNonexistingSourceFile()
        {
            string sourceFile = Path.Combine(PackageTests.TestDataDirectory, @"PackageNonexistingSourceFile\Product.wxs");
            string candleOutput = Candle.Compile(sourceFile);

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "Setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(352, string.Format(@"Unable to read package '{0}'. This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.", Path.Combine(BundleTests.BundleSharedFilesDirectory, @"Packages\NonExisitingMsiPackage.msi")), Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(352, string.Format(@"Unable to read package '{0}'. This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.", Path.Combine(BundleTests.BundleSharedFilesDirectory, @"Packages\NonExisitingMspPackage.msp")), Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(352, string.Format(@"Unable to read package '{0}'. Could not find file '{0}'.", Path.Combine(BundleTests.BundleSharedFilesDirectory, @"Packages\NonExisitingMsuPackage.msu")), Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(352, string.Format(@"Unable to read package '{0}'. Could not find file '{0}'.", Path.Combine(BundleTests.BundleSharedFilesDirectory, @"Packages\NonExisitingExePackage.exe")), Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 352;
            light.Run();
        }
开发者ID:zooba,项目名称:wix3,代码行数:15,代码来源:Bundle.PackageTests.cs

示例11: MspPackageInvalidMsp

        public void MspPackageInvalidMsp()
        {
            string sourceFile = Path.Combine(PackageTests.TestDataDirectory, @"MspPackageInvalidMsp\Product.wxs");
            string errorMessage = string.Format(@"Unable to read package '{0}'. This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.", BundleTests.ExePackageFile);
            string candleOutput = Candle.Compile(sourceFile);

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "Setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(352, errorMessage, Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 352;
            light.Run();
        }
开发者ID:zooba,项目名称:wix3,代码行数:13,代码来源:Bundle.PackageTests.cs

示例12: PackageAfterUndefinedPackage

        public void PackageAfterUndefinedPackage()
        {
            string sourceFile = Path.Combine(PackageTests.TestDataDirectory, @"PackageAfterUndefinedPackage\Product.wxs");
            string candleOutput = Candle.Compile(sourceFile);

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "Setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(344, "An expected identifier ('UndefinedMsiPackage', of type 'Package') was not found.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(344, "An expected identifier ('UndefinedMspPackage', of type 'Package') was not found.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(344, "An expected identifier ('UndefinedMsuPackage', of type 'Package') was not found.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(344, "An expected identifier ('UndefinedExePackage', of type 'Package') was not found.", Message.MessageTypeEnum.Error));
            light.IgnoreWixMessageOrder = true;
            light.ExpectedExitCode = 344;
            light.Run();
        }
开发者ID:zooba,项目名称:wix3,代码行数:16,代码来源:Bundle.PackageTests.cs

示例13: DuplicateMsiProperty

        public void DuplicateMsiProperty()
        {
            string sourceFile = Path.Combine(PackageTests.TestDataDirectory, @"DuplicateMsiProperty\Product.wxs");
            string candleOutput = Candle.Compile(sourceFile);

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "Setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(91, Message.MessageTypeEnum.Error)); // Duplicate symbol error
            light.ExpectedWixMessages.Add(new WixMessage(92, Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 92;
            light.Run();
        }
开发者ID:zooba,项目名称:wix3,代码行数:13,代码来源:Bundle.PackageTests.cs

示例14: MsiPackageInuse

        public void MsiPackageInuse()
        {
            // acquire a loc on the file
            string outputDirectory = this.TestContext.TestDirectory;
            string testFileName = Path.Combine(outputDirectory, "MsiPackage.msi");
            File.Copy(BundleTests.MsiPackageFile, testFileName);
            FileStream msiPackage = File.Open(testFileName, FileMode.Open, FileAccess.Read);

            string errorMessage = string.Format(@"Unable to read package '{0}'. This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.", testFileName);
            string sourceFile = Path.Combine(PackageTests.TestDataDirectory, @"MsiPackageInuse\Product.wxs");
            string candleOutput = Candle.Compile(sourceFile);

            Light light = new Light(outputDirectory);
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "Setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(352, errorMessage, Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 352;
            light.Run();

            // release lock
            msiPackage.Close();
        }
开发者ID:zooba,项目名称:wix3,代码行数:22,代码来源:Bundle.PackageTests.cs

示例15: PayloadGroupDuplicatePayloadGroupRefs

        public void PayloadGroupDuplicatePayloadGroupRefs()
        {
            string candleOutput = Candle.Compile(Path.Combine(PayloadTests.TestDataDirectory, @"PayloadGroupDuplicatePayloadGroupRefs\Product.wxs"));

            Light light = new Light();
            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(343, Message.MessageTypeEnum.Error)); // Circular reference error
            light.ExpectedExitCode = 343;
            light.IgnoreWixMessageOrder = true;
            light.Run();
        }
开发者ID:bleissem,项目名称:wix3,代码行数:12,代码来源:Bundle.PayloadTests.cs


注:本文中的Light.Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。