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

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
#pragma once

namespace DVLib
{
	inline bool FileExists(LPCTSTR filename)
	{
		HANDLE l_hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
		if (l_hFile == INVALID_HANDLE_VALUE)
			return false;
		else
		{
			CloseHandle(l_hFile);
			return true;
		}
	}

	//Return the file name of a specified file path.
	// es. GetFileNameFromFullFilePath("c:\temp\pippo.txt") == "pippo.txt"
	// es. GetFileNameFromFullFilePath("http:\\temp\pippo.txt") == "pippo.txt"
	// Path Separators: \ or /
	inline CString GetFileNameFromFullFilePath(LPCTSTR p_FileFullPath)
	{
		CString l_FullPath = p_FileFullPath;

		//trovo l'ultimo backslash
		int l_PosFind = -1;
		for (int i = l_FullPath.GetLength()-1; i >= 0; i--)
		{
			if (l_FullPath.GetAt(i) == '\\' || l_FullPath.GetAt(i) == '/')
			{
				l_PosFind = i;
				break;
			}
		}

		CString tmp;
		if (l_PosFind == -1) //separatore non trovato
			tmp = l_FullPath;
		else if ((l_PosFind+1) >= l_FullPath.GetLength()) //il separatore � l'ultimo carattere
			tmp = "";
		else
			tmp = l_FullPath.Mid(l_PosFind+1,l_FullPath.GetLength()-l_PosFind);

		return tmp;
	}

	//Return the path of a specified file path (without the last path separator).
	// es. GetPathFromFullFilePath("c:\temp\pippo.txt") == "c:\temp"
	// es. GetPathFromFullFilePath("http:\\temp\pippo.txt") == "http:\\temp"
	// Path Separators: \ or /
	inline CString GetPathFromFullFilePath(LPCTSTR p_FileFullPath)
	{
		CString l_FullPath = p_FileFullPath;

		//trovo l'ultimo backslash
		int l_PosFind = -1;
		for (int i = l_FullPath.GetLength()-1; i >= 0; i--)
		{
			if (l_FullPath.GetAt(i) == '\\' || l_FullPath.GetAt(i) == '/')
			{
				l_PosFind = i;
				break;
			}
		}

		CString tmp;
		if (l_PosFind == -1)
			tmp = "";
		else
			tmp = l_FullPath.Mid(0,l_PosFind);

		return tmp;
	}

	//Concatenates two strings that represent properly formed paths into one path
	// Non uso PathCombine perch� non � presente in Win95
	inline CString PathCombineCustom(LPCTSTR p_Path1, LPCTSTR p_Path2, char p_separator = '\\')
	{
		CString l_Path1 = p_Path1;
		CString l_Path2 = p_Path2;

		if (l_Path1.GetLength() > 0)
		{
			int l_End = l_Path1.GetLength()-1;

			//verifico se � gi� presente un separatore
			if (l_Path1.GetAt(l_End) == '\\' || l_Path1.GetAt(l_End) == '/')
				return (l_Path1 + l_Path2);
			else //aggiungo il separatore 
			{
				CString tmp = l_Path1;
				tmp += p_separator;
				tmp += l_Path2;
				return tmp;
			}
		}
		else
			return (l_Path1 + l_Path2);
	}
}

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
Web01 | 2.8.140916.1 | Last Updated 5 Jan 2004
Article Copyright 2003 by Davide Icardi
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid