Click here to Skip to main content
15,881,882 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.
#include "DownloadDialogSupport.h"

namespace DVLib
{
	UINT DownloadComponents(IDownloadCallback * p_Callback)
	{
		CString l_tmpLastComponent = "-";
		try
		{
			DownloadComponentInfoVector * l_List = p_Callback->GetComponents();
			for (int i = 0; i < l_List->GetCount(); i++)
			{
				//verifico se l'utente ha premuto cancel
				if (p_Callback->WantToStop())
				{
					p_Callback->CanceledByTheUser();
					return 0;
				}

				l_tmpLastComponent = l_List->GetAt(i).ComponentName;

				//Download del componente
				DownloadComponent l_Component(p_Callback, &(l_List->GetAt(i)), i+1, (int)l_List->GetCount() );
				l_Component.StartDownload();


				//verifico se l'utente ha premuto cancel
				if (l_Component.IsCanceledByTheUser())
				{
					p_Callback->CanceledByTheUser();
					return 0;
				}
			}

			p_Callback->DownloadComplete();
		}
		catch(...)
		{
			try
			{
				CString tmp = "Failed to download component: ";
				tmp += l_tmpLastComponent;
				p_Callback->DownloadError(tmp);
			}
			catch(...)
			{
				_ASSERT(false);
			}
		}

		return 0;
	}

	UINT DownloadComponentsThread( LPVOID pParam )
	{
		return DownloadComponents((IDownloadCallback*)pParam);
	}
}

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