Click here to Skip to main content
15,888,590 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;

namespace InstallerEditor
{
	/// <summary>
	/// Tag installedcheck
	/// </summary>
	public class installedcheck
	{
		public installedcheck(string p_type)
		{
			m_type = p_type;
		}

		#region Attributi
		private string m_type; //can be check_registry_value or check_file
		[Description("Type of the check, can be 'check_registry_value' to check for a specific value in the registry or 'check_file' to check for a specific file. (REQUIRED)")]
		public string type
		{
			get{return m_type;}
		}
		#endregion

//		protected void OnDescriptionChanged()
//		{
//			if (DescriptionChanged!=null)
//				DescriptionChanged(this,EventArgs.Empty);
//		}
//
//		public event EventHandler DescriptionChanged;
//

		#region IXmlClass Members

		public void ToXml(XmlWriter p_Writer)
		{
			p_Writer.WriteStartElement("installedcheck");
				p_Writer.WriteAttributeString("type", m_type);
				OnXmlWriteTaginstalledcheck(new XmlWriterEventArgs(p_Writer));
			p_Writer.WriteEndElement();
		}

		public void FromXml(XmlElement p_Element)
		{
			if (p_Element.Attributes["type"] == null ||
				p_Element.Attributes["type"].InnerText != m_type)
				throw new ApplicationException("Invalid type");

			OnXmlReadTaginstalledcheck(new XmlElementEventArgs(p_Element));
		}
		#endregion

		protected virtual void OnXmlWriteTaginstalledcheck(XmlWriterEventArgs e)
		{
		}
		protected virtual void OnXmlReadTaginstalledcheck(XmlElementEventArgs e)
		{
		}

	}

	public enum installcheck_comparison
	{
		match,
		version
	}
}

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