Light.cs :  » Installers-Generators » WiX » Microsoft » Tools » WindowsInstallerXml » Test » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Installers Generators » WiX 
WiX » Microsoft » Tools » WindowsInstallerXml » Test » Light.cs
//-----------------------------------------------------------------------
// <copyright file="Light.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
//    
//    The use and distribution terms for this software are covered by the
//    Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
//    which can be found in the file CPL.TXT at the root of this distribution.
//    By using this software in any fashion, you are agreeing to be bound by
//    the terms of this license.
//    
//    You must not remove this notice, or any other, from this software.
// </copyright>
// <summary>A class that wraps Light</summary>
//-----------------------------------------------------------------------

namespace Microsoft.Tools.WindowsInstallerXml.Test{
    using System;
    using System.IO;

    /// <summary>
    /// A class that wraps Light
    /// </summary>
    public partial class Light : WixTool
    {
        /// <summary>
        /// Constructor that uses the current directory as the working directory
        /// </summary>
        public Light()
            : this(String.Empty)
        {
        }

        /// <summary>
        /// Constructor that uses the default WiX tool directory as the tools location
        /// </summary>
        /// <param name="workingDirectory">The working directory of the tool</param>
        public Light(string workingDirectory)
            : base("light.exe", workingDirectory)
        {
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="toolDirectory">The directory of the tool</param>
        /// <param name="workingDirectory">The working directory of the tool</param>
        public Light(string toolDirectory, string workingDirectory)
            : base(toolDirectory, "light.exe", workingDirectory)
        {
        }

        /// <summary>
        /// Constructor that uses data from a Candle object to create a Light object
        /// </summary>
        /// <param name="candle">A Candle object</param>
        public Light(Candle candle)
            : this(candle, false)
        {
        }

        /// <summary>
        /// Constructor that uses data from a Candle object to create a Light object
        /// </summary>
        /// <param name="candle">A Candle object</param>
        /// <param name="xmlOutput">False if Light should build an MSI. True if Light should build a wixout.</param>
        public Light(Candle candle, bool xmlOutput)
            : this(Path.GetDirectoryName(candle.ToolFile), candle.WorkingDirectory)
        {
            // The output of Candle is the input for Light
            this.ObjectFiles = candle.ExpectedOutputFiles;

            string outputFileExtension = ".msi";
            if (xmlOutput)
            {
                this.XmlOutput = true;
                outputFileExtension = ".wixout";
            }

            // If Candle has only one input file, use that file name for Light's output file
            if (null != candle.ExpectedOutputFiles && 1 == candle.ExpectedOutputFiles.Count)
            {
                string outputFileName = String.Concat(Path.GetFileNameWithoutExtension(candle.ExpectedOutputFiles[0]), outputFileExtension);
                this.OutputFile = Path.Combine(candle.OutputDirectory, outputFileName);
            }
            else
            {
                string outputFileName = String.Concat("product", outputFileExtension);
                this.OutputFile = Path.Combine(candle.OutputDirectory, outputFileName);
            }
        }

        /// <summary>
        /// Constructor that uses data from a Lit object to create a Light object
        /// </summary>
        /// <param name="candle">A Lit object</param>
        public Light(Lit lit)
            : this(Path.GetDirectoryName(lit.ToolFile), lit.WorkingDirectory)
        {
            // The output of Lit is the input for Light
            this.ObjectFiles.Add(lit.ExpectedOutputFile);
            string outputFileName = String.Concat(Path.GetFileNameWithoutExtension(lit.ExpectedOutputFile), ".msi");
            this.OutputFile = Path.Combine(Path.GetDirectoryName(lit.ExpectedOutputFile), outputFileName);
        }

        /// <summary>
        /// Functional name of the tool
        /// </summary>
        public override string ToolDescription
        {
            get { return "Linker"; }
        }
    }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.