Click here to Skip to main content
15,897,226 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.
#pragma once
namespace DVLib
{

	//Equivalente di StrFormatByteSizeA (che per� non � supportata in Win95)
	//       532 -> 532 bytes
	//      1340 -> 1.3KB
	//     23506 -> 23.5KB
	//   2400016 -> 2.4MB
	//2400000000 -> 2.4GB
	inline CString FormatNumberToBytes(ULONG p_Bytes)
	{
		CString tmp;
		if (p_Bytes < 1024) //bytes
			tmp.Format("%lu", p_Bytes);
		else if (p_Bytes < (1048576) ) //Kb
			tmp.Format("%.2fKB ", (double)p_Bytes/1024.0 );
		else if (p_Bytes < (1073741824) ) //Mb
			tmp.Format("%.2fMB", (double)p_Bytes/1048576.0 );
		else if (p_Bytes < (1099511627776) ) //GB
			tmp.Format("%.2fGB", (double)p_Bytes/1073741824.0 );
		else
			tmp.Format("%lu", p_Bytes);

		return tmp;
	}
}

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