Click here to Skip to main content
11,645,889 members (74,847 online)
Click here to Skip to main content
Articles » Languages » C++ / CLI » General » Downloads
Add your own
alternative version

Enhanced .NET Bootstrap Setup

, 24 Nov 2005 514.8K 7K 134
Modified Microsoft Setup program to install required IE6, MSI 2.0 and .NET.
dotnetsetup_exe.zip
setup.exe
settings.ini
dotnetsetup_src.zip
CSingleInstance.hxx
settings.ini
// 
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
/// ==========================================================================
// Name    :    CSettings.h
// Purpose :    simple wrapper class for handling app
//              settings by means of an .ini     

#ifndef SETTINGS_H
#define SETTINGS_H

#include <windows.h>
#include <tchar.h>

//defines
//
#define EMPTY_BUFFER  { _T( '\0' ) }
#define END_OF_STRING   _T( '\0' )
#define BACKSLASH       _T( '\\' )

#define MAX_MSG 4096

const TCHAR g_szSettingsFile[]         = _T("settings.ini");
const TCHAR g_szBootstrap[]            = _T("Bootstrap");
const TCHAR g_szMsiKey[]               = _T("Msi");
const TCHAR g_szProductNameKey[]       = _T("ProductName");
const TCHAR g_szDialogTextKey[]        = _T("DialogText");
const TCHAR g_szLanguageDirectoryKey[] = _T("LanguageDirectory");
const TCHAR g_szCaptionTextKey[]       = _T("CaptionText");
const TCHAR g_szErrorCaptionTextKey[]  = _T("ErrorCaptionText");
const TCHAR g_szFxInstallerPathKey[]	= _T("FxInstallerPath");
const TCHAR g_szMSIInstallerPathKey[]   = _T("MSIInstallerPath");
const TCHAR g_szIEInstallerPathKey[]	= _T("IEInstallerPath");
const TCHAR g_szNetVersionKey[]			= _T(".NetVersion");
const TCHAR g_szMDACInstallerPathKey[]	= _T("MDACInstallerPath");
const TCHAR g_szMSDEInstallerPathKey[]	= _T("MSDEInstallerPath");
const TCHAR g_szMSDEParamKey[]			= _T("MSDEParams");
const TCHAR g_szMDACVersionKey[]		= _T("MDACVersion");
const TCHAR g_szFxInstallerOptionsKey[] = _T("FxInstallerOptions");
const TCHAR g_szFxServicePackKey[] = _T("FxServicePack");
const TCHAR g_szExtraProgramPath1Key[] = _T("ExtraProgramPath1");
const TCHAR g_szExtraProgramParams1Key[] = _T("ExtraProgramParams1");


const TCHAR g_szEnuDirectory[]  = _T("1033");
const TCHAR g_szCurrentDir[]    = _T(".\\");



// ==========================================================================
// class CSettings
//
// Purpose:
//  This class wraps an ini file specific to this sample
// ==========================================================================
class CSettings
{
public:
    // Constructors
    CSettings(LPCTSTR pszIniName = g_szSettingsFile);
    
    BOOL Parse();

    // Getters/Setters
    inline LPCTSTR GetMsi()              { return m_szMsi;              }
    inline LPCTSTR GetIniName()          { return m_szIniName;          }
    inline LPCTSTR GetProductName()      { return m_szProductName;      }
    inline LPCTSTR GetDialogText()       { return m_szDialogText;       }
    inline LPCTSTR GetCaptionText()      { return m_szCaptionText;      }
    inline LPCTSTR GetLanguageDirectory(){ return m_szLanguageDirectory;}
    inline LPCTSTR GetFxInstallerPath()  { return m_szFxInstallerPath;  }
    inline LPCTSTR GetErrorCaptionText() { return m_szErrorCaptionText; }
    inline LPCTSTR GetMSIPath()			{ return m_szMSILocation; }
    inline LPCTSTR GetIEPath()			{ return m_szIELocation; }
    inline LPCTSTR GetNetVersion()		{ return m_szNetVersion; }
    inline LPCTSTR GetMDACPath()		{ return m_szMDACLocation; }
    inline LPCTSTR GetMDACVersion()		{ return m_szMDACVersion; }
    inline LPCTSTR GetMSDEPath()		{ return m_szMSDELocation; }
    inline LPCTSTR GetMSDEParams()		{ return m_szMSDEParams; }
    inline LPCTSTR GetFxInstallerOptions()  { return m_szFxInstallerOptions;  }
    inline LPCTSTR GetFxServicePack()  { return m_szFxServicePack;  }
    inline LPCTSTR GetExtraProgramPath1()  { return m_szExtraProgramPath1;  }
    inline LPCTSTR GetExtraProgramPathOptions1()  { return m_szExtraProgramOptions1;  }
    
    inline BOOL GetQuietMode()            { return m_bQuietMode;   }
    inline void SetQuietMode(BOOL bQuiet) { m_bQuietMode = bQuiet; }

    inline HINSTANCE GetHInstance()           { return m_hAppInst;  }
    inline void SetHInstance(HINSTANCE hInst) { m_hAppInst = hInst; }

private:
    
    HINSTANCE   m_hAppInst;
    BOOL        m_bQuietMode;
    TCHAR       m_szIniName[MAX_PATH+1];
    TCHAR       m_szMsi[MAX_PATH+1];
    TCHAR       m_szProductName[MAX_PATH];
    TCHAR       m_szCaptionText[MAX_PATH];
    TCHAR       m_szErrorCaptionText[MAX_PATH];
    TCHAR       m_szDialogText[MAX_MSG];
    TCHAR       m_szFxInstallerPath[MAX_PATH+1];
    TCHAR       m_szFxInstallerOptions[MAX_PATH+1];
    TCHAR       m_szLanguageDirectory[MAX_PATH+1];
    TCHAR       m_szMSILocation[MAX_PATH+1];
    TCHAR       m_szIELocation[MAX_PATH+1];
    TCHAR       m_szNetVersion[15];
	TCHAR       m_szMDACLocation[MAX_PATH+1];
	TCHAR       m_szMSDELocation[MAX_PATH+1];
    TCHAR       m_szMSDEParams[MAX_PATH+1];
    TCHAR       m_szMDACVersion[15];
    TCHAR       m_szFxServicePack[MAX_PATH+1];
    TCHAR       m_szExtraProgramPath1[MAX_PATH+1];
    TCHAR       m_szExtraProgramOptions1[MAX_PATH+1];
	
};

// global settings object
extern CSettings g_settings;

#endif // SETTINGS_H

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Kevin Moore
Web Developer
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150731.1 | Last Updated 24 Nov 2005
Article Copyright 2003 by Kevin Moore
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid