Install Support for BIND 9 on win32
This commit is contained in:
86
bin/win32/BINDInstall/BINDInstall.cpp
Normal file
86
bin/win32/BINDInstall/BINDInstall.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2000 by Nortel Networks Corporation
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND NORTEL NETWORKS DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NORTEL NETWORKS
|
||||
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "BINDInstall.h"
|
||||
#include "BINDInstallDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBINDInstallApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CBINDInstallApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CBINDInstallApp)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBINDInstallApp construction
|
||||
|
||||
CBINDInstallApp::CBINDInstallApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CBINDInstallApp object
|
||||
|
||||
CBINDInstallApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CBINDInstallApp initialization
|
||||
|
||||
BOOL CBINDInstallApp::InitInstance()
|
||||
{
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
#ifdef _AFXDLL
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
CBINDInstallDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
int nResponse = dlg.DoModal();
|
||||
if (nResponse == IDOK)
|
||||
{
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with OK
|
||||
}
|
||||
else if (nResponse == IDCANCEL)
|
||||
{
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with Cancel
|
||||
}
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
return FALSE;
|
||||
}
|
||||
204
bin/win32/BINDInstall/BINDInstall.dsp
Normal file
204
bin/win32/BINDInstall/BINDInstall.dsp
Normal file
@@ -0,0 +1,204 @@
|
||||
# Microsoft Developer Studio Project File - Name="BINDInstall" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=BINDInstall - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "BINDInstall.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "BINDInstall.mak" CFG="BINDInstall - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "BINDInstall - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "BINDInstall - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "BINDInstall - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 5
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 version.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"..\..\..\Build\Release\BINDInstall.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 5
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FR /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 version.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"..\..\..\Build\Debug\BINDInstall.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "BINDInstall - Win32 Release"
|
||||
# Name "BINDInstall - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BINDInstall.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BINDInstallDlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirBrowse.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\VersionInfo.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BINDInstall.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BINDInstallDlg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirBrowse.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\VersionInfo.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\BINDInstall.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\BINDInstall.rc2
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\check.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\clock1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\clock2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\clock3.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\clock4.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\clock5.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\clock6.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\clock7.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\clock8.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\icon1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\x.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BINDInstall.rc
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
29
bin/win32/BINDInstall/BINDInstall.dsw
Normal file
29
bin/win32/BINDInstall/BINDInstall.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "BINDInstall"=.\BINDInstall.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
45
bin/win32/BINDInstall/BINDInstall.h
Normal file
45
bin/win32/BINDInstall/BINDInstall.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2000 by Nortel Networks Corporation
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND NORTEL NETWORKS DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NORTEL NETWORKS
|
||||
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef BINDINSTALL_H
|
||||
#define BINDINSTALL_H
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
class CBINDInstallApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CBINDInstallApp();
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CBINDInstallApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
//{{AFX_MSG(CBINDInstallApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif
|
||||
293
bin/win32/BINDInstall/BINDInstall.rc
Normal file
293
bin/win32/BINDInstall/BINDInstall.rc
Normal file
@@ -0,0 +1,293 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\BINDInstall.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\BINDInstall.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_BINDINSTALL_DIALOG DIALOGEX 0, 0, 210, 234
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "BIND 9 Installer"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Target Directory:",IDC_STATIC,7,69,54,8
|
||||
EDITTEXT IDC_TARGETDIR,7,82,196,14,ES_AUTOHSCROLL
|
||||
GROUPBOX "Progress",IDC_STATIC,7,157,196,70
|
||||
RTEXT "",IDC_COPY_TAG,10,191,84,8
|
||||
LTEXT "",IDC_COPY_FILE,100,191,97,8
|
||||
RTEXT "",IDC_SERVICE_TAG,10,202,84,8
|
||||
LTEXT "",IDC_REG_SERVICE,100,203,97,8
|
||||
RTEXT "",IDC_MESSAGE_TAG,10,213,84,8
|
||||
DEFPUSHBUTTON "&Install",IDC_INSTALL,153,7,50,14
|
||||
LTEXT "",IDC_REG_MESSAGE,100,214,97,8
|
||||
RTEXT "",IDC_DIR_TAG,10,180,84,8
|
||||
PUSHBUTTON "E&xit",IDC_EXIT,153,39,50,14
|
||||
CONTROL "&Automatic Startup",IDC_AUTO_START,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,14,112,72,10
|
||||
GROUPBOX "Options",IDC_STATIC,7,102,196,49
|
||||
PUSHBUTTON "&Uninstall",IDC_UNINSTALL,153,23,50,14
|
||||
CTEXT "Version Unknown",IDC_VERSION,7,7,61,10,SS_CENTERIMAGE |
|
||||
SS_SUNKEN
|
||||
CONTROL "&Keep Config Files After Uninstall",IDC_KEEP_FILES,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,122,116,10
|
||||
PUSHBUTTON "Browse",IDC_BROWSE,7,22,50,14
|
||||
RTEXT "Current Operation:",IDC_CURRENT_TAG,36,166,58,8
|
||||
LTEXT "",IDC_CURRENT,100,166,97,8
|
||||
LTEXT "",IDC_CREATE_DIR,100,180,97,8
|
||||
CONTROL "&Start BIND Service After Install",IDC_START,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,14,132,113,10
|
||||
END
|
||||
|
||||
IDD_BROWSE DIALOG DISCARDABLE 0, 0, 227, 117
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Select Directory"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,170,7,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,170,24,50,14
|
||||
LISTBOX IDC_DIRLIST,7,28,155,82,LBS_SORT | LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
EDITTEXT IDC_CURDIR,7,7,155,14,ES_AUTOHSCROLL
|
||||
COMBOBOX IDC_DRIVES,170,98,50,74,CBS_DROPDOWNLIST | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,5,0,0
|
||||
PRODUCTVERSION 1,5,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "Internet Software Consortium\0"
|
||||
VALUE "FileDescription", "ISC BIND Install Utility\0"
|
||||
VALUE "FileVersion", "1.5.0\0"
|
||||
VALUE "InternalName", "BINDInstall\0"
|
||||
VALUE "LegalCopyright", "Copyright © 2000\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "BINDInstall.EXE\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "ISC BIND\0"
|
||||
VALUE "ProductVersion", "9.2.0\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_BINDINSTALL_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 203
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 227
|
||||
END
|
||||
|
||||
IDD_BROWSE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 220
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 110
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_MAINFRAME "BIND 9 Installer"
|
||||
IDS_CREATEDIR "Directory %s does not exist.\nDo you wish to create it?"
|
||||
IDS_SUCCESS "BIND installation completed successfully"
|
||||
IDS_FAIL "BIND installation failed"
|
||||
IDS_DIREXIST "Directory %s exists.\n Install here anyway?"
|
||||
IDS_INSTALL_DIR "Create Directories..."
|
||||
IDS_INSTALL_FILE "Copy Files..."
|
||||
IDS_INSTALL_SERVICE "Register Service..."
|
||||
IDS_INSTALL_MESSAGE "Register Messages..."
|
||||
IDS_UNINSTALL "Do you wish to uninstall BIND?"
|
||||
IDS_UNINSTALL_DONE "BIND Uninstall Completed"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_CREATE_KEY "Creating BIND registry key"
|
||||
IDS_ADD_REMOVE "Setting up Add/Remove Programs entry"
|
||||
IDS_CLEANUP "Cleaning up"
|
||||
IDS_INSTALL_DONE "Finished Installing"
|
||||
IDS_CREATE_DIR "Creating directory %s"
|
||||
IDS_REMOVE_DIR "Removing directory %s"
|
||||
IDS_COPY_FILE "Copying file %s"
|
||||
IDS_DELETE_FILE "Deleting file %s"
|
||||
IDS_OPEN_SCM "Opening Service Control Manager"
|
||||
IDS_CREATE_SERVICE "Creating BIND service"
|
||||
IDS_OPEN_SERVICE "Opening BIND service"
|
||||
IDS_REMOVE_SERVICE "Removing BIND service"
|
||||
IDS_REGISTER_MESSAGES "Registering BIND message source"
|
||||
IDS_UNREGISTER_MESSAGES "Unregistering BIND message source"
|
||||
IDS_STOP_SERVICE "Stopping BIND service"
|
||||
IDS_START_SERVICE "Starting BIND service"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_UNINSTALL_DIR "Remove Directories..."
|
||||
IDS_UNINSTALL_FILES "Delete Files..."
|
||||
IDS_UNINSTALL_SERVICE "Unregister Service..."
|
||||
IDS_UNINSTALL_MESSAGE "Unregister Messages..."
|
||||
IDS_ERR_OPEN_SCM "Could not open Service Control Manager\n(%s)"
|
||||
IDS_ERR_OPEN_SERVICE "Could not open BIND Service\n(%s)"
|
||||
IDS_ERR_STOP_SERVICE "Could not stop BIND Service\n(%s)"
|
||||
IDS_ERR_NONCRIT_FILE "An error occurred while copying non-critical file %s\n(%s)\nDo you wish to continue?"
|
||||
IDS_ERR_COPY_FILE "An error occurred while copying file %s\n(%s)\nInstallation will be terminated"
|
||||
IDS_ERR_CREATE_SERVICE "Error creating service\n(%s)"
|
||||
IDS_ERR_REMOVE_SERVICE "Error removing service\n(%s)"
|
||||
IDS_REBOOT "BINDInstall needs to restart Windows.\nDo you wish to restart now?"
|
||||
IDS_BAD_PRIVILEGES "This user cannot acquire the privileges necessary to install BIND. Please ensure you are logged on as a member of the Administrators group."
|
||||
IDS_ERR_CREATE_DIR "An error occurred while creating directory %s\n(%s)"
|
||||
IDS_VERSION "Version %s"
|
||||
IDS_ERR_CREATE_KEY "An error occured while creating registry keys\n(%s)"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_ERR_SET_VALUE "An error occured while setting registry key values\n(%s)"
|
||||
IDS_NO_VERSION "Version Unknown"
|
||||
IDS_EXISTING_NEWER "%s\nThe existing version of this file is newer than the version being installed.\nDo you wish to overwrite the existing file?"
|
||||
IDS_FILE_BAD "Could not retrieve version info for file %s. Do you wish to continue?\n(Continuing may overwrite a newer version of the file) "
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
#include "res\BINDInstall.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
1084
bin/win32/BINDInstall/BINDInstallDlg.cpp
Normal file
1084
bin/win32/BINDInstall/BINDInstallDlg.cpp
Normal file
File diff suppressed because it is too large
Load Diff
98
bin/win32/BINDInstall/BINDInstallDlg.h
Normal file
98
bin/win32/BINDInstall/BINDInstallDlg.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2000 by Nortel Networks Corporation
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND NORTEL NETWORKS DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NORTEL NETWORKS
|
||||
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef BINDINSTALLDLG_H
|
||||
#define BINDINSTALLDLG_H
|
||||
|
||||
class CBINDInstallDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CBINDInstallDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
//{{AFX_DATA(CBINDInstallDlg)
|
||||
enum { IDD = IDD_BINDINSTALL_DIALOG };
|
||||
CString m_targetDir;
|
||||
CString m_version;
|
||||
BOOL m_autoStart;
|
||||
BOOL m_keepFiles;
|
||||
CString m_current;
|
||||
BOOL m_startOnInstall;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CBINDInstallDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
void StartBINDService();
|
||||
void StopBINDService();
|
||||
|
||||
void InstallTags();
|
||||
void UninstallTags();
|
||||
|
||||
void CreateDirs();
|
||||
void RemoveDirs(BOOL uninstall);
|
||||
|
||||
void CopyFiles();
|
||||
void DeleteFiles(BOOL uninstall);
|
||||
|
||||
void RegisterService();
|
||||
void UnregisterService(BOOL uninstall);
|
||||
|
||||
void RegisterMessages();
|
||||
void UnregisterMessages(BOOL uninstall);
|
||||
|
||||
void FailedInstall();
|
||||
void SetItemStatus(UINT nID, BOOL bSuccess = TRUE);
|
||||
|
||||
protected:
|
||||
CString DestDir(int destination);
|
||||
int MsgBox(int id, ...);
|
||||
int MsgBox(int id, UINT type, ...);
|
||||
CString GetErrMessage(DWORD err = -1);
|
||||
BOOL CheckBINDService();
|
||||
void SetCurrent(int id, ...);
|
||||
void ProgramGroup(BOOL create = TRUE);
|
||||
|
||||
HICON m_hIcon;
|
||||
CString m_defaultDir;
|
||||
CString m_etcDir;
|
||||
CString m_binDir;
|
||||
CString m_winSysDir;
|
||||
BOOL m_reboot;
|
||||
CString m_currentDir;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CBINDInstallDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnBrowse();
|
||||
afx_msg void OnChangeTargetdir();
|
||||
afx_msg void OnInstall();
|
||||
afx_msg void OnExit();
|
||||
afx_msg void OnUninstall();
|
||||
afx_msg void OnAutoStart();
|
||||
afx_msg void OnKeepFiles();
|
||||
afx_msg void OnStartOnInstall();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif
|
||||
84
bin/win32/BINDInstall/DirBrowse.cpp
Normal file
84
bin/win32/BINDInstall/DirBrowse.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2000 by Nortel Networks Corporation
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND NORTEL NETWORKS DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NORTEL NETWORKS
|
||||
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "BINDInstall.h"
|
||||
#include "DirBrowse.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDirBrowse dialog
|
||||
|
||||
|
||||
CDirBrowse::CDirBrowse(CString initialDir, CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDirBrowse::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDirBrowse)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
m_selectedDir = initialDir;
|
||||
}
|
||||
|
||||
|
||||
void CDirBrowse::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDirBrowse)
|
||||
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDirBrowse, CDialog)
|
||||
//{{AFX_MSG_MAP(CDirBrowse)
|
||||
ON_LBN_DBLCLK(IDC_DIRLIST, OnDblclkDirlist)
|
||||
ON_LBN_SELCHANGE(IDC_DIRLIST, OnSelchangeDirlist)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDirBrowse message handlers
|
||||
|
||||
BOOL CDirBrowse::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
DlgDirList((LPTSTR)(LPCTSTR)m_selectedDir, IDC_DIRLIST, IDC_CURDIR, DDL_DIRECTORY);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CDirBrowse::OnDblclkDirlist()
|
||||
{
|
||||
CListBox *lb = (CListBox *)GetDlgItem(IDC_DIRLIST);
|
||||
CString curSel;
|
||||
|
||||
lb->GetText(lb->GetCurSel(), curSel);
|
||||
DlgDirList((LPTSTR)(LPCTSTR)curSel, IDC_DIRLIST, IDC_CURDIR, DDL_DIRECTORY);
|
||||
}
|
||||
|
||||
void CDirBrowse::OnSelchangeDirlist()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
|
||||
}
|
||||
52
bin/win32/BINDInstall/DirBrowse.h
Normal file
52
bin/win32/BINDInstall/DirBrowse.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2000 by Nortel Networks Corporation
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND NORTEL NETWORKS DISCLAIMS
|
||||
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NORTEL NETWORKS
|
||||
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef DIRBROWSE_H
|
||||
#define DIRBROWSE_H
|
||||
|
||||
class CDirBrowse : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CDirBrowse(CString initialDir = "\\", CWnd* pParent = NULL); // standard constructor
|
||||
CString GetSelectedDir() {return(m_selectedDir);}
|
||||
|
||||
//{{AFX_DATA(CDirBrowse)
|
||||
enum { IDD = IDD_BROWSE };
|
||||
// NOTE: the ClassWizard will add data members here
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CDirBrowse)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
protected:
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CDirBrowse)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnDblclkDirlist();
|
||||
afx_msg void OnSelchangeDirlist();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
CString m_selectedDir;
|
||||
};
|
||||
|
||||
#endif
|
||||
8
bin/win32/BINDInstall/StdAfx.cpp
Normal file
8
bin/win32/BINDInstall/StdAfx.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// BINDInstall.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
26
bin/win32/BINDInstall/StdAfx.h
Normal file
26
bin/win32/BINDInstall/StdAfx.h
Normal file
@@ -0,0 +1,26 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__61537819_39FC_11D3_A97A_00105A12BD65__INCLUDED_)
|
||||
#define AFX_STDAFX_H__61537819_39FC_11D3_A97A_00105A12BD65__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__61537819_39FC_11D3_A97A_00105A12BD65__INCLUDED_)
|
||||
286
bin/win32/BINDInstall/VersionInfo.cpp
Normal file
286
bin/win32/BINDInstall/VersionInfo.cpp
Normal file
@@ -0,0 +1,286 @@
|
||||
// VersionInfo.cpp: implementation of the CVersionInfo class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "bindinstall.h"
|
||||
#include "VersionInfo.h"
|
||||
#include <winver.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[]=__FILE__;
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CVersionInfo::CVersionInfo(CString filename)
|
||||
{
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA fd;
|
||||
memset(&fd, 0, sizeof(WIN32_FIND_DATA));
|
||||
|
||||
m_status = ERROR_SUCCESS;
|
||||
m_isValid = FALSE;
|
||||
m_filename = filename;
|
||||
|
||||
// See if the given file exists
|
||||
hFile = FindFirstFile(filename, &fd);
|
||||
if(hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
m_status = ERROR_FILE_NOT_FOUND;
|
||||
m_versionInfo = NULL;
|
||||
return;
|
||||
}
|
||||
FindClose(hFile);
|
||||
|
||||
// Extract the file info
|
||||
DWORD handle;
|
||||
DWORD viSize = GetFileVersionInfoSize((LPTSTR)(LPCTSTR)filename, &handle);
|
||||
m_versionInfo = NULL;
|
||||
|
||||
if(viSize == 0)
|
||||
{
|
||||
m_status = GetLastError();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_versionInfo = new char[viSize];
|
||||
|
||||
// Get the block of version info from the file
|
||||
if(!GetFileVersionInfo((LPTSTR)(LPCTSTR)filename, handle, viSize, m_versionInfo))
|
||||
{
|
||||
if(m_versionInfo)
|
||||
{
|
||||
delete m_versionInfo;
|
||||
m_versionInfo = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Now extract the sub block we are interested in
|
||||
UINT versionLen = 0;
|
||||
LPVOID viBlob = NULL;
|
||||
if(!VerQueryValue(m_versionInfo, "\\", &viBlob, &versionLen))
|
||||
{
|
||||
if(m_versionInfo)
|
||||
{
|
||||
delete m_versionInfo;
|
||||
m_versionInfo = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// And finally the version info is ours
|
||||
m_fixedInfo = (VS_FIXEDFILEINFO *)viBlob;
|
||||
|
||||
UINT blobLen = 0;
|
||||
|
||||
// If we got here, all is good
|
||||
}
|
||||
m_isValid = TRUE;
|
||||
}
|
||||
|
||||
CVersionInfo::~CVersionInfo()
|
||||
{
|
||||
m_fixedInfo = NULL;
|
||||
if(m_versionInfo)
|
||||
{
|
||||
delete m_versionInfo;
|
||||
m_versionInfo = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetFileVersionString()
|
||||
{
|
||||
return(QueryStringValue("FileVersion"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetProductVersionString()
|
||||
{
|
||||
return(QueryStringValue("ProductVersion"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetComments()
|
||||
{
|
||||
return(QueryStringValue("Comments"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetFileDescription()
|
||||
{
|
||||
return(QueryStringValue("FileDescription"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetInternalName()
|
||||
{
|
||||
return(QueryStringValue("InternalName"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetLegalCopyright()
|
||||
{
|
||||
return(QueryStringValue("LegalCopyright"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetLegalTrademarks()
|
||||
{
|
||||
return(QueryStringValue("LegalTrademarks"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetOriginalFileName()
|
||||
{
|
||||
return(QueryStringValue("OriginalFilename"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetProductName()
|
||||
{
|
||||
return(QueryStringValue("ProductName"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetSpecialBuildString()
|
||||
{
|
||||
return(QueryStringValue("SpecialBuild"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetPrivateBuildString()
|
||||
{
|
||||
return(QueryStringValue("PrivateBuild"));
|
||||
}
|
||||
|
||||
CString CVersionInfo::GetCompanyName()
|
||||
{
|
||||
return(QueryStringValue("CompanyName"));
|
||||
}
|
||||
|
||||
#ifdef NOTUSED
|
||||
BOOL CVersionInfo::CopyFileCheckVersion(CVersionInfo &originalFile)
|
||||
{
|
||||
_int64 myVer = GetFileVersion();
|
||||
_int64 origVer = originalFile.GetFileVersion();
|
||||
|
||||
if(origVer > myVer)
|
||||
{
|
||||
CString msg;
|
||||
msg.Format(IDS_EXISTING_NEWER, m_filename);
|
||||
DWORD query = AfxMessageBox(msg, MB_YESNO);
|
||||
if(query == IDNO)
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(CopyFileNoVersion(originalFile));
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL CVersionInfo::CopyFileNoVersion(CVersionInfo &originalFile)
|
||||
{
|
||||
int x = 7;
|
||||
return(CopyFile(originalFile.GetFilename(), m_filename, FALSE));
|
||||
}
|
||||
|
||||
|
||||
_int64 CVersionInfo::GetFileVersion()
|
||||
{
|
||||
_int64 ver = 0;
|
||||
|
||||
if(m_versionInfo)
|
||||
{
|
||||
ver = m_fixedInfo->dwFileVersionMS;
|
||||
ver <<= 32;
|
||||
ver += m_fixedInfo->dwFileVersionLS;
|
||||
}
|
||||
return(ver);
|
||||
}
|
||||
|
||||
_int64 CVersionInfo::GetProductVersion()
|
||||
{
|
||||
_int64 ver = 0;
|
||||
|
||||
if(m_versionInfo)
|
||||
{
|
||||
ver = m_fixedInfo->dwProductVersionMS;
|
||||
ver <<= 32;
|
||||
ver += m_fixedInfo->dwProductVersionLS;
|
||||
}
|
||||
return(ver);
|
||||
}
|
||||
|
||||
_int64 CVersionInfo::GetFileDate()
|
||||
{
|
||||
_int64 fDate = 0;
|
||||
|
||||
if(m_versionInfo)
|
||||
{
|
||||
fDate = m_fixedInfo->dwFileDateMS;
|
||||
fDate <<= 32;
|
||||
fDate += m_fixedInfo->dwFileDateLS;
|
||||
}
|
||||
return(fDate);
|
||||
}
|
||||
|
||||
DWORD CVersionInfo::GetFileFlagMask()
|
||||
{
|
||||
if(m_versionInfo)
|
||||
{
|
||||
return(m_fixedInfo->dwFileFlagsMask);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
DWORD CVersionInfo::GetFileFlags()
|
||||
{
|
||||
if(m_versionInfo)
|
||||
{
|
||||
return(m_fixedInfo->dwFileFlags);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
DWORD CVersionInfo::GetFileOS()
|
||||
{
|
||||
if(m_versionInfo)
|
||||
{
|
||||
return(m_fixedInfo->dwFileOS);
|
||||
}
|
||||
return(VOS_UNKNOWN);
|
||||
}
|
||||
|
||||
DWORD CVersionInfo::GetFileType()
|
||||
{
|
||||
if(m_versionInfo)
|
||||
{
|
||||
return(m_fixedInfo->dwFileType);
|
||||
}
|
||||
return(VFT_UNKNOWN);
|
||||
}
|
||||
|
||||
DWORD CVersionInfo::GetFileSubType()
|
||||
{
|
||||
if(m_versionInfo)
|
||||
{
|
||||
return(m_fixedInfo->dwFileSubtype);
|
||||
}
|
||||
return(VFT2_UNKNOWN);
|
||||
}
|
||||
|
||||
CString CVersionInfo::QueryStringValue(CString value)
|
||||
{
|
||||
UINT blobLen = 0;
|
||||
LPVOID viBlob = NULL;
|
||||
|
||||
if(m_versionInfo)
|
||||
{
|
||||
char queryString[256];
|
||||
|
||||
// This code page value is for American English. If you change the resources to be other than that
|
||||
// You probably should change this to match it.
|
||||
DWORD codePage = 0x040904B0;
|
||||
|
||||
sprintf(queryString, "\\StringFileInfo\\%08X\\%s", codePage, value);
|
||||
|
||||
if(VerQueryValue(m_versionInfo, queryString, &viBlob, &blobLen))
|
||||
return((char *)viBlob);
|
||||
}
|
||||
return("Not Available");
|
||||
}
|
||||
62
bin/win32/BINDInstall/VersionInfo.h
Normal file
62
bin/win32/BINDInstall/VersionInfo.h
Normal file
@@ -0,0 +1,62 @@
|
||||
// VersionInfo.h: interface for the CVersionInfo class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_VERSIONINFO_H__F82E9FF3_5298_11D4_AB87_00C04F789BA0__INCLUDED_)
|
||||
#define AFX_VERSIONINFO_H__F82E9FF3_5298_11D4_AB87_00C04F789BA0__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
class CVersionInfo
|
||||
{
|
||||
public:
|
||||
CVersionInfo(CString filename);
|
||||
virtual ~CVersionInfo();
|
||||
BOOL IsValid() {return m_isValid;}
|
||||
DWORD GetStatus() {return m_status;}
|
||||
|
||||
BOOL CopyFileCheckVersion(CVersionInfo &originalFile);
|
||||
BOOL CopyFileNoVersion(CVersionInfo &originalFile);
|
||||
|
||||
const CString &GetFilename() {return m_filename;}
|
||||
|
||||
// Extract the elements of the file's string info block
|
||||
CString GetFileVersionString();
|
||||
CString GetProductVersionString();
|
||||
CString GetComments();
|
||||
CString GetFileDescription();
|
||||
CString GetInternalName();
|
||||
CString GetLegalCopyright();
|
||||
CString GetLegalTrademarks();
|
||||
CString GetOriginalFileName();
|
||||
CString GetProductName();
|
||||
CString GetSpecialBuildString();
|
||||
CString GetPrivateBuildString();
|
||||
CString GetCompanyName();
|
||||
|
||||
|
||||
// Extract the elements of the file's VS_FIXEDFILEINFO block
|
||||
_int64 GetFileVersion();
|
||||
_int64 GetProductVersion();
|
||||
_int64 GetFileDate();
|
||||
|
||||
DWORD GetFileFlagMask();
|
||||
DWORD GetFileFlags();
|
||||
DWORD GetFileOS();
|
||||
DWORD GetFileType();
|
||||
DWORD GetFileSubType();
|
||||
|
||||
private:
|
||||
CString m_filename;
|
||||
BOOL m_isValid;
|
||||
LPVOID m_versionInfo;
|
||||
VS_FIXEDFILEINFO *m_fixedInfo;
|
||||
DWORD m_codePage;
|
||||
DWORD m_status;
|
||||
|
||||
CString QueryStringValue(CString value);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_VERSIONINFO_H__F82E9FF3_5298_11D4_AB87_00C04F789BA0__INCLUDED_)
|
||||
BIN
bin/win32/BINDInstall/res/BINDInstall.ico
Normal file
BIN
bin/win32/BINDInstall/res/BINDInstall.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
13
bin/win32/BINDInstall/res/BINDInstall.rc2
Normal file
13
bin/win32/BINDInstall/res/BINDInstall.rc2
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// BINDINSTALL.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
90
bin/win32/BINDInstall/resource.h
Normal file
90
bin/win32/BINDInstall/resource.h
Normal file
@@ -0,0 +1,90 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by BINDInstall.rc
|
||||
//
|
||||
#define IDS_MAINFRAME 1
|
||||
#define IDS_CREATEDIR 2
|
||||
#define IDS_SUCCESS 3
|
||||
#define IDS_FAIL 4
|
||||
#define IDS_DIREXIST 5
|
||||
#define IDS_INSTALL_DIR 6
|
||||
#define IDS_INSTALL_FILE 7
|
||||
#define IDS_INSTALL_SERVICE 8
|
||||
#define IDS_INSTALL_MESSAGE 9
|
||||
#define IDS_UNINSTALL 14
|
||||
#define IDS_UNINSTALL_DONE 15
|
||||
#define IDS_CREATE_KEY 16
|
||||
#define IDS_ADD_REMOVE 17
|
||||
#define IDS_CLEANUP 18
|
||||
#define IDS_INSTALL_DONE 19
|
||||
#define IDS_CREATE_DIR 20
|
||||
#define IDS_REMOVE_DIR 21
|
||||
#define IDS_COPY_FILE 22
|
||||
#define IDS_DELETE_FILE 23
|
||||
#define IDS_OPEN_SCM 24
|
||||
#define IDS_CREATE_SERVICE 25
|
||||
#define IDS_OPEN_SERVICE 26
|
||||
#define IDS_REMOVE_SERVICE 27
|
||||
#define IDS_REGISTER_MESSAGES 28
|
||||
#define IDS_UNREGISTER_MESSAGES 29
|
||||
#define IDS_STOP_SERVICE 30
|
||||
#define IDS_START_SERVICE 31
|
||||
#define IDS_UNINSTALL_DIR 32
|
||||
#define IDS_UNINSTALL_FILES 33
|
||||
#define IDS_UNINSTALL_SERVICE 34
|
||||
#define IDS_UNINSTALL_MESSAGE 35
|
||||
#define IDS_ERR_OPEN_SCM 36
|
||||
#define IDS_ERR_OPEN_SERVICE 37
|
||||
#define IDS_ERR_STOP_SERVICE 38
|
||||
#define IDS_ERR_NONCRIT_FILE 39
|
||||
#define IDS_ERR_CRITICAL_FILE 40
|
||||
#define IDS_ERR_COPY_FILE 40
|
||||
#define IDS_ERR_CREATE_SERVICE 41
|
||||
#define IDS_ERR_REMOVE_SERVICE 42
|
||||
#define IDS_REBOOT 43
|
||||
#define IDS_BAD_PRIVILEGES 44
|
||||
#define IDS_ERR_CREATE_DIR 45
|
||||
#define IDS_VERSION 46
|
||||
#define IDS_ERR_CREATE_KEY 47
|
||||
#define IDS_ERR_SET_VALUE 48
|
||||
#define IDS_NO_VERSION 49
|
||||
#define IDS_EXISTING_NEWER 50
|
||||
#define IDS_FILE_BAD 51
|
||||
#define IDD_BINDINSTALL_DIALOG 102
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_BROWSE 129
|
||||
#define IDI_CHECK 130
|
||||
#define IDI_X 132
|
||||
#define IDC_TARGETDIR 1001
|
||||
#define IDC_BROWSE 1002
|
||||
#define IDC_DIRLIST 1004
|
||||
#define IDC_CURDIR 1005
|
||||
#define IDC_INSTALL 1006
|
||||
#define IDC_COPY_FILE 1007
|
||||
#define IDC_REG_SERVICE 1008
|
||||
#define IDC_REG_MESSAGE 1009
|
||||
#define IDC_CREATE_DIR 1010
|
||||
#define IDC_EXIT 1011
|
||||
#define IDC_DIR_TAG 1012
|
||||
#define IDC_COPY_TAG 1013
|
||||
#define IDC_SERVICE_TAG 1014
|
||||
#define IDC_MESSAGE_TAG 1015
|
||||
#define IDC_AUTO_START 1016
|
||||
#define IDC_UNINSTALL 1017
|
||||
#define IDC_VERSION 1018
|
||||
#define IDC_KEEP_FILES 1019
|
||||
#define IDC_CURRENT_TAG 1020
|
||||
#define IDC_DRIVES 1021
|
||||
#define IDC_CURRENT 1021
|
||||
#define IDC_START 1022
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 142
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1027
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user