Click here to Skip to main content
15,886,110 members
Articles / Desktop Programming / MFC

dotNetInstaller - Setup Bootstrapper for .NET Application

Rate me:
Please Sign up or sign in to vote.
4.96/5 (87 votes)
4 Jan 2004MIT22 min read 1M   2.2K   310  
With this tool the developer can define the application prerequisites and install the correct version of these components in the correct order based on the user operating system type and language, allow the user to download these components from the web or install these components directly.
using System;
using System.Xml;
using System.ComponentModel;
using System.ComponentModel.Design;

namespace InstallerEditor
{
	/// <summary>
	/// Summary description for WebConfiguration.
	/// </summary>
	public class WebConfiguration : Configuration
	{
		public WebConfiguration():this("APPLICATION_NAME")
		{
		}

		public WebConfiguration(string p_ApplicationName):base("reference")
		{
			m_referencefile = "#TEMPPATH\\" + p_ApplicationName + "\\configuration.xml";
		}

		protected override void OnXmlWriteTagConfiguration(XmlWriterEventArgs e)
		{
			base.OnXmlWriteTagConfiguration (e);
			m_DownloadDialog.ToXml(e.XmlWriter);

			e.XmlWriter.WriteStartElement("configfile");
			e.XmlWriter.WriteAttributeString("filename",m_referencefile);
			e.XmlWriter.WriteEndElement();
		}
		protected override void OnXmlReadTagConfiguration(XmlElementEventArgs e)
		{
			base.OnXmlReadTagConfiguration (e);

			XmlElement l_downloaddialog = (XmlElement)e.XmlElement.SelectSingleNode("downloaddialog");
			if (l_downloaddialog!=null)
				m_DownloadDialog.FromXml(l_downloaddialog);


			XmlElement l_ConfigFile = (XmlElement)e.XmlElement.SelectSingleNode("configfile");
			if (l_ConfigFile != null)
			{
				if (l_ConfigFile.Attributes["filename"]!=null)
					m_referencefile = l_ConfigFile.Attributes["filename"].InnerText;
			}
		}

		private string m_referencefile; // tag: configfile/@filename;
		[Description("The configuration file where the application can find the configuration. Usually this is the destination directory of the downloaded component. Can contains path constant (see Help->Path Constant). (REQUIRED)")]
		public string referencefile
		{
			get{return m_referencefile;}
			set{m_referencefile = value;}
		}

		private DownloadDialog m_DownloadDialog = new DownloadDialog();
		[Browsable(false)]
		public DownloadDialog DownloadDialog
		{
			get{return m_DownloadDialog;}
			set{m_DownloadDialog = value;}
		}
	}
}

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, along with any associated source code and files, is licensed under The MIT License


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

Comments and Discussions