Click here to Skip to main content
15,892,746 members
Articles / Web Development / ASP.NET

A WIX web setup

Rate me:
Please Sign up or sign in to vote.
2.05/5 (8 votes)
9 May 20074 min read 71.9K   856   26  
Create WIX web setup using VS2005 and Wix 3.0
#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using System.Reflection;
using System.Diagnostics;
using System.Configuration;
using System.Net;
using System.Security.AccessControl;
using System.Security.Principal;

using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
#endregion

namespace Djans.ComponentWriter
{
    /// <summary>
    /// Starts when ComponentWriter is used as Task
    /// </summary>
    public class ComponentWriterTask : Task
    {
        #region Private members

        private string m_SourceDirectory;
        private string m_OutputFile;
        private string m_UgradeFile;

        #endregion

        #region Public properties

        [Required]
        public string SourceDirectory
        {
            get { return m_SourceDirectory; }
            set { m_SourceDirectory = value; }
        }
        [Required]
        public string OutputFile
        {
            get { return m_OutputFile; }
            set { m_OutputFile = value; }
        }

        [Required]
        public string UgradeFile
        {
            get { return m_UgradeFile; }
            set { m_UgradeFile = value; }
        }

        #endregion

        public override bool Execute()
        {
            ComponentWriterConfig config = new ComponentWriterConfig();
            config.SourceDirectory = this.SourceDirectory;
            config.OutputFile = this.OutputFile;
            config.UgradeFile = this.UgradeFile;
            if (string.IsNullOrEmpty(config.SourceDirectory)
                || string.IsNullOrEmpty(config.OutputFile)
                || string.IsNullOrEmpty(config.UgradeFile))
            {
                return false;
            }

            try
            {
                // Do the actual writing
                ComponentWriter componentWriter = new ComponentWriter();
                return componentWriter.Write(config);
            }
            catch
            {
                return false;
            }
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions