Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

dotNetInstaller - Setup Bootstrapper for .NET Application

, 4 Jan 2004
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.
dotnetinstaller_source.zip
dotNetInstaller_source
dotNetInstaller
dotNetInstaller.vcproj.vspscc
dotNetInstaller.vssscc
mssccprj.scc
res
banner.bmp
dotNetInstaller.ico
dotNetInstaller.manifest
Thumbs.db
vssver.scc
Tools
vssver.scc
vssver.scc
InstallerEditor
App.ico
banner.bmp
bin
Release
InstallerEditor.exe
SourceLibrary.dll
vssver.scc
InstallerEditor.csproj.user
InstallerEditor.csproj.vspscc
InstallerEditor.suo
InstallerEditor.vssscc
mssccprj.scc
References
SourceLibrary.dll
vssver.scc
Thumbs.db
vssver.scc
Sample
banner.bmp
dotNetInstaller.exe
SupportFiles
DataAccess
Jet
Jet40Sp7
Win2000_English
Win2000_Italiano
Win9x_NT
WinME
WinXp_English
WinXp_Italiano
MDAC2.7Sp1Refresh
Win_98_ME_NT_2000
dotNet
v1.1
English
Italiano
InternetExplorer
IE60SP1_English
IE60SP1_Italiano
ServicePack
2000_SP4_English
2000_SP4_Italiano
NT4_SP6a_English
NT4_SP6a_Italiano
Win98_Y2k_Update_English
Win98_Y2k_Update_Italiano
using System;
using System.Xml;

namespace InstallerEditor
{
	/// <summary>
	/// Summary description for ConfigFile.
	/// </summary>
	public class ConfigFile
	{
		public ConfigFile()
		{
		}

		private string m_FileName = null;
		public string FileName
		{
			get{return m_FileName;}
			set{m_FileName = value;}
		}

		public void Save()
		{
			if (m_FileName==null)
				throw new ApplicationException("Invalid save filename");

			SaveAs(m_FileName);
		}

		public void SaveAs(string p_FileName)
		{
			XmlTextWriter l_XmlWriter = new XmlTextWriter(p_FileName, System.Text.Encoding.ASCII);
			try
			{
				l_XmlWriter.Formatting = Formatting.Indented;
				
				l_XmlWriter.WriteStartElement("configurations");
				foreach (Configuration c in Configurations)
				{
					c.ToXml(l_XmlWriter);
				}
				l_XmlWriter.WriteEndElement();

				m_FileName = p_FileName;
			}
			finally
			{
				l_XmlWriter.Close();
			}
		}

		public void Create(string p_FileName)
		{
			m_FileName = p_FileName;
		}


		public void Load(string p_FileName)
		{
			XmlDocument l_XmlElement = new XmlDocument();
			l_XmlElement.Load(p_FileName);

			XmlNodeList l_List = l_XmlElement.SelectNodes("//configurations/configuration");
			foreach(XmlElement l_Element in l_List)
			{
				string l_Type = l_Element.Attributes["type"].InnerText.ToLower();
				Configuration l_Config;
				if (l_Type == "install")
					l_Config = new SetupConfiguration();
				else if (l_Type == "reference")
					l_Config = new WebConfiguration();
				else
					throw new ApplicationException("Invalid type");

				l_Config.FromXml(l_Element);

				Configurations.Add(l_Config);
			}
			
			m_FileName = p_FileName;
		}

		private ConfigurationCollection m_Configurations = new ConfigurationCollection();

		[System.ComponentModel.Browsable(false)]
		public ConfigurationCollection Configurations
		{
			get{return m_Configurations;}
			set{m_Configurations = value;}
		}
	}

	public interface IXmlClass
	{
		void ToXml(XmlWriter p_Writer);
		void FromXml(XmlElement p_Element);
	}

	public class XmlWriterEventArgs : EventArgs
	{
		public XmlWriterEventArgs(XmlWriter p_Writer)
		{
			m_Writer = p_Writer;
		}
		private XmlWriter m_Writer;
		public XmlWriter XmlWriter
		{
			get{return m_Writer;}
		}
	}

	public delegate void XmlWriterEventHandler(object sender, XmlWriterEventArgs e);

	public class XmlElementEventArgs : EventArgs
	{
		public XmlElementEventArgs(XmlElement p_XmlElement)
		{
			m_XmlElement = p_XmlElement;
		}
		private XmlElement m_XmlElement;
		public XmlElement XmlElement
		{
			get{return m_XmlElement;}
		}
	}

	public delegate void XmlElementEventHandler(object sender, XmlElementEventArgs e);

	public class ConfigFileEventArgs : EventArgs
	{
		public ConfigFileEventArgs(ConfigFile p_Config)
		{
			m_ConfigFile = p_Config;
		}

		private ConfigFile m_ConfigFile;
		public ConfigFile ConfigFile
		{
			get{return m_ConfigFile;}
			set{m_ConfigFile = value;}
		}
	}

	public delegate void ConfigFileEventHandler(object sender, ConfigFileEventArgs e);

	public class ConfigFileFileEventArgs : ConfigFileEventArgs
	{
		public ConfigFileFileEventArgs(string p_FileName, ConfigFile p_Config):base(p_Config)
		{
			m_FileName = p_FileName;
		}

		private string m_FileName;
		public string FileName
		{
			get{return m_FileName;}
			set{m_FileName = value;}
		}
	}

	public delegate void ConfigFileFileEventHandler(object sender, ConfigFileFileEventArgs e);

	public class ConfigFileXmlWriterEventArgs : ConfigFileFileEventArgs
	{
		public ConfigFileXmlWriterEventArgs(XmlWriter p_XmlWriter, string p_FileName, ConfigFile p_Config):base(p_FileName, p_Config)
		{
			m_XmlWriter = p_XmlWriter;
		}

		private XmlWriter m_XmlWriter;
		public XmlWriter XmlWriter
		{
			get{return m_XmlWriter;}
			set{m_XmlWriter = value;}
		}
	}

	public delegate void ConfigFileXmlWriterEventHandler(object sender, ConfigFileXmlWriterEventArgs e);

	public class ConfigFileXmlElementEventArgs : ConfigFileFileEventArgs
	{
		public ConfigFileXmlElementEventArgs(XmlElement p_XmlElement, string p_FileName, ConfigFile p_Config):base(p_FileName, p_Config)
		{
			m_XmlElement = p_XmlElement;
		}

		private XmlElement m_XmlElement;
		public XmlElement XmlElement
		{
			get{return m_XmlElement;}
			set{m_XmlElement = value;}
		}
	}

	public delegate void ConfigFileXmlElementEventHandler(object sender, ConfigFileXmlElementEventArgs e);

}

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

Share

About the Author

Davide Icardi
Software Developer
Italy Italy
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.140821.2 | Last Updated 5 Jan 2004
Article Copyright 2003 by Davide Icardi
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid