diff options
author | LaMont Jones <lamont@debian.org> | 2009-11-16 19:26:14 -0600 |
---|---|---|
committer | LaMont Jones <lamont@debian.org> | 2009-11-16 19:26:14 -0600 |
commit | e3246fedd37d119c2bf6efb28d7492b3a595373a (patch) | |
tree | aed2129efc2efb2bb526e1e4abf9080d3ec9ab6b /bin/win32/BINDInstall | |
parent | f133ad6c8e92691761b732d65cca85e4e27d6f51 (diff) | |
download | bind9-e3246fedd37d119c2bf6efb28d7492b3a595373a.tar.gz |
9.7.0a3
Diffstat (limited to 'bin/win32/BINDInstall')
-rw-r--r-- | bin/win32/BINDInstall/BINDInstall.rc | 110 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstallDlg.cpp | 218 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstallDlg.h | 13 | ||||
-rw-r--r-- | bin/win32/BINDInstall/resource.h | 1 |
4 files changed, 176 insertions, 166 deletions
diff --git a/bin/win32/BINDInstall/BINDInstall.rc b/bin/win32/BINDInstall/BINDInstall.rc index 8bcb636b..8e947346 100644 --- a/bin/win32/BINDInstall/BINDInstall.rc +++ b/bin/win32/BINDInstall/BINDInstall.rc @@ -1,4 +1,4 @@ -//Microsoft Developer Studio generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE BEGIN "#define _AFX_NO_SPLITTER_RESOURCES\r\n" "#define _AFX_NO_OLE_RESOURCES\r\n" @@ -66,73 +66,65 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "res\\BINDInstall.ico" +IDR_MAINFRAME ICON "res\\BINDInstall.ico" ///////////////////////////////////////////////////////////////////////////// // // Dialog // -IDD_BINDINSTALL_DIALOG DIALOGEX 0, 0, 210, 301 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU +IDD_BINDINSTALL_DIALOG DIALOGEX 0, 0, 210, 311 +STYLE DS_SETFONT | 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",0,0,0x1 +FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN EDITTEXT IDC_TARGETDIR,7,62,196,14,ES_AUTOHSCROLL EDITTEXT IDC_ACCOUNT_NAME,7,94,196,14,ES_AUTOHSCROLL - EDITTEXT IDC_ACCOUNT_PASSWORD,7,122,196,14,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDC_ACCOUNT_PASSWORD_CONFIRM,7,151,196,14,ES_PASSWORD | - ES_AUTOHSCROLL + EDITTEXT IDC_ACCOUNT_PASSWORD,7,122,196,14,ES_PASSWORD | ES_AUTOHSCROLL + EDITTEXT IDC_ACCOUNT_PASSWORD_CONFIRM,7,151,196,14,ES_PASSWORD | ES_AUTOHSCROLL DEFPUSHBUTTON "&Install",IDC_INSTALL,153,7,50,14 PUSHBUTTON "E&xit",IDC_EXIT,153,39,50,14 - CONTROL "&Automatic Startup",IDC_AUTO_START,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,14,190,72,10 + CONTROL "&Tools Only",IDC_TOOLS_ONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,185,72,10 + CONTROL "&Automatic Startup",IDC_AUTO_START,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,195,72,10 CONTROL "&Keep Config Files After Uninstall",IDC_KEEP_FILES, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,200,116,10 - CONTROL "&Start BIND Service After Install",IDC_START,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,14,210,113,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,205,116,10 + CONTROL "&Start BIND Service After Install",IDC_START,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,215,113,10 PUSHBUTTON "&Uninstall",IDC_UNINSTALL,153,23,50,14 PUSHBUTTON "Browse",IDC_BROWSE,7,22,50,14 LTEXT "Target Directory:",IDC_STATIC,7,53,54,8 - GROUPBOX "Progress",IDC_STATIC,7,224,196,70 - RTEXT "",IDC_COPY_TAG,14,261,78,8 - LTEXT "",IDC_COPY_FILE,105,261,90,8 - RTEXT "",IDC_SERVICE_TAG,15,271,77,8 - LTEXT "",IDC_REG_SERVICE,105,271,89,8 - RTEXT "",IDC_MESSAGE_TAG,15,281,77,8 - LTEXT "",IDC_REG_MESSAGE,105,281,88,8 - RTEXT "",IDC_DIR_TAG,15,251,77,8 - GROUPBOX "Options",IDC_STATIC,7,172,196,49 - CTEXT "Version Unknown",IDC_VERSION,7,7,61,10,SS_CENTERIMAGE | - SS_SUNKEN - RTEXT "Current Operation:",IDC_CURRENT_TAG,34,235,58,8 - LTEXT "",IDC_CURRENT,105,235,90,8 - LTEXT "",IDC_CREATE_DIR,105,251,88,8 + GROUPBOX "Progress",IDC_STATIC,7,234,196,70 + RTEXT "",IDC_COPY_TAG,14,271,78,8 + LTEXT "",IDC_COPY_FILE,105,271,90,8 + RTEXT "",IDC_SERVICE_TAG,15,281,77,8 + LTEXT "",IDC_REG_SERVICE,105,281,89,8 + RTEXT "",IDC_MESSAGE_TAG,15,291,77,8 + LTEXT "",IDC_REG_MESSAGE,105,291,88,8 + RTEXT "",IDC_DIR_TAG,15,261,77,8 + GROUPBOX "Options",IDC_STATIC,7,172,196,60 + CTEXT "Version Unknown",IDC_VERSION,7,7,61,10,SS_CENTERIMAGE | SS_SUNKEN + RTEXT "Current Operation:",IDC_CURRENT_TAG,34,245,58,8 + LTEXT "",IDC_CURRENT,105,245,90,8 + LTEXT "",IDC_CREATE_DIR,105,261,88,8 LTEXT "Service Account Name",IDC_STATIC,7,84,74,8 LTEXT "Service Account Password",IDC_STATIC,7,112,86,8 - LTEXT "Confirm Service Account Password",IDC_STATIC,7,140,112, - 8 + LTEXT "Confirm Service Account Password",IDC_STATIC,7,140,112,8 END -IDD_BROWSE DIALOG DISCARDABLE 0, 0, 227, 117 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_BROWSE DIALOG 0, 0, 227, 117 +STYLE DS_SETFONT | 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 + 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 + COMBOBOX IDC_DRIVES,170,98,50,74,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END -IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG1 DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Dialog" FONT 8, "MS Sans Serif" BEGIN @@ -141,7 +133,6 @@ BEGIN END -#ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version @@ -164,18 +155,14 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Internet Software Consortium\0" - VALUE "FileDescription", "ISC BIND Install Utility\0" - VALUE "FileVersion", "2.0.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.3.0\0" - VALUE "SpecialBuild", "\0" + VALUE "CompanyName", "Internet Software Consortium" + VALUE "FileDescription", "ISC BIND Install Utility" + VALUE "FileVersion", "2.0.0" + VALUE "InternalName", "BINDInstall" + VALUE "LegalCopyright", "Copyright © 2000" + VALUE "OriginalFilename", "BINDInstall.EXE" + VALUE "ProductName", "ISC BIND" + VALUE "ProductVersion", "9.7.0" END END BLOCK "VarFileInfo" @@ -184,8 +171,6 @@ BEGIN END END -#endif // !_MAC - ///////////////////////////////////////////////////////////////////////////// // @@ -193,7 +178,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO BEGIN IDD_BINDINSTALL_DIALOG, DIALOG BEGIN @@ -212,6 +197,7 @@ BEGIN HORZGUIDE, 265 HORZGUIDE, 275 HORZGUIDE, 285 + HORZGUIDE, 295 END IDD_BROWSE, DIALOG @@ -238,7 +224,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN IDS_MAINFRAME "BIND 9 Installer" IDS_CREATEDIR "Directory %s does not exist.\nDo you wish to create it?" @@ -253,7 +239,7 @@ BEGIN IDS_UNINSTALL_DONE "BIND Uninstall Completed" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN IDS_CREATE_KEY "Creating BIND registry key" IDS_ADD_REMOVE "Setting up Add/Remove Programs entry" @@ -273,7 +259,7 @@ BEGIN IDS_START_SERVICE "Starting BIND service" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN IDS_UNINSTALL_DIR "Remove Directories..." IDS_UNINSTALL_FILES "Delete Files..." @@ -293,7 +279,7 @@ BEGIN IDS_ERR_CREATE_KEY "An error occured while creating registry keys\n(%s)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN IDS_ERR_SET_VALUE "An error occured while setting registry key values\n(%s)" IDS_NO_VERSION "Version Unknown" diff --git a/bin/win32/BINDInstall/BINDInstallDlg.cpp b/bin/win32/BINDInstall/BINDInstallDlg.cpp index 2a43a85f..a0976641 100644 --- a/bin/win32/BINDInstall/BINDInstallDlg.cpp +++ b/bin/win32/BINDInstall/BINDInstallDlg.cpp @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: BINDInstallDlg.cpp,v 1.42 2009/07/17 06:25:42 each Exp $ */ +/* $Id: BINDInstallDlg.cpp,v 1.44 2009/09/01 06:51:47 marka Exp $ */ /* * Copyright (c) 1999-2000 by Nortel Networks Corporation @@ -69,6 +69,8 @@ #define MAX_GROUPS 100 #define MAX_PRIVS 50 +#define LOCAL_SERVICE "NT AUTHORITY\\LocalService" + #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE @@ -102,61 +104,60 @@ typedef struct _filedata { int destination; int importance; BOOL checkVer; - + BOOL withTools; } FileData; const FileData installFiles[] = { #ifdef BINARIES_INSTALL # ifdef DEBUG_BINARIES - {"msvcrtd.dll", FileData::WinSystem, FileData::Critical, TRUE}, + {"msvcrtd.dll", FileData::WinSystem, FileData::Critical, TRUE, TRUE}, # endif # ifdef RELEASE_BINARIES - {"msvcrt.dll", FileData::WinSystem, FileData::Critical, TRUE}, + {"msvcrt.dll", FileData::WinSystem, FileData::Critical, TRUE, TRUE}, # endif #endif #if _MSC_VER < 1400 #if _MSC_VER >= 1310 - {"mfc71.dll", FileData::WinSystem, FileData::Critical, TRUE}, - {"msvcr71.dll", FileData::WinSystem, FileData::Critical, TRUE}, + {"mfc71.dll", FileData::WinSystem, FileData::Critical, TRUE, TRUE}, + {"msvcr71.dll", FileData::WinSystem, FileData::Critical, TRUE, TRUE}, #elif _MSC_VER > 1200 && _MSC_VER < 1310 - {"mfc70.dll", FileData::WinSystem, FileData::Critical, TRUE}, - {"msvcr70.dll", FileData::WinSystem, FileData::Critical, TRUE}, + {"mfc70.dll", FileData::WinSystem, FileData::Critical, TRUE, TRUE}, + {"msvcr70.dll", FileData::WinSystem, FileData::Critical, TRUE, TRUE}, #endif #endif - {"bindevt.dll", FileData::BinDir, FileData::Normal, FALSE}, - {"libbind9.dll", FileData::BinDir, FileData::Critical, FALSE}, - {"libisc.dll", FileData::BinDir, FileData::Critical, FALSE}, - {"libisccfg.dll", FileData::BinDir, FileData::Critical, FALSE}, - {"libisccc.dll", FileData::BinDir, FileData::Critical, FALSE}, - {"libdns.dll", FileData::BinDir, FileData::Critical, FALSE}, - {"liblwres.dll", FileData::BinDir, FileData::Critical, FALSE}, - {"libeay32.dll", FileData::BinDir, FileData::Critical, FALSE}, + {"bindevt.dll", FileData::BinDir, FileData::Normal, FALSE, TRUE}, + {"libbind9.dll", FileData::BinDir, FileData::Critical, FALSE, TRUE}, + {"libisc.dll", FileData::BinDir, FileData::Critical, FALSE, TRUE}, + {"libisccfg.dll", FileData::BinDir, FileData::Critical, FALSE, TRUE}, + {"libisccc.dll", FileData::BinDir, FileData::Critical, FALSE, TRUE}, + {"libdns.dll", FileData::BinDir, FileData::Critical, FALSE, TRUE}, + {"liblwres.dll", FileData::BinDir, FileData::Critical, FALSE, TRUE}, + {"libeay32.dll", FileData::BinDir, FileData::Critical, FALSE, TRUE}, #ifdef HAVE_LIBXML2 - {"libxml2.dll", FileData::BinDir, FileData::Critical, FALSE}, + {"libxml2.dll", FileData::BinDir, FileData::Critical, FALSE, TRUE}, #endif - {"named.exe", FileData::BinDir, FileData::Critical, FALSE}, - {"nsupdate.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"BINDInstall.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"rndc.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"dig.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"host.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"nslookup.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"rndc-confgen.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"ddns-confgen.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"dnssec-keygen.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"dnssec-signzone.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"dnssec-dsfromkey.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"dnssec-keyfromlabel.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"dnssec-revoke.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"named-checkconf.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"named-checkzone.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"named-compilezone.exe", FileData::BinDir, FileData::Normal, FALSE}, - {"readme1st.txt", FileData::BinDir, FileData::Trivial, FALSE}, + {"named.exe", FileData::BinDir, FileData::Critical, FALSE, FALSE}, + {"nsupdate.exe", FileData::BinDir, FileData::Normal, FALSE, TRUE}, + {"BINDInstall.exe", FileData::BinDir, FileData::Normal, FALSE, TRUE}, + {"rndc.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"dig.exe", FileData::BinDir, FileData::Normal, FALSE, TRUE}, + {"host.exe", FileData::BinDir, FileData::Normal, FALSE, TRUE}, + {"nslookup.exe", FileData::BinDir, FileData::Normal, FALSE, TRUE}, + {"rndc-confgen.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"ddns-confgen.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"dnssec-keygen.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"dnssec-signzone.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"dnssec-dsfromkey.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"dnssec-keyfromlabel.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"dnssec-revoke.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"named-checkconf.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"named-checkzone.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"named-compilezone.exe", FileData::BinDir, FileData::Normal, FALSE, FALSE}, + {"readme1st.txt", FileData::BinDir, FileData::Trivial, FALSE, TRUE}, {NULL, -1, -1} }; - ///////////////////////////////////////////////////////////////////////////// // CBINDInstallDlg dialog @@ -167,6 +168,7 @@ CBINDInstallDlg::CBINDInstallDlg(CWnd* pParent /*=NULL*/) //{{AFX_DATA_INIT(CBINDInstallDlg) m_targetDir = _T(""); m_version = _T(""); + m_toolsOnly = FALSE; m_autoStart = FALSE; m_keepFiles = FALSE; m_current = _T(""); @@ -201,6 +203,7 @@ void CBINDInstallDlg::DoDataExchange(CDataExchange* pDX) { DDX_Text(pDX, IDC_ACCOUNT_NAME, m_accountName); DDX_Text(pDX, IDC_ACCOUNT_PASSWORD, m_accountPassword); DDX_Text(pDX, IDC_ACCOUNT_PASSWORD_CONFIRM, m_accountPasswordConfirm); + DDX_Check(pDX, IDC_TOOLS_ONLY, m_toolsOnly); DDX_Check(pDX, IDC_AUTO_START, m_autoStart); DDX_Check(pDX, IDC_KEEP_FILES, m_keepFiles); DDX_Text(pDX, IDC_CURRENT, m_current); @@ -409,48 +412,55 @@ void CBINDInstallDlg::OnInstall() { UpdateData(); - /* - * Check that the Passwords entered match. - */ - if (m_accountPassword != m_accountPasswordConfirm) { - MsgBox(IDS_ERR_PASSWORD); - return; - } + if (!m_toolsOnly && m_accountName != LOCAL_SERVICE) { + /* + * Check that the Passwords entered match. + */ + if (m_accountPassword != m_accountPasswordConfirm) { + MsgBox(IDS_ERR_PASSWORD); + return; + } - /* - * Check that there is not leading / trailing whitespace. - * This is for compatibility with the standard password dialog. - * Passwords really should be treated as opaque blobs. - */ - oldlen = m_accountPassword.GetLength(); - m_accountPassword.TrimLeft(); - m_accountPassword.TrimRight(); - if (m_accountPassword.GetLength() != oldlen) { - MsgBox(IDS_ERR_WHITESPACE); - return; - } + /* + * Check that there is not leading / trailing whitespace. + * This is for compatibility with the standard password dialog. + * Passwords really should be treated as opaque blobs. + */ + oldlen = m_accountPassword.GetLength(); + m_accountPassword.TrimLeft(); + m_accountPassword.TrimRight(); + if (m_accountPassword.GetLength() != oldlen) { + MsgBox(IDS_ERR_WHITESPACE); + return; + } - /* - * Check the entered account name. - */ - if (ValidateServiceAccount() == FALSE) - return; + /* + * Check the entered account name. + */ + if (ValidateServiceAccount() == FALSE) + return; - /* - * For Registration we need to know if account was changed. - */ - if (m_accountName != m_currentAccount) - m_accountUsed = FALSE; + /* + * For Registration we need to know if account was changed. + */ + if (m_accountName != m_currentAccount) + m_accountUsed = FALSE; - if (m_accountUsed == FALSE && m_serviceExists == FALSE) - { - /* - * Check that the Password is not null. - */ - if (m_accountPassword.GetLength() == 0) { - MsgBox(IDS_ERR_NULLPASSWORD); - return; + if (m_accountUsed == FALSE && m_serviceExists == FALSE) + { + /* + * Check that the Password is not null. + */ + if (m_accountPassword.GetLength() == 0) { + MsgBox(IDS_ERR_NULLPASSWORD); + return; + } } + } else if (m_accountName == LOCAL_SERVICE) { + /* The LocalService always exists. */ + m_accountExists = TRUE; + if (m_accountName != m_currentAccount) + m_accountUsed = FALSE; } /* Directories */ @@ -473,14 +483,16 @@ void CBINDInstallDlg::OnInstall() { } } - if (m_accountExists == FALSE) { - success = CreateServiceAccount(m_accountName.GetBuffer(30), - m_accountPassword.GetBuffer(30)); - if (success == FALSE) { - MsgBox(IDS_CREATEACCOUNT_FAILED); - return; + if (!m_toolsOnly) { + if (m_accountExists == FALSE) { + success = CreateServiceAccount(m_accountName.GetBuffer(30), + m_accountPassword.GetBuffer(30)); + if (success == FALSE) { + MsgBox(IDS_CREATEACCOUNT_FAILED); + return; + } + m_accountExists = TRUE; } - m_accountExists = TRUE; } ProgramGroup(FALSE); @@ -505,7 +517,8 @@ void CBINDInstallDlg::OnInstall() { try { CreateDirs(); CopyFiles(); - RegisterService(); + if (!m_toolsOnly) + RegisterService(); RegisterMessages(); HKEY hKey; @@ -606,6 +619,8 @@ void CBINDInstallDlg::CopyFiles() { CString destFile; for (int i = 0; installFiles[i].filename; i++) { + if (m_toolsOnly && !installFiles[i].withTools) + continue; SetCurrent(IDS_COPY_FILE, installFiles[i].filename); destFile = DestDir(installFiles[i].destination) + "\\" + @@ -720,13 +735,16 @@ CBINDInstallDlg::GetCurrentServiceAccountName() { } RegCloseKey(hKey); - if(keyFound == FALSE) + if (keyFound == FALSE) m_accountName = ""; - else { - /* - * LocalSystem is not a regular account and is equivalent - * to no account but with lots of privileges - */ + else if (!strcmp(accountName, LOCAL_SERVICE)) { + m_accountName = LOCAL_SERVICE; + m_accountUsed = TRUE; + } else { + /* + * LocalSystem is not a regular account and is equivalent + * to no account but with lots of privileges + */ Tmp = accountName; if (Tmp == ".\\LocalSystem") m_accountName = ""; @@ -782,20 +800,23 @@ void CBINDInstallDlg::RegisterService() { SC_HANDLE hSCManager; SC_HANDLE hService; - CString StartName = ".\\" + m_accountName; + CString StartName; + if (m_accountName == LOCAL_SERVICE) + StartName = LOCAL_SERVICE; + else + StartName = ".\\" + m_accountName; /* * We need to change the service rather than create it * if the service already exists. Do nothing if we are already * using that account */ - if(m_serviceExists == TRUE) { - if(m_accountUsed == FALSE) { - UpdateService(); + if (m_serviceExists == TRUE) { + if (m_accountUsed == FALSE) { + UpdateService(StartName); SetItemStatus(IDC_REG_SERVICE); return; - } - else { + } else { SetItemStatus(IDC_REG_SERVICE); return; } @@ -834,10 +855,12 @@ CBINDInstallDlg::RegisterService() { } void -CBINDInstallDlg::UpdateService() { +CBINDInstallDlg::UpdateService(CString StartName) { SC_HANDLE hSCManager; SC_HANDLE hService; - CString StartName = ".\\" + m_accountName; + + if(m_toolsOnly) + return; SetCurrent(IDS_OPEN_SCM); hSCManager= OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); @@ -864,11 +887,10 @@ CBINDInstallDlg::UpdateService() { if (hSCManager) CloseServiceHandle(hSCManager); return; - } - else { + } else { if (ChangeServiceConfig(hService, dwServiceType, dwStart, SERVICE_ERROR_NORMAL, namedLoc, NULL, NULL, NULL, - StartName, m_accountPassword,BIND_DISPLAY_NAME) + StartName, m_accountPassword, BIND_DISPLAY_NAME) != TRUE) { DWORD err = GetLastError(); MsgBox(IDS_ERR_UPDATE_SERVICE, GetErrMessage()); diff --git a/bin/win32/BINDInstall/BINDInstallDlg.h b/bin/win32/BINDInstall/BINDInstallDlg.h index 597f7a36..9cbc4c4c 100644 --- a/bin/win32/BINDInstall/BINDInstallDlg.h +++ b/bin/win32/BINDInstall/BINDInstallDlg.h @@ -1,5 +1,5 @@ /* - * Portions Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Portions Copyright (C) 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: BINDInstallDlg.h,v 1.8 2007/06/19 23:47:07 tbox Exp $ */ +/* $Id: BINDInstallDlg.h,v 1.11 2009/09/01 06:51:47 marka Exp $ */ /* * Copyright (c) 1999-2000 by Nortel Networks Corporation @@ -48,6 +48,7 @@ public: CString m_version; BOOL m_autoStart; BOOL m_keepFiles; + BOOL m_toolsOnly; CString m_current; BOOL m_startOnInstall; //}}AFX_DATA @@ -72,12 +73,12 @@ protected: void DeleteFiles(BOOL uninstall); void RegisterService(); - void UpdateService(); + void UpdateService(CString StartName); void UnregisterService(BOOL uninstall); void RegisterMessages(); void UnregisterMessages(BOOL uninstall); - + void FailedInstall(); void SetItemStatus(UINT nID, BOOL bSuccess = TRUE); @@ -91,7 +92,7 @@ protected: BOOL CheckBINDService(); void SetCurrent(int id, ...); void ProgramGroup(BOOL create = TRUE); - + HICON m_hIcon; CString m_defaultDir; CString m_etcDir; @@ -106,7 +107,7 @@ protected: CString m_accountPasswordConfirm; CString m_accountPassword; BOOL m_serviceExists; - + // Generated message map functions //{{AFX_MSG(CBINDInstallDlg) virtual BOOL OnInitDialog(); diff --git a/bin/win32/BINDInstall/resource.h b/bin/win32/BINDInstall/resource.h index 14b50846..b176fe09 100644 --- a/bin/win32/BINDInstall/resource.h +++ b/bin/win32/BINDInstall/resource.h @@ -90,6 +90,7 @@ #define IDC_ACCOUNT_NAME 1030 #define IDC_ACCOUNT_PASSWORD 1031 #define IDC_ACCOUNT_PASSWORD_CONFIRM 1032 +#define IDC_TOOLS_ONLY 1033 // Next default values for new objects // |