diff --git a/CHANGES b/CHANGES index bed449343a..248dedad7f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4200. [cleanup] win32: update BINDinstall to be BIND release + independent. [RT #38915] + 4199. [protocol] Add support for NINFO, RKEY, TA. [RT #40545] [RT #40547] [RT #40563] diff --git a/bin/win32/BINDInstall/BINDInstallDlg.cpp b/bin/win32/BINDInstall/BINDInstallDlg.cpp index f040258a37..b5a2b22617 100644 --- a/bin/win32/BINDInstall/BINDInstallDlg.cpp +++ b/bin/win32/BINDInstall/BINDInstallDlg.cpp @@ -66,8 +66,15 @@ #include "AccountInfo.h" #include "versioninfo.h" +#include +#include +#include +#include + #include +#undef open + #define MAX_GROUPS 100 #define MAX_PRIVS 50 @@ -102,13 +109,15 @@ typedef struct _filedata { enum FileDestinations {TargetDir, BinDir, EtcDir, WinSystem}; enum FileImportance {Trivial, Normal, Critical}; - char *filename; + char filename[128]; int destination; int importance; BOOL checkVer; BOOL withTools; } FileData; +#if no_longer_used + const FileData installFiles[] = { #ifdef BINARIES_INSTALL @@ -192,13 +201,21 @@ const FileData installFiles[] = {NULL, -1, -1} }; +#else + +typedef std::vector FileDatas; +FileDatas installFiles; +BOOL forwin64 = FALSE; +BOOL runvcredist = FALSE; + +#endif + ///////////////////////////////////////////////////////////////////////////// // CBINDInstallDlg dialog CBINDInstallDlg::CBINDInstallDlg(CWnd* pParent /*=NULL*/) : CDialog(CBINDInstallDlg::IDD, pParent) { char winsys[MAX_PATH]; - char progfiles[MAX_PATH]; //{{AFX_DATA_INIT(CBINDInstallDlg) m_targetDir = _T(""); @@ -219,16 +236,8 @@ CBINDInstallDlg::CBINDInstallDlg(CWnd* pParent /*=NULL*/) GetSystemDirectory(winsys, MAX_PATH); m_winSysDir = winsys; -#ifndef _WIN64 - SHGetFolderPath(NULL, CSIDL_FLAG_CREATE|CSIDL_PROGRAM_FILESX86, - NULL, SHGFP_TYPE_CURRENT, progfiles); -#else - SHGetFolderPath(NULL, CSIDL_FLAG_CREATE|CSIDL_PROGRAM_FILES, - NULL, SHGFP_TYPE_CURRENT, progfiles); -#endif + m_defaultDir = "notyetknown"; - m_defaultDir = progfiles; - m_defaultDir += "\\ISC BIND 9"; m_installed = FALSE; m_accountExists = FALSE; m_accountUsed = FALSE; @@ -289,6 +298,19 @@ BOOL CBINDInstallDlg::OnInitDialog() { CString Dirname(dirname); m_currentDir = Dirname; + ReadInstallFlags(); + char progfiles[MAX_PATH]; + int id_program_files; + if (forwin64) + id_program_files = CSIDL_PROGRAM_FILES; + else + id_program_files = CSIDL_PROGRAM_FILESX86; + SHGetFolderPath(NULL, CSIDL_FLAG_CREATE|id_program_files, + NULL, SHGFP_TYPE_CURRENT, progfiles); + + m_defaultDir = progfiles; + m_defaultDir += "\\ISC BIND 9"; + CVersionInfo bindInst(filename); if(bindInst.IsValid()) m_version.Format(IDS_VERSION, bindInst.GetFileVersionString()); @@ -421,6 +443,7 @@ void CBINDInstallDlg::OnUninstall() { UninstallTags(); UnregisterMessages(TRUE); UnregisterService(TRUE); + ReadInstallFileList(); DeleteFiles(TRUE); if (m_keepFiles == FALSE) RemoveDirs(TRUE); @@ -444,9 +467,6 @@ void CBINDInstallDlg::OnUninstall() { * User pressed the install button. Make it go. */ void CBINDInstallDlg::OnInstall() { -#if _MSC_VER >= 1400 - char Vcredist_x86[MAX_PATH]; -#endif BOOL success = FALSE; int oldlen; @@ -542,7 +562,6 @@ void CBINDInstallDlg::OnInstall() { ProgramGroup(FALSE); -#if _MSC_VER >= 1400 /* * Install Visual Studio libraries. As per: * http://blogs.msdn.com/astebner/archive/2006/08/23/715755.aspx @@ -555,17 +574,19 @@ void CBINDInstallDlg::OnInstall() { * Enclose full path to Vcredist_x86.exe in quotes as * m_currentDir may contain spaces. */ -#ifndef _WIN64 - sprintf(Vcredist_x86, "\"%s\\Vcredist_x86.exe\"", - (LPCTSTR) m_currentDir); -#else - sprintf(Vcredist_x86, "\"%s\\Vcredist_x64.exe\"", - (LPCTSTR) m_currentDir); -#endif - system(Vcredist_x86); -#endif + if (runvcredist) { + char Vcredist_x86[MAX_PATH]; + if (forwin64) + sprintf(Vcredist_x86, "\"%s\\Vcredist_x64.exe\"", + (LPCTSTR) m_currentDir); + else + sprintf(Vcredist_x86, "\"%s\\Vcredist_x86.exe\"", + (LPCTSTR) m_currentDir); + system(Vcredist_x86); + } try { CreateDirs(); + ReadInstallFileList(); CopyFiles(); if (!m_toolsOnly) RegisterService(); @@ -665,26 +686,130 @@ void CBINDInstallDlg::RemoveDirs(BOOL uninstall) { SetItemStatus(IDC_CREATE_DIR, TRUE); } +// InstallFlags: runvcredist and forwin64 options +void CBINDInstallDlg::ReadInstallFlags() { + std::ifstream ff(m_currentDir + "\\InstallFlags"); + if (!ff) { + throw(Exception(IDS_FILE_BAD, "InstallFlags", "can't open")); + } + while (!ff.eof()) { + std::string line; + getline(ff, line); + if (line.compare("runvcredist") == 0) + runvcredist = TRUE; + else if (line.compare("forwin64") == 0) + forwin64 = TRUE; + } +} + +// InstallFiles: {filename-divt}* +// destination: TBEW +// importance: TNC +// checkVer and withTools: TF (boolean) +void CBINDInstallDlg::ReadInstallFileList() { + std::ifstream fl(m_currentDir + "\\InstallFiles"); + if (!fl) { + throw(Exception(IDS_FILE_BAD, "InstallFiles", "can't open")); + } + while (!fl.eof()) { + std::string line; + getline(fl, line); + if (line.empty()) + continue; + if (line[0] == '#') + continue; + // zip -l adds spurious \r: remove trailing space chars + size_t finish = line.find_last_not_of(" \t\r\n\t\v"); + if ((finish != std::string::npos) && + (finish + 1 != line.size())) { + line.erase(finish + 1); + } + size_t flags = line.find_last_of('-'); + if ((flags == std::string::npos) || + (flags + 5 != line.size())) + goto bad; + std::string file = line.substr(0, flags); + if (file.empty() || (file.size() > 127)) + goto bad; + FileData entry; + memmove(entry.filename, file.c_str(), file.size() + 1); + switch (line[flags + 1]) { + case 'T': + entry.destination = FileData::TargetDir; + break; + case 'B': + entry.destination = FileData::BinDir; + break; + case 'E': + entry.destination = FileData::EtcDir; + break; + case 'W': + entry.destination = FileData::WinSystem; + break; + default: + goto bad; + } + switch (line[flags + 2]) { + case 'T': + entry.importance = FileData::Trivial; + break; + case 'N': + entry.importance = FileData::Normal; + break; + case 'C': + entry.importance = FileData::Critical; + break; + default: + goto bad; + } + switch (line[flags + 3]) { + case 'T': + entry.checkVer = TRUE; + break; + case 'F': + entry.checkVer = FALSE; + break; + default: + goto bad; + } + switch (line[flags + 4]) { + case 'T': + entry.withTools = TRUE; + break; + case 'F': + entry.withTools = FALSE; + break; + default: + goto bad; + } + installFiles.push_back(entry); + } + return; + +bad: + throw(Exception(IDS_FILE_BAD, "InstallFiles", "syntax error")); +} + void CBINDInstallDlg::CopyFiles() { CString destFile; - for (int i = 0; installFiles[i].filename; i++) { - if (m_toolsOnly && !installFiles[i].withTools) + for (FileDatas::iterator fd = installFiles.begin(); + fd != installFiles.end(); ++fd) { + if (m_toolsOnly && !fd->withTools) continue; - SetCurrent(IDS_COPY_FILE, installFiles[i].filename); + SetCurrent(IDS_COPY_FILE, fd->filename); - destFile = DestDir(installFiles[i].destination) + "\\" + - installFiles[i].filename; - CString filespec = m_currentDir + "\\" + installFiles[i].filename; + destFile = DestDir(fd->destination) + "\\" + fd->filename; + CString filespec = m_currentDir + "\\" + fd->filename; CVersionInfo bindFile(destFile); CVersionInfo origFile(filespec); - if (!origFile.IsValid() && installFiles[i].checkVer) { + if (!origFile.IsValid() && fd->checkVer) { if (MsgBox(IDS_FILE_BAD, MB_YESNO, - installFiles[i].filename) == IDNO) + fd->filename) == IDNO) throw(Exception(IDS_ERR_COPY_FILE, - installFiles[i].filename, - GetErrMessage())); + fd->filename, + GetErrMessage())); } try { @@ -697,17 +822,16 @@ void CBINDInstallDlg::CopyFiles() { bindFile.CopyFileNoVersion(origFile); } catch(...) { - if (installFiles[i].importance != FileData::Trivial) { - if (installFiles[i].importance == - FileData::Critical || - MsgBox(IDS_ERR_NONCRIT_FILE, MB_YESNO, - installFiles[i].filename, - GetErrMessage()) == IDNO) + if (fd->importance != FileData::Trivial) { + if (fd->importance == FileData::Critical || + MsgBox(IDS_ERR_NONCRIT_FILE, MB_YESNO, + fd->filename, + GetErrMessage()) == IDNO) { SetItemStatus(IDC_COPY_FILE, FALSE); throw(Exception(IDS_ERR_COPY_FILE, - installFiles[i].filename, - GetErrMessage())); + fd->filename, + GetErrMessage())); } } } @@ -719,15 +843,15 @@ void CBINDInstallDlg::CopyFiles() { void CBINDInstallDlg::DeleteFiles(BOOL uninstall) { CString destFile; - for (int i = 0; installFiles[i].filename; i++) { - if (installFiles[i].checkVer) + for (FileDatas::iterator fd = installFiles.begin(); + fd != installFiles.end(); ++fd) { + if (fd->checkVer) continue; - destFile = DestDir(installFiles[i].destination) + "\\" + - installFiles[i].filename; + destFile = DestDir(fd->destination) + "\\" + fd->filename; if (uninstall) - SetCurrent(IDS_DELETE_FILE, installFiles[i].filename); + SetCurrent(IDS_DELETE_FILE, fd->filename); DeleteFile(destFile); } diff --git a/bin/win32/BINDInstall/BINDInstallDlg.h b/bin/win32/BINDInstall/BINDInstallDlg.h index 9cbc4c4c62..445767aa81 100644 --- a/bin/win32/BINDInstall/BINDInstallDlg.h +++ b/bin/win32/BINDInstall/BINDInstallDlg.h @@ -69,6 +69,9 @@ protected: void CreateDirs(); void RemoveDirs(BOOL uninstall); + void ReadInstallFlags(); + void ReadInstallFileList(); + void CopyFiles(); void DeleteFiles(BOOL uninstall); diff --git a/doc/arm/notes.xml b/doc/arm/notes.xml index 9123801fc1..a07cd8d803 100644 --- a/doc/arm/notes.xml +++ b/doc/arm/notes.xml @@ -179,6 +179,23 @@ + + Porting Changes + + + + The Microsoft Windows install tool + BINDInstall.exe which requires a + non-free version of Visual Studio to be built, now uses two + files (lists of flags and files) created by the Configure + perl script with all the needed information which were + previously compiled in the binary. Read + win32utils/build.txt for more details. + [RT #38915] + + + + Bug Fixes diff --git a/lib/isc/win32/libisc.vcxproj.in b/lib/isc/win32/libisc.vcxproj.in index 039ac082c9..b93e85cf5e 100644 --- a/lib/isc/win32/libisc.vcxproj.in +++ b/lib/isc/win32/libisc.vcxproj.in @@ -120,6 +120,11 @@ echo Copying Visual C x86 Redistributable Installer. copy /Y @VCREDIST_PATH@ ..\Build\Debug\ +echo Copying install files (flags and file list). + +copy InstallFlags ..\Build\Debug\ +copy InstallFiles ..\Build\Debug\ + @@ -247,6 +252,11 @@ echo Copying Visual C x86 Redistributable Installer. copy /Y @VCREDIST_PATH@ ..\Build\Release\ +echo Copying install files (flags and file list). + +copy InstallFlags ..\Build\Release\ +copy InstallFiles ..\Build\Release\ + diff --git a/win32utils/Configure b/win32utils/Configure index 4c2f028f95..2ff19b7ca8 100644 --- a/win32utils/Configure +++ b/win32utils/Configure @@ -2486,6 +2486,104 @@ sub makesrcid { close SOUT; } +# Build install files + +sub makeinstallfile { + open FOUT, ">InstallFlags" || die "cannot open InstallFlags: $!\n"; + print FOUT "# Flags for BINDInstall\n"; + if ($msc_ver >= 1400) { + print FOUT "runvcredist\n"; + } + if ($want_x64 eq "yes") { + print FOUT "forwin64\n"; + } + close FOUT; + + open LOUT, ">InstallFiles" || die "cannot open InstallFiles: $!\n"; + print LOUT "# File list for BINDInstall\n"; + if ($msc_ver < 1400) { + if ($msc_ver >= 1310) { + print LOUT "mfc71.dll-WCTT\n"; + print LOUT "msvcr71.dll-WCTT\n"; + } elsif (($msc_ver > 1200) && ($msc_ver < 1310)) { + print LOUT "mfc70.dll-WCTT\n"; + print LOUT "msvcr70.dll-WCTT\n"; + } + } + print LOUT "bindevt.dll-BNFT\n"; + print LOUT "libbind9.dll-BCFT\n"; + print LOUT "libisc.dll-BCFT\n"; + print LOUT "libisccfg.dll-BCFT\n"; + print LOUT "libisccc.dll-BCFT\n"; + print LOUT "libdns.dll-BCFT\n"; + print LOUT "liblwres.dll-BCFT\n"; + print LOUT "libirs.dll-BCFT\n"; + if ($use_openssl eq "yes") { + print LOUT "libeay32.dll-BCFT\n"; + } + if ($use_libxml2 eq "yes") { + print LOUT "libxml2.dll-BCFT\n"; + } + if ($use_gssapi eq "yes") { + if ($want_x64 eq "yes") { + print LOUT "gssapi64.dll-BCFT\n"; + print LOUT "krb5_64.dll-BCFT\n"; + } else { + print LOUT "gssapi32.dll-BCFT\n"; + print LOUT "krb5_32.dll-BCFT\n"; + } + } + if ($use_geoip eq "yes") { + print LOUT "libgeoip.dll-BCFT\n"; + } + if ($use_idn eq "yes") { + print LOUT "idnkit.dll-BCFT\n"; + print LOUT "iconv.dll-BCFT\n"; + } + print LOUT "named.exe-BCFF\n"; + print LOUT "nsupdate.exe-BNFT\n"; + print LOUT "BINDInstall.exe-BNFT\n"; + print LOUT "InstallFlags-BNFT\n"; + print LOUT "InstallFiles-BNFT\n"; + print LOUT "rndc.exe-BNFF\n"; + print LOUT "dig.exe-BNFT\n"; + print LOUT "host.exe-BNFT\n"; + print LOUT "nslookup.exe-BNFT\n"; + print LOUT "delv.exe-BNFT\n"; + print LOUT "arpaname.exe-BNFT\n"; + print LOUT "nsec3hash.exe-BNFF\n"; + print LOUT "genrandom.exe-BNFF\n"; + print LOUT "rndc-confgen.exe-BNFF\n"; + print LOUT "ddns-confgen.exe-BNFF\n"; + print LOUT "tsig-keygen.exe-BNFF\n"; + print LOUT "dnssec-keygen.exe-BNFF\n"; + print LOUT "dnssec-signzone.exe-BNFF\n"; + print LOUT "dnssec-dsfromkey.exe-BNFF\n"; + print LOUT "dnssec-importkey.exe-BNFF\n"; + print LOUT "dnssec-keyfromlabel.exe-BNFF\n"; + print LOUT "dnssec-revoke.exe-BNFF\n"; + print LOUT "dnssec-settime.exe-BNFF\n"; + print LOUT "dnssec-verify.exe-BNFF\n"; + print LOUT "named-checkconf.exe-BNFF\n"; + print LOUT "named-checkzone.exe-BNFF\n"; + print LOUT "named-compilezone.exe-BNFF\n"; + print LOUT "named-journalprint.exe-BNFF\n"; + print LOUT "named-rrchecker.exe-BNFF\n"; + print LOUT "isc-hmax-fixup.exe-BNFF\n"; + if ($use_pkcs11 eq "yes") { + print LOUT "pkcs11-destroy.exe-BNFF\n"; + print LOUT "pkcs11-keygen.exe-BNFF\n"; + print LOUT "pkcs11-list.exe-BNFF\n"; + print LOUT "pkcs11-tokens.exe-BNFF\n"; + } + if ($use_python eq "yes") { + print LOUT "dnssec-checkds.py-BNFF\n"; + print LOUT "dnssec-coverage.py-BNFF\n"; + } + print LOUT "readme1st.txt-BTFT\n"; + close LOUT; +} + # Status if ($verbose) { @@ -2579,6 +2677,8 @@ if (($want_win32 eq "yes") || ($want_x64 eq "yes")) { makesrcid(); + makeinstallfile(); + print "Configured.\n"; } else { print "add win32 or x64 to commit configuration to build files\n"; diff --git a/win32utils/build.txt b/win32utils/build.txt index c5b9ca2f87..721ecdbd40 100644 --- a/win32utils/build.txt +++ b/win32utils/build.txt @@ -1,10 +1,9 @@ -Copyright (C) 2013, 2014 Internet Systems Consortium, Inc. ("ISC") +Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC") See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. - BIND 9.10 for Win32 Source Build Instructions. 11-Jul-2013 + BIND 9.10 for Win32 Source Build Instructions. 17-Apr-2015 -Building BIND 9.10 on Windows XP/Vista/7/8 or server 2003/2008/2008R2 -has the following prerequisites: +Building BIND 9.10 on Windows has the following prerequisites: 1) You need to install Perl for Windows. ActivePerl (http://www.activestate.com/) and Strawberry Perl @@ -30,8 +29,11 @@ and built on the system on which you are building BIND. 5) The BIND Installer (BINDInstall) includes a copy of the redistributable runtime object vcredist_x86.exe (or vcredist_x64.exe), which is included with Visual Studio and can be downloaded from -Microsoft. This file must be in place prior to running the build -setup script. +Microsoft. This file must be in place prior to running Configure. + +6) BIND is known to run on the following versions of Windows: +Windows XP (with Service Pack 2 or higher), Vista, 7, 8, Server 2003, +Server 2008, Server 2008R2, and Server 2012. Step 1: Download and build OpenSSL @@ -40,32 +42,43 @@ Step 1: Download and build OpenSSL Download and untar the OpenSSL sources from http://www.openssl.org/. Extract them at in the same directory in which you extracted the BIND 9 - source: If BIND 9 is in \build\bind-9.10.0, for instance, OpenSSL should - be in \build\openssl-1.0.1g (subject to version number changes). + source: If BIND 9 is in \build\bind-9.10.2, for instance, OpenSSL should + be in \build\openssl-1.0.2a (subject to version number changes). Note: Building OpenSSL requires that you install Perl as it uses it during its build process. The following commands work as of - openssl-1.0.1g, but you should check the OpenSSL distribution to see + openssl-1.0.2a, but you should check the OpenSSL distribution to see if the build instructions in the INSTALL.W32 (or INSTALL.W64) file have changed, in particular for the assembler options: - cd openssl-1.0.1g - perl Configure --prefix=c:/openssl enable-static-engine VC-WIN32 - ms\do_ms - nmake /f ms\ntdll.mak + 32-bit builds: + (In an x86 Visual Studio Command Prompt window) + cd openssl-1.0.2a + perl Configure --prefix=c:\openssl enable-static-engine VC-WIN32 + ms\do_ms + nmake /f ms\ntdll.mak - For 64 bit build, replace VC-WIN32 by VC-WIN64A. - The enable-static-engine is needed when an OpenSSL engine will be - used, so with GOST support (configured by default) and/or PKCS #11 - support. + 64-bit builds: + (In an x64 Visual Studio Command Prompt window) + cd openssl-1.0.2a + perl Configure --prefix=c:\openssl64 enable-static-engine VC-WIN64A + ms\do_win64a + nmake /f ms\ntdll.mak - If you wish to use PKCS #11 to control a cryptographic hardware - service module, please see "PKCS #11 (Cryptoki) support" in chapter 4 - of the BIND 9 Administrator Reference Guide. You will need to apply - the patch in bind9\bin\pkcs11\openssl-1.0.1g-patch (this can be done - using the Cygwin 'patch' utility) and add --pk11-libname and + The "enable-static-engine" option is needed when an OpenSSL engine + will be used -- for example, when using the GOST signing algorithm or + OpenSSL-based PKCS#11 support. + + If you wish to use OpenSSL-based PKCS#11 to control a cryptographic + hardware service module, please see "PKCS#11 (Cryptoki) support" in + chapter 4 of the BIND 9 Administrator Reference Guide. You will need to + apply the patch in bind9\bin\pkcs11\openssl-1.0.2a-patch (this can be + done using the Cygwin 'patch' utility) and add --pk11-libname and --pk11-flavor to the Configure command above. + If you don't have the required assembler (nasm), just add 'no-asm' + to the configure arguments. + Step 2: Download and build LibXML2 LibXML2 is required to use the statistics channel. If you wish to @@ -73,57 +86,72 @@ Step 2: Download and build LibXML2 Download and untar the libxml2 sources from ftp://xmlsoft.org/libxml2. Extract them in the same directory in which you extracted the BIND 9 - source: If BIND 9 is in \build\bind-9.10.0, for instance, libxml2 should - be in \build\libxml2-2.9.1 (subject to version number changes). + source: If BIND 9 is in \build\bind-9.10.2, for instance, libxml2 should + be in \build\libxml2-2.9.2 (subject to version number changes). Now build libxml2, and copy the resulting files into the include and lib directories: - cd libxml2-2.9.1\win32 - cscript configure.js compiler=msvc vcmanifest=yes static=yes \ - debug=no iconv=no - nmake /f Makefile.msvc libxml + cd libxml2-2.9.2\win32 + cscript configure.js compiler=msvc vcmanifest=yes static=yes \ + debug=no iconv=no + nmake /f Makefile.msvc libxml -Step 3: Download and build optional external packages (GeoIP, readline) + Note some recent distributions show 2 bugs: some files are extracted + with no writable rights, cscript tries to open the configure.in file + (in the libxml2-2.9.2 directory) when the correct file is configure.ac + so raises a 'not found' error. - 3a) GeoIP is required to use IP geolocation. If you wish to build - BIND 9 without support for this feature, skip to step 3b. The URL is: - http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.5.1.tar.gz +Step 3: Download and build GeoIP - The current (version 1.5.1) GeoIP does not build a suitable - DLL with safe threading. The GeoIP.diff file: - - fixes WIN32 building support - - makes pread() safe in a multi-threaded system - - changes the Makefile.vc to build a DLL in place of a static - library (BTW this is required by the previous point) + Geographic ("geoip") ACLs require libGeoIP. If you wish to build BIND 9 + without support for this feature, skip to step 4. - 3b) The readline library adds command-line editing in nslookup and - nsupdate. If you wish to build BIND 9 without support for this feature, - skip to step 4. + The libGeoIP source code is available from: + + https://github.com/maxmind/geoip-api-c/releases. + + As of this writing, the current version of libGeoIP is 1.6.0. There + is a known bug in this and all prior versions which prevents it from + building a suitable DLL with thread support on Windows. You can apply + the patch file bind9/win32utils/GeoIP.diff to address the problem. + This patch has been submitted upstream, and will be included in + future versions of libGeoIP. + +Step 4: Download and build Readline + + The readline library adds command-line editing in nslookup and nsupdate. + If you wish to build BIND 9 without support for this feature, skip to + step 5. Because the original GNU source for the readline library has no WIN32 - support, it will be necessary to download a version of the static - readline library source that is ready to be built by Visual Studio. - One such version is available at: - http://gpsim.sourceforge.net/gpsimWin32/packages/readline-5.2-20061112-src.zip + support, it will be necessary to download a version of the static + readline library source that is ready to be built by Visual Studio. One + such version is available at: -Step 4: Make the redistributable runtime object available + http://gpsim.sourceforge.net/gpsimWin32/gpsimWin32.html#readline_lib + + Note: Windows command (cmd.exe) provides an integrated line edition + feature so it is not recommended to configure bind with readline. + +Step 5: Make the redistributable runtime object available Check that the Microsoft redistributable object (vcredist_x86.exe or vcredist_x64.exe) is available to the build. The file may be placed in the directory in which the BIND 9 source was extracted (for - instance, if BIND 9 is in \build\bind-9.10.0, the redistributable + instance, if BIND 9 is in \build\bind-9.10.2, the redistributable may be placed in \build\vcredist_x86.exe). Or, the path to the file can be specified via the VCREDIST_PATH environment variable, or via the "with-vcredist=PATH" option to the configuration script (see - step 4). + step 4). If none of these options is used, Configure will attempt to + find the redistributable based on clues in the build environment. -Step 5: Configuring the BIND build +Step 6: Configuring the BIND build From the command prompt, cd to the win32utils directory under the BIND 9 root: - cd bind-9.10.0\win32utils + cd bind-9.10.2\win32utils In this directory, you can prepare the Windows build by running: @@ -142,28 +170,31 @@ Step 5: Configuring the BIND build perl Configure clean -Step 5: Building BIND +Step 7: Building BIND To build using 'nmake' or older versions of Visual Studio (e.g. - VS 2005 and 2008), go to the legacy subdirectory: + VS 2005 or VS 2008), go to the legacy subdirectory: cd legacy - and follow the instructions in win32-build.txt. Note that - only 32 bit builds are supported in this mode. + and follow the instructions in win32-build.txt. - To build using the Visual Studio GUI (VS 2010 and 2012): open the bind9.sln - solution file; this will load the project files for all of the BIND 9 - libraries and applications. Select "Build->Batch Build", click "Select - All", then click "Build". + Note: Only 32-bit builds are supported in this mode. - To build using MSBuild (VS 2010 and 2012): call MSBuild on the - bind9.sln solution file: + To build using the Visual Studio GUI in VS 2010 or VS 2012: + open the bind9.sln solution file; this will load the project + files for all of the BIND 9 libraries and applications. Select + "Build->Batch Build", click "Select All", then click "Build". - msbuild /t:Build /p:Configuration=Release && \ - msbuild /t:Build /p:Configuration=Debug + To build using MSBuild in VS 2010 or VS 2012: call MSBuild on + the bind9.sln solution file: -Step 6: Install + msbuild /t:Build /p:Configuration=Release bind9.sln + msbuild /t:Build /p:Configuration=Debug bind9.sln + + Note: This mode does not support building for Windows XP. + +Step 8: Install Installation is accomplished by running the BINDInstall program. All DLL's are copied to the Program Files area and all applications @@ -177,5 +208,14 @@ Step 6: Install Visual Studio. The other BIND 9 libraries and applications do not have this dependency. + The very last version of BINDInstall uses two files created by + the Configure perl script: + - InstallFlags: 32/64 bit build, and/or should the redistributable + object be run. + - InstallFiles: the list of files to install with for each files + 4 flags (destination, importance, check version and part of tools). + The idea is to be able to use any BINDInstall.exe binary so + a non-free version of Visual Studio is no longer required. + Please report bugs, whether in the process of building the application or in BIND 9 itself, to bind9-bugs@isc.org. diff --git a/win32utils/legacy/BuildSetup.bat.in b/win32utils/legacy/BuildSetup.bat.in index ddfeac3a42..c1afdd59ee 100644 --- a/win32utils/legacy/BuildSetup.bat.in +++ b/win32utils/legacy/BuildSetup.bat.in @@ -143,6 +143,13 @@ rem copy /Y @VCREDIST_PATH@ ..\..\Build\Release\ copy /Y @VCREDIST_PATH@ ..\..\Build\Debug\ +echo Copying install files (flags and file list). + +copy ..\InstallFlags ..\..\Build\Release\ +copy ..\InstallFlags ..\..\Build\Debug\ +copy ..\InstallFiles ..\..\Build\Release\ +copy ..\InstallFiles ..\..\Build\Debug\ + @IF TESTS cd ..\..\bin\tests\dst copy "Kdh.+002+18602.key.in" "Kdh.+002+18602.key"