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

namespace DVLib
{
	// ==========================================================================
	// ExecCmd()
	//
	// Purpose:
	//  Executes command-line
	// Inputs:
	//  LPCTSTR pszCmd: command to run
	// Notes: This routine does a CreateProcess on the input cmd-line
	// Outputs:True is succedeed othrwise false
	// ==========================================================================
	inline bool ExecCmd( LPCTSTR pszCmd, PROCESS_INFORMATION * process_info)
	{
		BOOL  bReturnVal   = false ;
		STARTUPINFO  si ;

		ZeroMemory(&si, sizeof(si)) ;
		si.cb = sizeof(si) ;

		bReturnVal = CreateProcess(NULL, 
								(LPTSTR)pszCmd, 
								NULL, 
								NULL, 
								FALSE, 
								0, 
								NULL, 
								NULL, 
								&si, 
								process_info) ;

		if (bReturnVal)
		{
			return true;
		}
		else
		{
			return false;
		}
	}


	// ==========================================================================
	// ExecCmd()
	//
	// Purpose:
	//  Executes command-line
	// Inputs:
	//  LPCTSTR pszCmd: command to run
	// p_ExitCodes :  exit code from the command
	// Notes: This routine does a CreateProcess on the input cmd-line
	//        and waits for the launched process to exit.
	// Check ERROR_SUCCESS_REBOOT_REQUIRED a reboot is required.
	// Outputs:True is succedeed othrwise false
	// ==========================================================================
	inline bool ExecCmdAndWait( LPCTSTR pszCmd , DWORD * p_ExitCodes)
	{
		BOOL  bReturnVal   = false ;
		STARTUPINFO  si ;
		DWORD  dwExitCode ;
		SECURITY_ATTRIBUTES saProcess, saThread ;
		PROCESS_INFORMATION process_info ;

		ZeroMemory(&si, sizeof(si)) ;
		si.cb = sizeof(si) ;

		saProcess.nLength = sizeof(saProcess) ;
		saProcess.lpSecurityDescriptor = NULL ;
		saProcess.bInheritHandle = TRUE ;

		saThread.nLength = sizeof(saThread) ;
		saThread.lpSecurityDescriptor = NULL ;
		saThread.bInheritHandle = FALSE ;

		bReturnVal = CreateProcess(NULL, 
								(LPTSTR)pszCmd, 
								&saProcess, 
								&saThread, 
								FALSE, 
								DETACHED_PROCESS, 
								NULL, 
								NULL, 
								&si, 
								&process_info) ;

		if (bReturnVal)
		{
			CloseHandle( process_info.hThread ) ;
			WaitForSingleObject( process_info.hProcess, INFINITE ) ;
			GetExitCodeProcess( process_info.hProcess, &dwExitCode ) ;
			CloseHandle( process_info.hProcess ) ;

			*p_ExitCodes = dwExitCode;
		}
		else
		{
			return false;
		}

		return true;
	}
}

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