Application.cs :  » Installers-Generators » WiX » Microsoft » Tools » WindowsInstallerXml » ApplicationModel » 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 » ApplicationModel » Application.cs
//-------------------------------------------------------------------------------------------------
// <copyright file="Application.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>
// The Application model for WiX.
// </summary>
//-------------------------------------------------------------------------------------------------

namespace Microsoft.Tools.WindowsInstallerXml.ApplicationModel{
    using System;
    using System.Collections;
    using System.IO;
    using System.Text;
    using System.Threading;
    using System.Xml;
    using System.Xml.Serialization;
    using Microsoft.Tools.WindowsInstallerXml.Serialize;

    /// <summary>
    /// Base class for application. Contains a WiX root element.
    /// </summary>
    public class Application
    {
        private Wix wixRoot;
        private Product product;
        private Package package;

        /// <summary>
        /// Creates a new Application object.
        /// </summary>
        public Application()
        {
            this.wixRoot = new Wix();
            this.product = new Product();
            this.wixRoot.AddChild(this.product);
            this.package = new Package();
            this.package.Id = "????????-????-????-????-????????????";
            this.package.Compressed = Microsoft.Tools.WindowsInstallerXml.Serialize.YesNoType.yes;
            this.package.InstallerVersion = 200;
            this.product.AddChild(this.package);
        }

        /// <summary>
        /// Gets or sets the Description for this Application.
        /// </summary>
        /// <value>The Description for this Application.</value>
        public string Description
        {
            get { return this.package.Description; }
            set { this.package.Description = value; }
        }

        /// <summary>
        /// Gets or sets the Manufacturer for this Application.
        /// </summary>
        /// <value>The Manufacturer for this Application.</value>
        public string Manufacturer
        {
            get { return this.package.Manufacturer; }
            set { this.package.Manufacturer = value; }
        }

        /// <summary>
        /// Gets or sets the Name for this Application.
        /// </summary>
        /// <value>The Name for this Application.</value>
        public string Name
        {
            get { return this.product.Name; }
            set { this.product.Name = value; }
        }

        /// <summary>
        /// Gets or sets the UpgradeCode for this Application.
        /// </summary>
        /// <value>The UpgradeCode for this Application.</value>
        public string UpgradeCode
        {
            get { return this.product.UpgradeCode; }
            set { this.product.UpgradeCode = value; }
        }

        /// <summary>
        /// Gets or sets the Version for this Application.
        /// </summary>
        /// <value>The Version for this Application.</value>
        public string Version
        {
            get { return this.product.Version; }
            set { this.product.Version = value; }
        }

        /// <summary>
        /// Gets the root serialized WiX element.
        /// </summary>
        /// <value>The root serialized WiX element.</value>
        public Wix WixRoot
        {
            get { return this.wixRoot; }
        }

        /// <summary>
        /// Gets the product element.
        /// </summary>
        /// <value>The product element.</value>
        public Product Product
        {
            get { return this.product; }
        }

        /// <summary>
        /// Gets the package element.
        /// </summary>
        /// <value>The package element.</value>
        public Package Package
        {
            get { return this.package; }
        }

        /// <summary>
        /// Adds resources representing the filesystem subtree from path on down. Path is an 
        /// absolute filesystem path.
        /// </summary>
        /// <param name="path">Path from which to start scraping.</param>
        /// <returns>The scraped directory.</returns>
        public static Serialize.Directory ScrapeFileSystem(string path)
        {
            return FileSystemScraper.ScrapeFileSystem(path);
        }

        /// <summary>
        /// Serializes this application out to WiX.
        /// </summary>
        /// <param name="filePath">Path to the output file.</param>
        public void Serialize(string filePath)
        {
            XmlTextWriter writer = new XmlTextWriter(filePath, Encoding.UTF8);
            writer.Formatting = Formatting.Indented;
            this.wixRoot.OutputXml(writer);
            writer.Close();
        }
    }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.