diff options
author | Internet Software Consortium, Inc <@isc.org> | 2007-09-07 14:15:23 -0600 |
---|---|---|
committer | LaMont Jones <lamont@debian.org> | 2007-09-07 14:15:23 -0600 |
commit | 708dfaae929e0746a1e6fb5100d2c74036e45adf (patch) | |
tree | 8e41d12e0a398d83e4b055867ea794f50d3dc337 /bin/win32/BINDInstall | |
parent | 00fa0dd5b9bb17deb8d2e96a2bc4234abaa9d5ac (diff) | |
download | bind9-708dfaae929e0746a1e6fb5100d2c74036e45adf.tar.gz |
9.3.0beta2
Diffstat (limited to 'bin/win32/BINDInstall')
-rw-r--r-- | bin/win32/BINDInstall/AccountInfo.cpp | 438 | ||||
-rw-r--r-- | bin/win32/BINDInstall/AccountInfo.h | 48 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstall.cpp | 5 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstall.dsp | 381 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstall.dsw | 58 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstall.h | 2 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstall.mak | 741 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstall.rc | 95 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstallDlg.cpp | 694 | ||||
-rw-r--r-- | bin/win32/BINDInstall/BINDInstallDlg.h | 16 | ||||
-rw-r--r-- | bin/win32/BINDInstall/DirBrowse.cpp | 2 | ||||
-rw-r--r-- | bin/win32/BINDInstall/DirBrowse.h | 2 | ||||
-rw-r--r-- | bin/win32/BINDInstall/StdAfx.h | 4 | ||||
-rw-r--r-- | bin/win32/BINDInstall/resource.h | 15 |
14 files changed, 1539 insertions, 962 deletions
diff --git a/bin/win32/BINDInstall/AccountInfo.cpp b/bin/win32/BINDInstall/AccountInfo.cpp new file mode 100644 index 00000000..88a99a46 --- /dev/null +++ b/bin/win32/BINDInstall/AccountInfo.cpp @@ -0,0 +1,438 @@ +/* + * Portions Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 2001, 2002 Internet Software Consortium. + * + * 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 ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC 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. + */ + +/* $Id: AccountInfo.cpp,v 1.5.224.3 2004/03/08 09:04:21 marka Exp $ */ + +#ifndef UNICODE +#define UNICODE +#endif /* UNICODE */ + +#include "stdafx.h" + +#include <windows.h> +#include <lm.h> +#include <ntsecapi.h> + +#include <isc/ntgroups.h> +#include <isc/result.h> +#include "AccountInfo.h" + +#define MAX_NAME_LENGTH 256 + +NTSTATUS +OpenPolicy( + LPWSTR ServerName, /* machine to open policy on (Unicode) */ + DWORD DesiredAccess, /* desired access to policy */ + PLSA_HANDLE PolicyHandle /* resultant policy handle */ + ); + +BOOL +GetAccountSid( + LPTSTR SystemName, /* where to lookup account */ + LPTSTR AccountName, /* account of interest */ + PSID *Sid /* resultant buffer containing SID */ + ); + +NTSTATUS +SetPrivilegeOnAccount( + LSA_HANDLE PolicyHandle, /* open policy handle */ + PSID AccountSid, /* SID to grant privilege to */ + LPWSTR PrivilegeName, /* privilege to grant (Unicode) */ + BOOL bEnable /* enable or disable */ + ); + +NTSTATUS +GetPrivilegesOnAccount( + LSA_HANDLE PolicyHandle, /* open policy handle */ + PSID AccountSid, /* SID to grant privilege to */ + wchar_t **PrivList, /* Ptr to List of Privileges found */ + unsigned int *PrivCount /* total number of Privileges in list */ + ); + +NTSTATUS +AddPrivilegeToAcccount( + LPTSTR AccountName, /* Name of the account */ + LPWSTR PrivilegeName /* Privilege to Add */ + ); + +void +InitLsaString( + PLSA_UNICODE_STRING LsaString, /* destination */ + LPWSTR String /* source (Unicode) */ + ); + +void +DisplayNtStatus( + LPSTR szAPI, /* pointer to function name (ANSI) */ + NTSTATUS Status /* NTSTATUS error value */ + ); + +void +DisplayWinError( + LPSTR szAPI, /* pointer to function name (ANSI) */ + DWORD WinError /* DWORD WinError */ + ); + +#ifndef STATUS_SUCCESS +#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) +#endif + +/* + * Note that this code only retrieves the list of privileges of the + * requested account or group. However, all accounts belong to the + * Everyone group even though that group is not returned by the + * calls to get the groups to which that account belongs. + * The Everyone group has two privileges associated with it: + * SeChangeNotifyPrivilege and SeNetworkLogonRight + * It is not advisable to disable or remove these privileges + * from the group nor can the account be removed from the Everyone + * group + * The None group has no privileges associated with it and is the group + * to which an account belongs if it is associated with no group. + */ + +int +GetAccountPrivileges(char *name, wchar_t **PrivList, unsigned int *PrivCount, + char **Accounts, unsigned int *totalAccounts, + int maxAccounts) +{ + LSA_HANDLE PolicyHandle; + TCHAR AccountName[256]; /* static account name buffer */ + PSID pSid; + unsigned int i; + NTSTATUS Status; + isc_result_t istatus; + int iRetVal = RTN_ERROR; /* assume error from main */ + + /* + * Open the policy on the target machine. + */ + if ((Status = OpenPolicy(NULL, + POLICY_LOOKUP_NAMES, + &PolicyHandle)) != STATUS_SUCCESS) + return (RTN_ERROR); + + /* + * Let's see if the account exists. Return if not + */ + wsprintf(AccountName, TEXT("%hS"), name); + if (!GetAccountSid(NULL, AccountName, &pSid)) + return (RTN_NOACCOUNT); + /* + * Find out what groups the account belongs to + */ + istatus = isc_ntsecurity_getaccountgroups(name, Accounts, maxAccounts, + totalAccounts); + if (istatus == ISC_R_NOMEMORY) + return (RTN_NOMEMORY); + else if (istatus != ISC_R_SUCCESS) + return (RTN_ERROR); + + Accounts[*totalAccounts] = name; /* Add the account to the list */ + (*totalAccounts)++; + + /* + * Loop through each Account to get the list of privileges + */ + for (i = 0; i < *totalAccounts; i++) { + wsprintf(AccountName, TEXT("%hS"), Accounts[i]); + /* Obtain the SID of the user/group. */ + if (!GetAccountSid(NULL, AccountName, &pSid)) + continue; /* Try the next one */ + /* Get the Privileges allocated to this SID */ + if ((Status = GetPrivilegesOnAccount(PolicyHandle, pSid, + PrivList, PrivCount)) == STATUS_SUCCESS) + { + iRetVal=RTN_OK; + if (pSid != NULL) + HeapFree(GetProcessHeap(), 0, pSid); + } else { + if (pSid != NULL) + HeapFree(GetProcessHeap(), 0, pSid); + continue; /* Try the next one */ + } + } + /* + * Close the policy handle. + */ + LsaClose(PolicyHandle); + + (*totalAccounts)--; /* Correct for the number of groups */ + return iRetVal; +} + +BOOL +CreateServiceAccount(char *name, char *password) { + NTSTATUS retstat; + USER_INFO_1 ui; + DWORD dwLevel = 1; + DWORD dwError = 0; + NET_API_STATUS nStatus; + + unsigned int namelen = strlen(name); + unsigned int passwdlen = strlen(password); + wchar_t AccountName[MAX_NAME_LENGTH]; + wchar_t AccountPassword[MAX_NAME_LENGTH]; + + mbstowcs(AccountName, name, namelen + 1); + mbstowcs(AccountPassword, password, passwdlen + 1); + + /* + * Set up the USER_INFO_1 structure. + * USER_PRIV_USER: name is required here when creating an account + * rather than an administrator or a guest. + */ + + ui.usri1_name = (LPWSTR) &AccountName; + ui.usri1_password = (LPWSTR) &AccountPassword; + ui.usri1_priv = USER_PRIV_USER; + ui.usri1_home_dir = NULL; + ui.usri1_comment = L"ISC BIND Service Account"; + ui.usri1_flags = UF_PASSWD_CANT_CHANGE | UF_DONT_EXPIRE_PASSWD | + UF_SCRIPT; + ui.usri1_script_path = NULL; + /* + * Call the NetUserAdd function, specifying level 1. + */ + nStatus = NetUserAdd(NULL, dwLevel, (LPBYTE)&ui, &dwError); + + if (nStatus != NERR_Success) + return (FALSE); + + retstat = AddPrivilegeToAcccount(name, SE_SERVICE_LOGON_PRIV); + return (TRUE); +} + +NTSTATUS +AddPrivilegeToAcccount(LPTSTR name, LPWSTR PrivilegeName) { + LSA_HANDLE PolicyHandle; + TCHAR AccountName[256]; /* static account name buffer */ + PSID pSid; + NTSTATUS Status; + unsigned long err; + + /* + * Open the policy on the target machine. + */ + if ((Status = OpenPolicy(NULL, POLICY_ALL_ACCESS, &PolicyHandle)) + != STATUS_SUCCESS) + return (RTN_ERROR); + + /* + * Let's see if the account exists. Return if not + */ + wsprintf(AccountName, TEXT("%hS"), name); + if (!GetAccountSid(NULL, AccountName, &pSid)) + return (RTN_NOACCOUNT); + + err = LsaNtStatusToWinError(SetPrivilegeOnAccount(PolicyHandle, + pSid, PrivilegeName, TRUE)); + + LsaClose(PolicyHandle); + if (err == ERROR_SUCCESS) + return (RTN_OK); + else + return (err); +} + +void +InitLsaString(PLSA_UNICODE_STRING LsaString, LPWSTR String){ + DWORD StringLength; + + if (String == NULL) { + LsaString->Buffer = NULL; + LsaString->Length = 0; + LsaString->MaximumLength = 0; + return; + } + + StringLength = wcslen(String); + LsaString->Buffer = String; + LsaString->Length = (USHORT) StringLength * sizeof(WCHAR); + LsaString->MaximumLength = (USHORT)(StringLength+1) * sizeof(WCHAR); +} + +NTSTATUS +OpenPolicy(LPWSTR ServerName, DWORD DesiredAccess, PLSA_HANDLE PolicyHandle){ + LSA_OBJECT_ATTRIBUTES ObjectAttributes; + LSA_UNICODE_STRING ServerString; + PLSA_UNICODE_STRING Server = NULL; + + /* + * Always initialize the object attributes to all zeroes. + */ + ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes)); + + if (ServerName != NULL) { + /* + * Make a LSA_UNICODE_STRING out of the LPWSTR passed in + */ + InitLsaString(&ServerString, ServerName); + Server = &ServerString; + } + + /* + * Attempt to open the policy. + */ + return (LsaOpenPolicy(Server, &ObjectAttributes, DesiredAccess, + PolicyHandle)); +} + +BOOL +GetAccountSid(LPTSTR SystemName, LPTSTR AccountName, PSID *Sid) { + LPTSTR ReferencedDomain = NULL; + DWORD cbSid = 128; /* initial allocation attempt */ + DWORD cbReferencedDomain = 16; /* initial allocation size */ + SID_NAME_USE peUse; + BOOL bSuccess = FALSE; /* assume this function will fail */ + + __try { + /* + * initial memory allocations + */ + if ((*Sid = HeapAlloc(GetProcessHeap(), 0, cbSid)) == NULL) + __leave; + + if ((ReferencedDomain = (LPTSTR) HeapAlloc(GetProcessHeap(), 0, + cbReferencedDomain)) == NULL) __leave; + + /* + * Obtain the SID of the specified account on the specified system. + */ + while (!LookupAccountName(SystemName, AccountName, *Sid, &cbSid, + ReferencedDomain, &cbReferencedDomain, + &peUse)) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { + /* reallocate memory */ + if ((*Sid = HeapReAlloc(GetProcessHeap(), 0, + *Sid, cbSid)) == NULL) __leave; + + if ((ReferencedDomain= (LPTSTR) HeapReAlloc( + GetProcessHeap(), 0, ReferencedDomain, + cbReferencedDomain)) == NULL) + __leave; + } + else + __leave; + } + bSuccess = TRUE; + } /* finally */ + __finally { + + /* Cleanup and indicate failure, if appropriate. */ + + HeapFree(GetProcessHeap(), 0, ReferencedDomain); + + if (!bSuccess) { + if (*Sid != NULL) { + HeapFree(GetProcessHeap(), 0, *Sid); + *Sid = NULL; + } + } + + } + + return (bSuccess); +} + +NTSTATUS +SetPrivilegeOnAccount(LSA_HANDLE PolicyHandle, PSID AccountSid, + LPWSTR PrivilegeName, BOOL bEnable) +{ + LSA_UNICODE_STRING PrivilegeString; + + /* Create a LSA_UNICODE_STRING for the privilege name. */ + InitLsaString(&PrivilegeString, PrivilegeName); + + /* grant or revoke the privilege, accordingly */ + if (bEnable) + return (LsaAddAccountRights(PolicyHandle, AccountSid, + &PrivilegeString, 1)); + else + return (LsaRemoveAccountRights(PolicyHandle, AccountSid, + FALSE, &PrivilegeString, 1)); +} + +NTSTATUS +GetPrivilegesOnAccount(LSA_HANDLE PolicyHandle, PSID AccountSid, + wchar_t **PrivList, unsigned int *PrivCount) +{ + NTSTATUS Status; + LSA_UNICODE_STRING *UserRights; + ULONG CountOfRights; + unsigned int retlen = 0; + DWORD i, j; + int found; + + Status = LsaEnumerateAccountRights(PolicyHandle, AccountSid, + &UserRights, &CountOfRights); + /* Only continue if there is something */ + if (UserRights == NULL || Status != STATUS_SUCCESS) + return (Status); + + for (i = 0; i < CountOfRights; i++) { + found = -1; + retlen = UserRights[i].Length/sizeof(wchar_t); + for (j = 0; j < *PrivCount; j++) { + found = wcsncmp(PrivList[j], UserRights[i].Buffer, + retlen); + if (found == 0) + break; + } + if (found != 0) { + PrivList[*PrivCount] = + (wchar_t *)malloc(UserRights[i].MaximumLength); + if (PrivList[*PrivCount] == NULL) + return (RTN_NOMEMORY); + + wcsncpy(PrivList[*PrivCount], UserRights[i].Buffer, + retlen); + PrivList[*PrivCount][retlen] = L'\0'; + (*PrivCount)++; + } + + } + + return (Status); +} + +void +DisplayNtStatus(LPSTR szAPI, NTSTATUS Status) { + /* Convert the NTSTATUS to Winerror. Then call DisplayWinError(). */ + DisplayWinError(szAPI, LsaNtStatusToWinError(Status)); +} + +void +DisplayWinError(LPSTR szAPI, DWORD WinError) { + LPSTR MessageBuffer; + DWORD dwBufferLength; + + if (dwBufferLength=FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, WinError, GetUserDefaultLangID(), + (LPSTR) &MessageBuffer, 0, NULL)){ + DWORD dwBytesWritten; /* unused */ + + /* Output message string on stderr. */ + WriteFile(GetStdHandle(STD_ERROR_HANDLE), MessageBuffer, + dwBufferLength, &dwBytesWritten, NULL); + + /* Free the buffer allocated by the system. */ + LocalFree(MessageBuffer); + } +} diff --git a/bin/win32/BINDInstall/AccountInfo.h b/bin/win32/BINDInstall/AccountInfo.h new file mode 100644 index 00000000..f3bf2c5c --- /dev/null +++ b/bin/win32/BINDInstall/AccountInfo.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2001 Internet Software Consortium. + * + * 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 ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC 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. + */ + +/* $Id: AccountInfo.h,v 1.3.226.3 2004/03/08 09:04:21 marka Exp $ */ + + +#define RTN_OK 0 +#define RTN_NOACCOUNT 1 +#define RTN_NOMEMORY 2 +#define RTN_ERROR 10 + +#define SE_SERVICE_LOGON_PRIV L"SeServiceLogonRight" + +/* + * This routine retrieves the list of all Privileges associated with + * a given account as well as the groups to which it beongs + */ +int +GetAccountPrivileges( + char *name, /* Name of Account */ + wchar_t **PrivList, /* List of Privileges returned */ + unsigned int *PrivCount, /* Count of Privileges returned */ + char **Groups, /* List of Groups to which account belongs */ + unsigned int *totalGroups, /* Count of Groups returned */ + int maxGroups /* Maximum number of Groups to return */ + ); + +/* + * This routine creates an account with the given name which has just + * the logon service privilege and no membership of any groups, + * i.e. it's part of the None group. + */ +BOOL +CreateServiceAccount(char *name, char *password); diff --git a/bin/win32/BINDInstall/BINDInstall.cpp b/bin/win32/BINDInstall/BINDInstall.cpp index e996df9e..eb591ca3 100644 --- a/bin/win32/BINDInstall/BINDInstall.cpp +++ b/bin/win32/BINDInstall/BINDInstall.cpp @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: BINDInstall.cpp,v 1.3.2.2 2004/04/19 06:56:24 marka Exp $ */ +/* $Id: BINDInstall.cpp,v 1.3.206.1 2004/03/06 10:22:53 marka Exp $ */ /* * Copyright (c) 1999-2000 by Nortel Networks Corporation @@ -78,13 +78,12 @@ BOOL CBINDInstallApp::InitInstance() // 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. -#if _MSC_VER < 1300 + #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif -#endif CBINDInstallDlg dlg; m_pMainWnd = &dlg; diff --git a/bin/win32/BINDInstall/BINDInstall.dsp b/bin/win32/BINDInstall/BINDInstall.dsp index ed1abbab..9f04b97b 100644 --- a/bin/win32/BINDInstall/BINDInstall.dsp +++ b/bin/win32/BINDInstall/BINDInstall.dsp @@ -1,204 +1,177 @@ -# 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 /MT /W3 /GX /O2 /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /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"
-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 /MTd /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" /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"
-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
+# 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" /I "..\..\..\lib\isc\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /TP /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 netapi32.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" /I "..\..\..\lib\isc\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FR /Yu"stdafx.h" /FD /TP /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 netapi32.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=.\AccountInfo.cpp +# End Source File +# 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=..\..\..\lib\isc\win32\ntgroups.c +# SUBTRACT CPP /YX /Yc /Yu +# 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=.\Accountinfo.h +# End Source File +# 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=..\..\..\lib\isc\win32\include\isc\ntgroups.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 +# End Group +# Begin Source File + +SOURCE=.\BINDInstall.rc +# End Source File +# End Target +# End Project diff --git a/bin/win32/BINDInstall/BINDInstall.dsw b/bin/win32/BINDInstall/BINDInstall.dsw index c949bc7b..d16a45cc 100644 --- a/bin/win32/BINDInstall/BINDInstall.dsw +++ b/bin/win32/BINDInstall/BINDInstall.dsw @@ -1,29 +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>
-{{{
-}}}
-
-###############################################################################
-
+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> +{{{ +}}} + +############################################################################### + diff --git a/bin/win32/BINDInstall/BINDInstall.h b/bin/win32/BINDInstall/BINDInstall.h index 0958e914..ecc6afb2 100644 --- a/bin/win32/BINDInstall/BINDInstall.h +++ b/bin/win32/BINDInstall/BINDInstall.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: BINDInstall.h,v 1.3.2.1 2004/03/09 06:10:31 marka Exp $ */ +/* $Id: BINDInstall.h,v 1.3.206.1 2004/03/06 10:22:53 marka Exp $ */ /* * Copyright (c) 1999-2000 by Nortel Networks Corporation diff --git a/bin/win32/BINDInstall/BINDInstall.mak b/bin/win32/BINDInstall/BINDInstall.mak index 330953a0..f479a243 100644 --- a/bin/win32/BINDInstall/BINDInstall.mak +++ b/bin/win32/BINDInstall/BINDInstall.mak @@ -1,410 +1,331 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on BINDInstall.dsp
-!IF "$(CFG)" == ""
-CFG=BINDInstall - Win32 Debug
-!MESSAGE No configuration specified. Defaulting to BINDInstall - Win32 Debug.
-!ENDIF
-
-!IF "$(CFG)" != "BINDInstall - Win32 Release" && "$(CFG)" != "BINDInstall - Win32 Debug"
-!MESSAGE Invalid configuration "$(CFG)" specified.
-!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
-!ERROR An invalid configuration is specified.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
-!IF "$(CFG)" == "BINDInstall - Win32 Release"
-_VC_MANIFEST_INC=0
-_VC_MANIFEST_BASENAME=__VC80
-!ELSE
-_VC_MANIFEST_INC=1
-_VC_MANIFEST_BASENAME=__VC80.Debug
-!ENDIF
-
-####################################################
-# Specifying name of temporary resource file used only in incremental builds:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-_VC_MANIFEST_AUTO_RES=$(_VC_MANIFEST_BASENAME).auto.res
-!else
-_VC_MANIFEST_AUTO_RES=
-!endif
-
-####################################################
-# _VC_MANIFEST_EMBED_EXE - command to embed manifest in EXE:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-
-#MT_SPECIAL_RETURN=1090650113
-#MT_SPECIAL_SWITCH=-notify_resource_update
-MT_SPECIAL_RETURN=0
-MT_SPECIAL_SWITCH=
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \
-if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \
-rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \
-link $** /out:$@ $(LFLAGS)
-
-!else
-
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1
-
-!endif
-
-####################################################
-# _VC_MANIFEST_EMBED_DLL - command to embed manifest in DLL:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-
-#MT_SPECIAL_RETURN=1090650113
-#MT_SPECIAL_SWITCH=-notify_resource_update
-MT_SPECIAL_RETURN=0
-MT_SPECIAL_SWITCH=
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \
-if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \
-rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \
-link $** /out:$@ $(LFLAGS)
-
-!else
-
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;2
-
-!endif
-####################################################
-# _VC_MANIFEST_CLEAN - command to clean resources files generated temporarily:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-
-_VC_MANIFEST_CLEAN=-del $(_VC_MANIFEST_BASENAME).auto.res \
- $(_VC_MANIFEST_BASENAME).auto.rc \
- $(_VC_MANIFEST_BASENAME).auto.manifest
-
-!else
-
-_VC_MANIFEST_CLEAN=
-
-!endif
-
-!IF "$(CFG)" == "BINDInstall - Win32 Release"
-
-OUTDIR=.\Release
-INTDIR=.\Release
-
-ALL : "..\..\..\Build\Release\BINDInstall.exe"
-
-
-CLEAN :
- -@erase "$(INTDIR)\BINDInstall.obj"
- -@erase "$(INTDIR)\BINDInstall.pch"
- -@erase "$(INTDIR)\BINDInstall.res"
- -@erase "$(INTDIR)\BINDInstallDlg.obj"
- -@erase "$(INTDIR)\DirBrowse.obj"
- -@erase "$(INTDIR)\StdAfx.obj"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "$(INTDIR)\VersionInfo.obj"
- -@erase "..\..\..\Build\Release\BINDInstall.exe"
- -@$(_VC_MANIFEST_CLEAN)
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\BINDInstall.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-
-.c{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.c{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-MTL=midl.exe
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\BINDInstall.res" /d "NDEBUG"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\BINDInstall.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-LINK32_FLAGS=version.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"..\..\..\Build\Release\BINDInstall.exe"
-LINK32_OBJS= \
- "$(INTDIR)\BINDInstall.obj" \
- "$(INTDIR)\BINDInstallDlg.obj" \
- "$(INTDIR)\DirBrowse.obj" \
- "$(INTDIR)\StdAfx.obj" \
- "$(INTDIR)\VersionInfo.obj" \
- "$(INTDIR)\BINDInstall.res"
-
-"..\..\..\Build\Release\BINDInstall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
- $(_VC_MANIFEST_EMBED_EXE)
-
-!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug"
-
-OUTDIR=.\Debug
-INTDIR=.\Debug
-# Begin Custom Macros
-OutDir=.\Debug
-# End Custom Macros
-
-ALL : "..\..\..\Build\Debug\BINDInstall.exe" "$(OUTDIR)\BINDInstall.bsc"
-
-
-CLEAN :
- -@erase "$(INTDIR)\BINDInstall.obj"
- -@erase "$(INTDIR)\BINDInstall.pch"
- -@erase "$(INTDIR)\BINDInstall.res"
- -@erase "$(INTDIR)\BINDInstall.sbr"
- -@erase "$(INTDIR)\BINDInstallDlg.obj"
- -@erase "$(INTDIR)\BINDInstallDlg.sbr"
- -@erase "$(INTDIR)\DirBrowse.obj"
- -@erase "$(INTDIR)\DirBrowse.sbr"
- -@erase "$(INTDIR)\StdAfx.obj"
- -@erase "$(INTDIR)\StdAfx.sbr"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "$(INTDIR)\vc60.pdb"
- -@erase "$(INTDIR)\VersionInfo.obj"
- -@erase "$(INTDIR)\VersionInfo.sbr"
- -@erase "$(OUTDIR)\BINDInstall.bsc"
- -@erase "..\..\..\Build\Debug\BINDInstall.exe"
- -@$(_VC_MANIFEST_CLEAN)
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MTd /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" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\BINDInstall.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-
-.c{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.c{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(INTDIR)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-MTL=midl.exe
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\BINDInstall.res" /d "_DEBUG"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\BINDInstall.bsc"
-BSC32_SBRS= \
- "$(INTDIR)\BINDInstall.sbr" \
- "$(INTDIR)\BINDInstallDlg.sbr" \
- "$(INTDIR)\DirBrowse.sbr" \
- "$(INTDIR)\StdAfx.sbr" \
- "$(INTDIR)\VersionInfo.sbr"
-
-"$(OUTDIR)\BINDInstall.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
- $(BSC32) @<<
- $(BSC32_FLAGS) $(BSC32_SBRS)
-<<
-
-LINK32=link.exe
-LINK32_FLAGS=version.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"..\..\..\Build\Debug\BINDInstall.exe"
-LINK32_OBJS= \
- "$(INTDIR)\BINDInstall.obj" \
- "$(INTDIR)\BINDInstallDlg.obj" \
- "$(INTDIR)\DirBrowse.obj" \
- "$(INTDIR)\StdAfx.obj" \
- "$(INTDIR)\VersionInfo.obj" \
- "$(INTDIR)\BINDInstall.res"
-
-"..\..\..\Build\Debug\BINDInstall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
- $(_VC_MANIFEST_EMBED_EXE)
-
-!ENDIF
-
-
-!IF "$(NO_EXTERNAL_DEPS)" != "1"
-!IF EXISTS("BINDInstall.dep")
-!INCLUDE "BINDInstall.dep"
-!ELSE
-!MESSAGE Warning: cannot find "BINDInstall.dep"
-!ENDIF
-!ENDIF
-
-
-!IF "$(CFG)" == "BINDInstall - Win32 Release" || "$(CFG)" == "BINDInstall - Win32 Debug"
-SOURCE=.\BINDInstall.cpp
-
-!IF "$(CFG)" == "BINDInstall - Win32 Release"
-
-
-"$(INTDIR)\BINDInstall.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch"
-
-
-!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug"
-
-
-"$(INTDIR)\BINDInstall.obj" "$(INTDIR)\BINDInstall.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch"
-
-
-!ENDIF
-
-SOURCE=.\BINDInstallDlg.cpp
-
-!IF "$(CFG)" == "BINDInstall - Win32 Release"
-
-
-"$(INTDIR)\BINDInstallDlg.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch"
-
-
-!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug"
-
-
-"$(INTDIR)\BINDInstallDlg.obj" "$(INTDIR)\BINDInstallDlg.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch"
-
-
-!ENDIF
-
-SOURCE=.\DirBrowse.cpp
-
-!IF "$(CFG)" == "BINDInstall - Win32 Release"
-
-
-"$(INTDIR)\DirBrowse.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch"
-
-
-!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug"
-
-
-"$(INTDIR)\DirBrowse.obj" "$(INTDIR)\DirBrowse.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch"
-
-
-!ENDIF
-
-SOURCE=.\StdAfx.cpp
-
-!IF "$(CFG)" == "BINDInstall - Win32 Release"
-
-CPP_SWITCHES=/nologo /MT /W3 /GX /O2 /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"$(INTDIR)\BINDInstall.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-
-"$(INTDIR)\StdAfx.obj" "$(INTDIR)\BINDInstall.pch" : $(SOURCE) "$(INTDIR)"
- $(CPP) @<<
- $(CPP_SWITCHES) $(SOURCE)
-<<
-
-
-!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug"
-
-CPP_SWITCHES=/nologo /MTd /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" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\BINDInstall.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-
-"$(INTDIR)\StdAfx.obj" "$(INTDIR)\StdAfx.sbr" "$(INTDIR)\BINDInstall.pch" : $(SOURCE) "$(INTDIR)"
- $(CPP) @<<
- $(CPP_SWITCHES) $(SOURCE)
-<<
-
-
-!ENDIF
-
-SOURCE=.\VersionInfo.cpp
-
-!IF "$(CFG)" == "BINDInstall - Win32 Release"
-
-
-"$(INTDIR)\VersionInfo.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch"
-
-
-!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug"
-
-
-"$(INTDIR)\VersionInfo.obj" "$(INTDIR)\VersionInfo.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch"
-
-
-!ENDIF
-
-SOURCE=.\BINDInstall.rc
-
-"$(INTDIR)\BINDInstall.res" : $(SOURCE) "$(INTDIR)"
- $(RSC) $(RSC_PROJ) $(SOURCE)
-
-
-
-!ENDIF
-
-####################################################
-# Commands to generate initial empty manifest file and the RC file
-# that references it, and for generating the .res file:
-
-$(_VC_MANIFEST_BASENAME).auto.res : $(_VC_MANIFEST_BASENAME).auto.rc
-
-$(_VC_MANIFEST_BASENAME).auto.rc : $(_VC_MANIFEST_BASENAME).auto.manifest
- type <<$@
-#include <winuser.h>
-1RT_MANIFEST"$(_VC_MANIFEST_BASENAME).auto.manifest"
-<< KEEP
-
-$(_VC_MANIFEST_BASENAME).auto.manifest :
- type <<$@
-<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
-<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
-</assembly>
-<< KEEP
+# Microsoft Developer Studio Generated NMAKE File, Based on BINDInstall.dsp +!IF "$(CFG)" == "" +CFG=BINDInstall - Win32 Debug +!MESSAGE No configuration specified. Defaulting to BINDInstall - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "BINDInstall - Win32 Release" && "$(CFG)" != "BINDInstall - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!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 +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "BINDInstall - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "..\..\..\Build\Release\BINDInstall.exe" + + +CLEAN : + -@erase "$(INTDIR)\AccountInfo.obj" + -@erase "$(INTDIR)\BINDInstall.obj" + -@erase "$(INTDIR)\BINDInstall.pch" + -@erase "$(INTDIR)\BINDInstall.res" + -@erase "$(INTDIR)\BINDInstallDlg.obj" + -@erase "$(INTDIR)\DirBrowse.obj" + -@erase "$(INTDIR)\ntgroups.obj" + -@erase "$(INTDIR)\StdAfx.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\VersionInfo.obj" + -@erase "..\..\..\Build\Release\BINDInstall.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Fp"$(INTDIR)\BINDInstall.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /TP /c +MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\BINDInstall.res" /d "NDEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\BINDInstall.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=version.lib netapi32.lib /nologo /subsystem:windows /pdb:none /machine:I386 /out:"..\..\..\Build\Release\BINDInstall.exe" +LINK32_OBJS= \ + "$(INTDIR)\AccountInfo.obj" \ + "$(INTDIR)\BINDInstall.obj" \ + "$(INTDIR)\BINDInstallDlg.obj" \ + "$(INTDIR)\DirBrowse.obj" \ + "$(INTDIR)\ntgroups.obj" \ + "$(INTDIR)\StdAfx.obj" \ + "$(INTDIR)\VersionInfo.obj" \ + "$(INTDIR)\BINDInstall.res" + +"..\..\..\Build\Release\BINDInstall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +ALL : "..\..\..\Build\Debug\BINDInstall.exe" "$(OUTDIR)\BINDInstall.bsc" + + +CLEAN : + -@erase "$(INTDIR)\AccountInfo.obj" + -@erase "$(INTDIR)\AccountInfo.sbr" + -@erase "$(INTDIR)\BINDInstall.obj" + -@erase "$(INTDIR)\BINDInstall.pch" + -@erase "$(INTDIR)\BINDInstall.res" + -@erase "$(INTDIR)\BINDInstall.sbr" + -@erase "$(INTDIR)\BINDInstallDlg.obj" + -@erase "$(INTDIR)\BINDInstallDlg.sbr" + -@erase "$(INTDIR)\DirBrowse.obj" + -@erase "$(INTDIR)\DirBrowse.sbr" + -@erase "$(INTDIR)\ntgroups.obj" + -@erase "$(INTDIR)\ntgroups.sbr" + -@erase "$(INTDIR)\StdAfx.obj" + -@erase "$(INTDIR)\StdAfx.sbr" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(INTDIR)\VersionInfo.obj" + -@erase "$(INTDIR)\VersionInfo.sbr" + -@erase "$(OUTDIR)\BINDInstall.bsc" + -@erase "..\..\..\Build\Debug\BINDInstall.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\BINDInstall.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /TP /GZ /c +MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\BINDInstall.res" /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\BINDInstall.bsc" +BSC32_SBRS= \ + "$(INTDIR)\AccountInfo.sbr" \ + "$(INTDIR)\BINDInstall.sbr" \ + "$(INTDIR)\BINDInstallDlg.sbr" \ + "$(INTDIR)\DirBrowse.sbr" \ + "$(INTDIR)\ntgroups.sbr" \ + "$(INTDIR)\StdAfx.sbr" \ + "$(INTDIR)\VersionInfo.sbr" + +"$(OUTDIR)\BINDInstall.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +LINK32_FLAGS=version.lib netapi32.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"..\..\..\Build\Debug\BINDInstall.exe" +LINK32_OBJS= \ + "$(INTDIR)\AccountInfo.obj" \ + "$(INTDIR)\BINDInstall.obj" \ + "$(INTDIR)\BINDInstallDlg.obj" \ + "$(INTDIR)\DirBrowse.obj" \ + "$(INTDIR)\ntgroups.obj" \ + "$(INTDIR)\StdAfx.obj" \ + "$(INTDIR)\VersionInfo.obj" \ + "$(INTDIR)\BINDInstall.res" + +"..\..\..\Build\Debug\BINDInstall.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("BINDInstall.dep") +!INCLUDE "BINDInstall.dep" +!ELSE +!MESSAGE Warning: cannot find "BINDInstall.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "BINDInstall - Win32 Release" || "$(CFG)" == "BINDInstall - Win32 Debug" +SOURCE=.\AccountInfo.cpp + +!IF "$(CFG)" == "BINDInstall - Win32 Release" + + +"$(INTDIR)\AccountInfo.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug" + + +"$(INTDIR)\AccountInfo.obj" "$(INTDIR)\AccountInfo.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ENDIF + +SOURCE=.\BINDInstall.cpp + +!IF "$(CFG)" == "BINDInstall - Win32 Release" + + +"$(INTDIR)\BINDInstall.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug" + + +"$(INTDIR)\BINDInstall.obj" "$(INTDIR)\BINDInstall.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ENDIF + +SOURCE=.\BINDInstallDlg.cpp + +!IF "$(CFG)" == "BINDInstall - Win32 Release" + + +"$(INTDIR)\BINDInstallDlg.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug" + + +"$(INTDIR)\BINDInstallDlg.obj" "$(INTDIR)\BINDInstallDlg.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ENDIF + +SOURCE=.\DirBrowse.cpp + +!IF "$(CFG)" == "BINDInstall - Win32 Release" + + +"$(INTDIR)\DirBrowse.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug" + + +"$(INTDIR)\DirBrowse.obj" "$(INTDIR)\DirBrowse.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ENDIF + +SOURCE=..\..\..\lib\isc\win32\ntgroups.c + +!IF "$(CFG)" == "BINDInstall - Win32 Release" + +CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /TP /c + +"$(INTDIR)\ntgroups.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) @<< + $(CPP_SWITCHES) $(SOURCE) +<< + + +!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug" + +CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /TP /GZ /c + +"$(INTDIR)\ntgroups.obj" "$(INTDIR)\ntgroups.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) @<< + $(CPP_SWITCHES) $(SOURCE) +<< + + +!ENDIF + +SOURCE=.\StdAfx.cpp + +!IF "$(CFG)" == "BINDInstall - Win32 Release" + +CPP_SWITCHES=/nologo /MD /W3 /GX /O2 /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Fp"$(INTDIR)\BINDInstall.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /TP /c + +"$(INTDIR)\StdAfx.obj" "$(INTDIR)\BINDInstall.pch" : $(SOURCE) "$(INTDIR)" + $(CPP) @<< + $(CPP_SWITCHES) $(SOURCE) +<< + + +!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug" + +CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /I "..\..\..\include" /I "..\..\named\win32\include" /I "..\..\..\lib\isc\win32\include" /I "..\..\..\lib\isc\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\BINDInstall.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /TP /GZ /c + +"$(INTDIR)\StdAfx.obj" "$(INTDIR)\StdAfx.sbr" "$(INTDIR)\BINDInstall.pch" : $(SOURCE) "$(INTDIR)" + $(CPP) @<< + $(CPP_SWITCHES) $(SOURCE) +<< + + +!ENDIF + +SOURCE=.\VersionInfo.cpp + +!IF "$(CFG)" == "BINDInstall - Win32 Release" + + +"$(INTDIR)\VersionInfo.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ELSEIF "$(CFG)" == "BINDInstall - Win32 Debug" + + +"$(INTDIR)\VersionInfo.obj" "$(INTDIR)\VersionInfo.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\BINDInstall.pch" + + +!ENDIF + +SOURCE=.\BINDInstall.rc + +"$(INTDIR)\BINDInstall.res" : $(SOURCE) "$(INTDIR)" + $(RSC) $(RSC_PROJ) $(SOURCE) + + + +!ENDIF + diff --git a/bin/win32/BINDInstall/BINDInstall.rc b/bin/win32/BINDInstall/BINDInstall.rc index fe29c97d..733591d3 100644 --- a/bin/win32/BINDInstall/BINDInstall.rc +++ b/bin/win32/BINDInstall/BINDInstall.rc @@ -73,39 +73,48 @@ IDR_MAINFRAME ICON DISCARDABLE "res\\BINDInstall.ico" // Dialog // -IDD_BINDINSTALL_DIALOG DIALOGEX 0, 0, 210, 234 +IDD_BINDINSTALL_DIALOG DIALOGEX 0, 0, 210, 301 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 + 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 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 + BS_AUTOCHECKBOX | WS_TABSTOP,14,190,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 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 - 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 + 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 + 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 END IDD_BROWSE DIALOG DISCARDABLE 0, 0, 227, 117 @@ -122,6 +131,15 @@ BEGIN WS_VSCROLL | WS_TABSTOP END +IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,129,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 +END + #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// @@ -130,8 +148,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,5,0,0 - PRODUCTVERSION 1,5,0,0 + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -149,14 +167,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Internet Software Consortium\0" VALUE "FileDescription", "ISC BIND Install Utility\0" - VALUE "FileVersion", "1.5.0\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.2.0\0" + VALUE "ProductVersion", "9.3.0\0" VALUE "SpecialBuild", "\0" END END @@ -181,8 +199,19 @@ BEGIN BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 203 + VERTGUIDE, 14 + VERTGUIDE, 92 + VERTGUIDE, 105 TOPMARGIN, 7 - BOTTOMMARGIN, 227 + BOTTOMMARGIN, 294 + HORZGUIDE, 195 + HORZGUIDE, 205 + HORZGUIDE, 215 + HORZGUIDE, 239 + HORZGUIDE, 255 + HORZGUIDE, 265 + HORZGUIDE, 275 + HORZGUIDE, 285 END IDD_BROWSE, DIALOG @@ -192,6 +221,14 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 110 END + + IDD_DIALOG1, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 88 + END END #endif // APSTUDIO_INVOKED @@ -262,6 +299,12 @@ BEGIN 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) " + IDS_ERR_TOOPRIVED "Chosen account has too many privileges. Do you wish to choose a different account name?" + IDS_ERR_BADACCOUNT "Error Validating Account. Unable to install service using this account." + IDS_ERR_WRONGPRIV "The wrong privilege: %s was detected. Only the Service Logon Right privilege should be enabled for this account." + IDS_CREATEACCOUNT_FAILED "Unable to Create Account for the Service." + IDS_ERR_PASSWORD "Passwords entered did not match. Please reenter password." + IDS_ERR_UPDATE_SERVICE "Error updating service\n(%s)" END #endif // English (U.S.) resources diff --git a/bin/win32/BINDInstall/BINDInstallDlg.cpp b/bin/win32/BINDInstall/BINDInstallDlg.cpp index c6fa6b65..a46bccad 100644 --- a/bin/win32/BINDInstall/BINDInstallDlg.cpp +++ b/bin/win32/BINDInstall/BINDInstallDlg.cpp @@ -1,6 +1,6 @@ /* - * Portions Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") - * Portions Copyright (C) 2001-2003 Internet Software Consortium. + * Portions Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: BINDInstallDlg.cpp,v 1.6.2.21 2007/06/27 01:52:19 marka Exp $ */ +/* $Id: BINDInstallDlg.cpp,v 1.6.2.6.2.6 2004/03/11 05:58:40 marka Exp $ */ /* * Copyright (c) 1999-2000 by Nortel Networks Corporation @@ -59,9 +59,14 @@ #include <winsvc.h> #include <named/ntservice.h> #include <isc/bind_registry.h> +#include <isc/ntgroups.h> #include <direct.h> +#include "AccountInfo.h" #include "versioninfo.h" +#define MAX_GROUPS 100 +#define MAX_PRIVS 50 + #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE @@ -87,8 +92,7 @@ _xexception::_xexception(UINT string, ...) va_end(va); } -typedef struct _filedata -{ +typedef struct _filedata { enum FileDestinations {TargetDir, BinDir, EtcDir, WinSystem}; enum FileImportance {Trivial, Normal, Critical}; @@ -109,21 +113,15 @@ const FileData installFiles[] = {"msvcrt.dll", FileData::WinSystem, FileData::Critical, 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}, -#elif _MSC_VER > 1200 && _MSC_VER < 1310 {"mfc70.dll", FileData::WinSystem, FileData::Critical, TRUE}, {"msvcr70.dll", FileData::WinSystem, FileData::Critical, TRUE}, -#endif -#endif - {"bindevt.dll", FileData::BinDir, FileData::Normal, 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}, + {"bindevt.dll", FileData::WinSystem, FileData::Normal, FALSE}, + {"libbind9.dll", FileData::WinSystem, FileData::Critical, FALSE}, + {"libisc.dll", FileData::WinSystem, FileData::Critical, FALSE}, + {"libisccfg.dll", FileData::WinSystem, FileData::Critical, FALSE}, + {"libisccc.dll", FileData::WinSystem, FileData::Critical, FALSE}, + {"libdns.dll", FileData::WinSystem, FileData::Critical, FALSE}, + {"liblwres.dll", FileData::WinSystem, FileData::Critical, FALSE}, {"libeay32.dll", FileData::BinDir, FileData::Critical, FALSE}, {"named.exe", FileData::BinDir, FileData::Critical, FALSE}, {"nsupdate.exe", FileData::BinDir, FileData::Normal, FALSE}, @@ -143,12 +141,12 @@ const FileData installFiles[] = {NULL, -1, -1} }; + ///////////////////////////////////////////////////////////////////////////// // CBINDInstallDlg dialog CBINDInstallDlg::CBINDInstallDlg(CWnd* pParent /*=NULL*/) - : CDialog(CBINDInstallDlg::IDD, pParent) -{ + : CDialog(CBINDInstallDlg::IDD, pParent) { char buf[MAX_PATH]; //{{AFX_DATA_INIT(CBINDInstallDlg) @@ -158,23 +156,36 @@ CBINDInstallDlg::CBINDInstallDlg(CWnd* pParent /*=NULL*/) m_keepFiles = FALSE; m_current = _T(""); m_startOnInstall = FALSE; + m_accountName = _T(""); + m_accountPassword = _T(""); + m_accountName = _T(""); //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); - m_reboot = FALSE; GetSystemDirectory(buf, MAX_PATH); m_winSysDir = buf; m_defaultDir = buf; m_defaultDir += "\\dns"; + m_installed = FALSE; + m_accountExists = FALSE; + m_accountUsed = FALSE; + m_serviceExists = TRUE; + GetCurrentServiceAccountName(); + m_currentAccount = m_accountName; + if (m_accountName == "") { + m_accountName = "named"; + } } -void CBINDInstallDlg::DoDataExchange(CDataExchange* pDX) -{ +void CBINDInstallDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CBINDInstallDlg) DDX_Text(pDX, IDC_TARGETDIR, m_targetDir); DDX_Text(pDX, IDC_VERSION, m_version); + 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_AUTO_START, m_autoStart); DDX_Check(pDX, IDC_KEEP_FILES, m_keepFiles); DDX_Text(pDX, IDC_CURRENT, m_current); @@ -196,8 +207,7 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CBINDInstallDlg message handlers -BOOL CBINDInstallDlg::OnInitDialog() -{ +BOOL CBINDInstallDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically @@ -215,7 +225,6 @@ BOOL CBINDInstallDlg::OnInitDialog() dirname[index] = '\0'; CString Dirname(dirname); m_currentDir = Dirname; - CVersionInfo bindInst(filename); if(bindInst.IsValid()) @@ -230,12 +239,14 @@ BOOL CBINDInstallDlg::OnInitDialog() m_startOnInstall = CheckBINDService(); /* See if we are installed already */ - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, BIND_SUBKEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) - { + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, BIND_SUBKEY, 0, KEY_READ, &hKey) + == ERROR_SUCCESS) { + m_installed = TRUE; memset(buf, 0, MAX_PATH); // Get the install directory - if(RegQueryValueEx(hKey, "InstallDir", NULL, NULL, (LPBYTE)buf, &dwBufLen) == ERROR_SUCCESS) - if(strcmp(buf, "")) + if (RegQueryValueEx(hKey, "InstallDir", NULL, NULL, (LPBYTE)buf, + &dwBufLen) == ERROR_SUCCESS) + if (strcmp(buf, "")) m_defaultDir = buf; RegCloseKey(hKey); @@ -248,17 +259,17 @@ BOOL CBINDInstallDlg::OnInitDialog() UpdateData(FALSE); - return(TRUE); // return(TRUE unless you set the focus to a control + return (TRUE); /* return(TRUE) unless you set the focus to a control */ } -// If you add a minimize button to your dialog, you will need the code below -// to draw the icon. For MFC applications using the document/view model, -// this is automatically done for you by the framework. +/* + * If you add a minimize button to your dialog, you will need the code below + * to draw the icon. For MFC applications using the document/view model, + * this is automatically done for you by the framework. + */ -void CBINDInstallDlg::OnPaint() -{ - if (IsIconic()) - { +void CBINDInstallDlg::OnPaint() { + if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); @@ -274,26 +285,22 @@ void CBINDInstallDlg::OnPaint() // Draw the icon dc.DrawIcon(x, y, m_hIcon); } - else - { + else { CDialog::OnPaint(); } } // The system calls this to obtain the cursor to display while the user drags // the minimized window. -HCURSOR CBINDInstallDlg::OnQueryDragIcon() -{ +HCURSOR CBINDInstallDlg::OnQueryDragIcon() { return((HCURSOR)m_hIcon); } -void CBINDInstallDlg::OnBrowse() -{ +void CBINDInstallDlg::OnBrowse() { CDirBrowse browse; - if(browse.DoModal() == IDOK) - { + if (browse.DoModal() == IDOK) { //m_targetDir = browse.m_selectedDir; UpdateData(FALSE); } @@ -302,44 +309,40 @@ void CBINDInstallDlg::OnBrowse() /* * User pressed the exit button */ -void CBINDInstallDlg::OnExit() -{ +void CBINDInstallDlg::OnExit() { EndDialog(0); } /* * User pressed the uninstall button. Make it go. */ -void CBINDInstallDlg::OnUninstall() -{ +void CBINDInstallDlg::OnUninstall() { UpdateData(); - if(MsgBox(IDS_UNINSTALL, MB_YESNO) == IDYES) - { - if(CheckBINDService()) + if (MsgBox(IDS_UNINSTALL, MB_YESNO) == IDYES) { + if (CheckBINDService()) StopBINDService(); - SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); - if(!hSCManager) - { + SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, + SC_MANAGER_ALL_ACCESS); + if (!hSCManager) { MsgBox(IDS_ERR_OPEN_SCM, GetErrMessage()); return; } - SC_HANDLE hService = OpenService(hSCManager, BIND_SERVICE_NAME, SERVICE_ALL_ACCESS); - if(!hService && GetLastError() != ERROR_SERVICE_DOES_NOT_EXIST) - { + SC_HANDLE hService = OpenService(hSCManager, BIND_SERVICE_NAME, + SERVICE_ALL_ACCESS); + if (!hService && GetLastError() != ERROR_SERVICE_DOES_NOT_EXIST){ MsgBox(IDS_ERR_OPEN_SERVICE, GetErrMessage()); return; } SERVICE_STATUS ss; QueryServiceStatus(hService, &ss); - if(ss.dwCurrentState == SERVICE_RUNNING) - { - BOOL rc = ControlService(hService, SERVICE_CONTROL_STOP, &ss); - if(rc == FALSE || ss.dwCurrentState != SERVICE_STOPPED) - { + if (ss.dwCurrentState == SERVICE_RUNNING) { + BOOL rc = ControlService(hService, + SERVICE_CONTROL_STOP, &ss); + if (rc == FALSE || ss.dwCurrentState != SERVICE_STOPPED) { MsgBox(IDS_ERR_STOP_SERVICE, GetErrMessage()); return; } @@ -356,7 +359,7 @@ void CBINDInstallDlg::OnUninstall() UnregisterMessages(TRUE); UnregisterService(TRUE); DeleteFiles(TRUE); - if(m_keepFiles == FALSE) + if (m_keepFiles == FALSE) RemoveDirs(TRUE); else GetDlgItem(IDC_CREATE_DIR)->SetWindowText("Not Removed"); @@ -377,49 +380,64 @@ void CBINDInstallDlg::OnUninstall() /* * User pressed the install button. Make it go. */ -void CBINDInstallDlg::OnInstall() -{ +void CBINDInstallDlg::OnInstall() { BOOL success = FALSE; - if(CheckBINDService()) + if (CheckBINDService()) StopBINDService(); InstallTags(); UpdateData(); - // Directories + /* Check that the Passwords entered match */ + if (m_accountPassword != m_accountPasswordConfirm) { + MsgBox(IDS_ERR_PASSWORD); + 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; + + /* Directories */ m_etcDir = m_targetDir + "\\etc"; m_binDir = m_targetDir + "\\bin"; - if(m_defaultDir != m_targetDir) - { - if(GetFileAttributes(m_targetDir) != 0xFFFFFFFF) + if (m_defaultDir != m_targetDir) { + if (GetFileAttributes(m_targetDir) != 0xFFFFFFFF) { - int install = MsgBox(IDS_DIREXIST, MB_YESNO | MB_ICONQUESTION, m_targetDir); - if(install == IDNO) + int install = MsgBox(IDS_DIREXIST, + MB_YESNO | MB_ICONQUESTION, m_targetDir); + if (install == IDNO) return; } - else - { - int createDir = MsgBox(IDS_CREATEDIR, MB_YESNO | MB_ICONQUESTION, m_targetDir); - if(createDir == IDNO) + else { + int createDir = MsgBox(IDS_CREATEDIR, + MB_YESNO | MB_ICONQUESTION, m_targetDir); + if (createDir == IDNO) return; } } -#if _MSC_VER >= 1400 - /* - * Install Visual Studio libraries. As per: - * http://blogs.msdn.com/astebner/archive/2006/08/23/715755.aspx - * - * Vcredist_x86.exe /q:a /c:"msiexec /i vcredist.msi /qn /l*v %temp%\vcredist_x86.log" - */ - /*system(".\\Vcredist_x86.exe /q:a /c:\"msiexec /i vcredist.msi /qn /l*v %temp%\vcredist_x86.log\"");*/ - system(".\\Vcredist_x86.exe"); -#endif - try - { + 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; + } + + ProgramGroup(); + + try { CreateDirs(); CopyFiles(); RegisterService(); @@ -429,42 +447,45 @@ void CBINDInstallDlg::OnInstall() /* Create a new key for named */ SetCurrent(IDS_CREATE_KEY); - if(RegCreateKey(HKEY_LOCAL_MACHINE, BIND_SUBKEY, &hKey) == ERROR_SUCCESS) - { + if (RegCreateKey(HKEY_LOCAL_MACHINE, BIND_SUBKEY, + &hKey) == ERROR_SUCCESS) { // Get the install directory - RegSetValueEx(hKey, "InstallDir", 0, REG_SZ, (LPBYTE)(LPCTSTR)m_targetDir, m_targetDir.GetLength()); + RegSetValueEx(hKey, "InstallDir", 0, REG_SZ, + (LPBYTE)(LPCTSTR)m_targetDir, + m_targetDir.GetLength()); RegCloseKey(hKey); } SetCurrent(IDS_ADD_REMOVE); - if(RegCreateKey(HKEY_LOCAL_MACHINE, BIND_UNINSTALL_SUBKEY, - &hKey) == ERROR_SUCCESS) - { + if (RegCreateKey(HKEY_LOCAL_MACHINE, BIND_UNINSTALL_SUBKEY, + &hKey) == ERROR_SUCCESS) { + char winDir[MAX_PATH]; CString buf(BIND_DISPLAY_NAME); + GetWindowsDirectory(winDir, MAX_PATH); RegSetValueEx(hKey, "DisplayName", 0, REG_SZ, - (LPBYTE)(LPCTSTR)buf, buf.GetLength()); + (LPBYTE)(LPCTSTR)buf, buf.GetLength()); - buf.Format("%s\\BINDInstall.exe", m_binDir); + buf.Format("%s\\BINDInstall.exe", winDir); RegSetValueEx(hKey, "UninstallString", 0, REG_SZ, - (LPBYTE)(LPCTSTR)buf, buf.GetLength()); + (LPBYTE)(LPCTSTR)buf, buf.GetLength()); RegCloseKey(hKey); } - if(m_startOnInstall && !m_reboot) + ProgramGroup(); + + if (m_startOnInstall) StartBINDService(); } - catch(Exception e) - { + catch(Exception e) { MessageBox(e.resString); SetCurrent(IDS_CLEANUP); FailedInstall(); MsgBox(IDS_FAIL); return; } - catch(DWORD dw) - { + catch(DWORD dw) { CString msg; msg.Format("A fatal error occured\n(%s)", GetErrMessage(dw)); MessageBox(msg); @@ -476,94 +497,88 @@ void CBINDInstallDlg::OnInstall() SetCurrent(IDS_INSTALL_DONE); MsgBox(IDS_SUCCESS); - if(m_reboot) - { - if(MsgBox(IDS_REBOOT, MB_YESNO) == IDYES) - { - InitiateSystemShutdown(NULL, NULL, 0, TRUE, TRUE); - } - } } /* * Methods to do the work */ -void CBINDInstallDlg::CreateDirs() -{ +void CBINDInstallDlg::CreateDirs() { /* s'OK if the directories already exist */ SetCurrent(IDS_CREATE_DIR, m_targetDir); - if(!CreateDirectory(m_targetDir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) + if (!CreateDirectory(m_targetDir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) throw(Exception(IDS_ERR_CREATE_DIR, m_targetDir, GetErrMessage())); SetCurrent(IDS_CREATE_DIR, m_etcDir); - if(!CreateDirectory(m_etcDir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) + if (!CreateDirectory(m_etcDir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) throw(Exception(IDS_ERR_CREATE_DIR, m_etcDir, GetErrMessage())); SetCurrent(IDS_CREATE_DIR, m_binDir); - if(!CreateDirectory(m_binDir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) + if (!CreateDirectory(m_binDir, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) throw(Exception(IDS_ERR_CREATE_DIR, m_binDir, GetErrMessage())); SetItemStatus(IDC_CREATE_DIR); } -void CBINDInstallDlg::RemoveDirs(BOOL uninstall) -{ - if(!m_keepFiles) - { +void CBINDInstallDlg::RemoveDirs(BOOL uninstall) { + if (!m_keepFiles) { SetCurrent(IDS_REMOVE_DIR, m_binDir); // Check for existence then remove if present - if(GetFileAttributes(m_binDir) != 0xFFFFFFFF) + if (GetFileAttributes(m_binDir) != 0xFFFFFFFF) RemoveDirectory(m_binDir); SetCurrent(IDS_REMOVE_DIR, m_etcDir); - if(GetFileAttributes(m_etcDir) != 0xFFFFFFFF) + if (GetFileAttributes(m_etcDir) != 0xFFFFFFFF) RemoveDirectory(m_etcDir); SetCurrent(IDS_REMOVE_DIR, m_targetDir); - if(GetFileAttributes(m_targetDir) != 0xFFFFFFFF) + if (GetFileAttributes(m_targetDir) != 0xFFFFFFFF) RemoveDirectory(m_targetDir); } - if(uninstall) + if (uninstall) SetItemStatus(IDC_CREATE_DIR, TRUE); } -void CBINDInstallDlg::CopyFiles() -{ +void CBINDInstallDlg::CopyFiles() { CString destFile; - for(int i = 0; installFiles[i].filename; i++) - { + for (int i = 0; installFiles[i].filename; i++) { SetCurrent(IDS_COPY_FILE, installFiles[i].filename); - destFile = DestDir(installFiles[i].destination) + "\\" + installFiles[i].filename; + destFile = DestDir(installFiles[i].destination) + "\\" + + installFiles[i].filename; CString filespec = m_currentDir + "\\" + installFiles[i].filename; - CVersionInfo bindFile(destFile); /* This file doesn't have to exist */ + CVersionInfo bindFile(destFile); CVersionInfo origFile(filespec); - if(!origFile.IsValid() && installFiles[i].checkVer) - { - if(MsgBox(IDS_FILE_BAD, MB_YESNO, installFiles[i].filename) == IDNO) - throw(Exception(IDS_ERR_COPY_FILE, installFiles[i].filename, GetErrMessage())); + if (!origFile.IsValid() && installFiles[i].checkVer) { + if (MsgBox(IDS_FILE_BAD, MB_YESNO, + installFiles[i].filename) == IDNO) + throw(Exception(IDS_ERR_COPY_FILE, + installFiles[i].filename, + GetErrMessage())); } - try - { -/* Ignore Version checking. We need to make sure that all files get copied regardless - of whether or not they are earlier or later versions since we cannot guarantee - that we have either backward or forward compatibility between versions. -*/ + try { +/* + * Ignore Version checking. We need to make sure that all files get copied regardless + * of whether or not they are earlier or later versions since we cannot guarantee + * that we have either backward or forward compatibility between versions. + */ 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) + 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) { SetItemStatus(IDC_COPY_FILE, FALSE); - throw(Exception(IDS_ERR_COPY_FILE, installFiles[i].filename, GetErrMessage())); + throw(Exception(IDS_ERR_COPY_FILE, + installFiles[i].filename, + GetErrMessage())); } } } @@ -572,25 +587,23 @@ void CBINDInstallDlg::CopyFiles() SetItemStatus(IDC_COPY_FILE); } -void CBINDInstallDlg::DeleteFiles(BOOL uninstall) -{ +void CBINDInstallDlg::DeleteFiles(BOOL uninstall) { CString destFile; - for(int i = 0; installFiles[i].filename; i++) - { - if(installFiles[i].checkVer) + for (int i = 0; installFiles[i].filename; i++) { + if (installFiles[i].checkVer) continue; - destFile = DestDir(installFiles[i].destination) + "\\" + installFiles[i].filename; + destFile = DestDir(installFiles[i].destination) + "\\" + + installFiles[i].filename; - if(uninstall) + if (uninstall) SetCurrent(IDS_DELETE_FILE, installFiles[i].filename); DeleteFile(destFile); } - if(!m_keepFiles) - { + if (!m_keepFiles) { WIN32_FIND_DATA findData; CString file = m_etcDir + "\\*.*"; BOOL rc; @@ -599,10 +612,9 @@ void CBINDInstallDlg::DeleteFiles(BOOL uninstall) hFile = FindFirstFile(file, &findData); rc = hFile != INVALID_HANDLE_VALUE; - while(rc == TRUE) - { - if(strcmp(findData.cFileName, ".") && strcmp(findData.cFileName, "..")) - { + while (rc == TRUE) { + if (strcmp(findData.cFileName, ".") && + strcmp(findData.cFileName, "..")) { file = m_etcDir + "\\" + findData.cFileName; SetCurrent(IDS_DELETE_FILE, file); DeleteFile(file); @@ -612,23 +624,127 @@ void CBINDInstallDlg::DeleteFiles(BOOL uninstall) FindClose(hFile); } - if(uninstall) + if (uninstall) SetItemStatus(IDC_COPY_FILE, TRUE); } +/* + * Get the service account name out of the registry, if any + */ +void +CBINDInstallDlg::GetCurrentServiceAccountName() { + HKEY hKey; + BOOL keyFound = FALSE; + char accountName[MAX_PATH]; + DWORD nameLen = MAX_PATH; + CString Tmp; + m_accountUsed = FALSE; + + memset(accountName, 0, nameLen); + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, BIND_SERVICE_SUBKEY, 0, KEY_READ, + &hKey) == ERROR_SUCCESS) { + keyFound = TRUE; + } + else { + m_serviceExists = FALSE; + } + + if (keyFound == TRUE) { + /* Get the named service account, if one was specified */ + if (RegQueryValueEx(hKey, "ObjectName", NULL, NULL, + (LPBYTE)accountName, &nameLen) != ERROR_SUCCESS) + keyFound = FALSE; + } -void CBINDInstallDlg::RegisterService() -{ + RegCloseKey(hKey); + if(keyFound == FALSE) + m_accountName = ""; + 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 = ""; + /* Found account strip any ".\" from it */ + if (Tmp.Left(2) == ".\\") { + m_accountName = Tmp.Mid(2); + m_accountUsed = TRUE; + } + } +} + +BOOL +CBINDInstallDlg::ValidateServiceAccount() { + wchar_t *PrivList[MAX_PRIVS]; + unsigned int PrivCount = 0; + char *Groups[MAX_GROUPS]; + unsigned int totalGroups = 0; + int status; + char *name; + + name = m_accountName.GetBuffer(30); + + status = GetAccountPrivileges(name, PrivList, &PrivCount, + Groups, &totalGroups, MAX_GROUPS); + if (status == RTN_NOACCOUNT) { + m_accountExists = FALSE; + /* We need to do this in case an account was previously used */ + m_accountUsed = FALSE; + return (TRUE); + } + if (status != RTN_OK) { + MsgBox(IDS_ERR_BADACCOUNT); + return (FALSE); + } + + m_accountExists = TRUE; + if (PrivCount > 1) { + if (MsgBox(IDS_ERR_TOOPRIVED, MB_YESNO) == IDYES) + return (FALSE); + else + return (TRUE); + } + + /* See if we have the correct privilege */ + if (wcscmp(PrivList[0], SE_SERVICE_LOGON_PRIV) != 0) { + MsgBox(IDS_ERR_WRONGPRIV, PrivList[0]); + return (FALSE); + } + return (TRUE); +} + +void +CBINDInstallDlg::RegisterService() { SC_HANDLE hSCManager; SC_HANDLE hService; + CString 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(); + SetItemStatus(IDC_REG_SERVICE); + return; + } + else { + SetItemStatus(IDC_REG_SERVICE); + return; + } + } SetCurrent(IDS_OPEN_SCM); hSCManager= OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); - if(!hSCManager) + if (!hSCManager) throw(Exception(IDS_ERR_OPEN_SCM, GetErrMessage())); DWORD dwStart = SERVICE_DEMAND_START; - if(m_autoStart) + if (m_autoStart) dwStart = SERVICE_AUTO_START; DWORD dwServiceType = SERVICE_WIN32_OWN_PROCESS; @@ -637,55 +753,103 @@ void CBINDInstallDlg::RegisterService() namedLoc.Format("%s\\bin\\named.exe", m_targetDir); SetCurrent(IDS_CREATE_SERVICE); - hService = CreateService(hSCManager, BIND_SERVICE_NAME, BIND_DISPLAY_NAME, SERVICE_ALL_ACCESS, dwServiceType, dwStart, - SERVICE_ERROR_NORMAL, namedLoc, NULL, NULL, NULL, NULL, NULL); + hService = CreateService(hSCManager, BIND_SERVICE_NAME, + BIND_DISPLAY_NAME, SERVICE_ALL_ACCESS, dwServiceType, dwStart, + SERVICE_ERROR_NORMAL, namedLoc, NULL, NULL, NULL, StartName, + m_accountPassword); - if(!hService && GetLastError() != ERROR_SERVICE_EXISTS) + if (!hService && GetLastError() != ERROR_SERVICE_EXISTS) throw(Exception(IDS_ERR_CREATE_SERVICE, GetErrMessage())); - if(hSCManager) + if (hService) + CloseServiceHandle(hService); + + if (hSCManager) CloseServiceHandle(hSCManager); - if(hService) + SetItemStatus(IDC_REG_SERVICE); +} + +void +CBINDInstallDlg::UpdateService() { + SC_HANDLE hSCManager; + SC_HANDLE hService; + CString StartName = ".\\" + m_accountName; + + SetCurrent(IDS_OPEN_SCM); + hSCManager= OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + if (!hSCManager) { + MsgBox(IDS_ERR_OPEN_SCM, GetErrMessage()); + return; + } + + DWORD dwStart = SERVICE_DEMAND_START; + if (m_autoStart) + dwStart = SERVICE_AUTO_START; + + DWORD dwServiceType = SERVICE_WIN32_OWN_PROCESS; + + CString namedLoc; + namedLoc.Format("%s\\bin\\named.exe", m_targetDir); + + SetCurrent(IDS_OPEN_SERVICE); + hService = OpenService(hSCManager, BIND_SERVICE_NAME, + SERVICE_CHANGE_CONFIG); + if (!hService) + { + MsgBox(IDS_ERR_OPEN_SERVICE, GetErrMessage()); + if (hSCManager) + CloseServiceHandle(hSCManager); + return; + } + else { + if (ChangeServiceConfig(hService, dwServiceType, dwStart, + SERVICE_ERROR_NORMAL, namedLoc, NULL, NULL, NULL, + StartName, m_accountPassword,BIND_DISPLAY_NAME) + != TRUE) { + DWORD err = GetLastError(); + MsgBox(IDS_ERR_UPDATE_SERVICE, GetErrMessage()); + } + } + + if (hService) CloseServiceHandle(hService); + if (hSCManager) + CloseServiceHandle(hSCManager); + SetItemStatus(IDC_REG_SERVICE); } -void CBINDInstallDlg::UnregisterService(BOOL uninstall) -{ +void CBINDInstallDlg::UnregisterService(BOOL uninstall) { BOOL rc = FALSE; SC_HANDLE hSCManager; SC_HANDLE hService; - while(1) - { + while(1) { SetCurrent(IDS_OPEN_SCM); hSCManager= OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); - if(!hSCManager && uninstall == TRUE) - { + if (!hSCManager && uninstall == TRUE) { MsgBox(IDS_ERR_OPEN_SCM, GetErrMessage()); break; } SetCurrent(IDS_OPEN_SERVICE); - hService = OpenService(hSCManager, BIND_SERVICE_NAME, STANDARD_RIGHTS_REQUIRED); - if(!hService && uninstall == TRUE) + hService = OpenService(hSCManager, BIND_SERVICE_NAME, + STANDARD_RIGHTS_REQUIRED); + if (!hService && uninstall == TRUE) { - if(GetLastError() != ERROR_SERVICE_DOES_NOT_EXIST) - { + if (GetLastError() != ERROR_SERVICE_DOES_NOT_EXIST) { MsgBox(IDS_ERR_OPEN_SERVICE, GetErrMessage()); break; } } - else - { + else { SetCurrent(IDS_REMOVE_SERVICE); - if(!DeleteService(hService) && uninstall == TRUE) - { + if (!DeleteService(hService) && uninstall == TRUE) { DWORD err = GetLastError(); - if(err != ERROR_SERVICE_MARKED_FOR_DELETE && err != ERROR_SERVICE_DOES_NOT_EXIST) - { + if (err != ERROR_SERVICE_MARKED_FOR_DELETE && + err != ERROR_SERVICE_DOES_NOT_EXIST) { MsgBox(IDS_ERR_REMOVE_SERVICE, GetErrMessage()); break; } @@ -696,18 +860,17 @@ void CBINDInstallDlg::UnregisterService(BOOL uninstall) break; } - if(hSCManager) - CloseServiceHandle(hSCManager); - - if(hService) + if (hService) CloseServiceHandle(hService); - if(uninstall) + if (hSCManager) + CloseServiceHandle(hSCManager); + + if (uninstall) SetItemStatus(IDC_REG_SERVICE, rc); } -void CBINDInstallDlg::RegisterMessages() -{ +void CBINDInstallDlg::RegisterMessages() { HKEY hKey; DWORD dwData; char pszMsgDLL[MAX_PATH], buf[MAX_PATH]; @@ -717,16 +880,19 @@ void CBINDInstallDlg::RegisterMessages() SetCurrent(IDS_REGISTER_MESSAGES); /* Create a new key for named */ - if(RegCreateKey(HKEY_LOCAL_MACHINE, BIND_MESSAGE_SUBKEY, &hKey) != ERROR_SUCCESS) + if (RegCreateKey(HKEY_LOCAL_MACHINE, BIND_MESSAGE_SUBKEY, &hKey) + != ERROR_SUCCESS) throw(Exception(IDS_ERR_CREATE_KEY, GetErrMessage())); /* Add the Event-ID message-file name to the subkey. */ - if(RegSetValueEx(hKey, "EventMessageFile", 0, REG_EXPAND_SZ, (LPBYTE)pszMsgDLL, strlen(pszMsgDLL) + 1) != ERROR_SUCCESS) + if (RegSetValueEx(hKey, "EventMessageFile", 0, REG_EXPAND_SZ, + (LPBYTE)pszMsgDLL, strlen(pszMsgDLL) + 1) != ERROR_SUCCESS) throw(Exception(IDS_ERR_SET_VALUE, GetErrMessage())); /* Set the supported types flags and addit to the subkey. */ dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE; - if(RegSetValueEx(hKey, "TypesSupported", 0, REG_DWORD, (LPBYTE)&dwData, sizeof(DWORD)) != ERROR_SUCCESS) + if (RegSetValueEx(hKey, "TypesSupported", 0, REG_DWORD, + (LPBYTE)&dwData, sizeof(DWORD)) != ERROR_SUCCESS) throw(Exception(IDS_ERR_SET_VALUE, GetErrMessage())); RegCloseKey(hKey); @@ -734,38 +900,36 @@ void CBINDInstallDlg::RegisterMessages() SetItemStatus(IDC_REG_MESSAGE); } -void CBINDInstallDlg::UnregisterMessages(BOOL uninstall) -{ +void CBINDInstallDlg::UnregisterMessages(BOOL uninstall) { BOOL rc = FALSE; HKEY hKey = NULL; - while(1) - { + while(1) { SetCurrent(IDS_UNREGISTER_MESSAGES); /* Open key for Application Event Log */ - if(RegOpenKey(HKEY_LOCAL_MACHINE, EVENTLOG_APP_SUBKEY, &hKey) != ERROR_SUCCESS) + if (RegOpenKey(HKEY_LOCAL_MACHINE, EVENTLOG_APP_SUBKEY, &hKey) + != ERROR_SUCCESS) break; /* Remove named from the list of messages sources */ - if(RegDeleteKey(hKey, BIND_MESSAGE_NAME) != ERROR_SUCCESS) + if (RegDeleteKey(hKey, BIND_MESSAGE_NAME) != ERROR_SUCCESS) break; rc = TRUE; break; } - if(hKey) + if (hKey) RegCloseKey(hKey); - if(uninstall) + if (uninstall) SetItemStatus(IDC_REG_MESSAGE, rc); } /* * Install failed - clean up quietly */ -void CBINDInstallDlg::FailedInstall() -{ +void CBINDInstallDlg::FailedInstall() { UnregisterMessages(FALSE); UnregisterService(FALSE); DeleteFiles(FALSE); @@ -775,8 +939,7 @@ void CBINDInstallDlg::FailedInstall() /* * Set the checklist tags for install */ -void CBINDInstallDlg::InstallTags() -{ +void CBINDInstallDlg::InstallTags() { CString tag; tag.LoadString(IDS_INSTALL_FILE); @@ -799,8 +962,7 @@ void CBINDInstallDlg::InstallTags() /* * Set the checklist tags for uninstall */ -void CBINDInstallDlg::UninstallTags() -{ +void CBINDInstallDlg::UninstallTags() { CString tag; tag.LoadString(IDS_UNINSTALL_FILES); @@ -820,8 +982,7 @@ void CBINDInstallDlg::UninstallTags() GetDlgItem(IDC_REG_MESSAGE)->SetWindowText(""); } -void CBINDInstallDlg::SetItemStatus(UINT nID, BOOL bSuccess) -{ +void CBINDInstallDlg::SetItemStatus(UINT nID, BOOL bSuccess) { GetDlgItem(nID)->SetWindowText(bSuccess == TRUE ? "Done" : "Failed"); } @@ -829,8 +990,7 @@ void CBINDInstallDlg::SetItemStatus(UINT nID, BOOL bSuccess) /* * Set the text in the current operation field - use a string table string */ -void CBINDInstallDlg::SetCurrent(int id, ...) -{ +void CBINDInstallDlg::SetCurrent(int id, ...) { CString format; va_list va; char buf[128]; @@ -849,21 +1009,19 @@ void CBINDInstallDlg::SetCurrent(int id, ...) /* * Stop the BIND service */ -void CBINDInstallDlg::StopBINDService() -{ +void CBINDInstallDlg::StopBINDService() { SERVICE_STATUS svcStatus; SetCurrent(IDS_STOP_SERVICE); SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); - if(!hSCManager) - { + if (!hSCManager) { MsgBox(IDS_ERR_OPEN_SCM, GetErrMessage()); } - SC_HANDLE hBINDSvc = OpenService(hSCManager, BIND_SERVICE_NAME, SERVICE_ALL_ACCESS); - if(!hBINDSvc) - { + SC_HANDLE hBINDSvc = OpenService(hSCManager, BIND_SERVICE_NAME, + SERVICE_ALL_ACCESS); + if (!hBINDSvc) { MsgBox(IDS_ERR_OPEN_SERVICE, GetErrMessage()); } @@ -873,19 +1031,17 @@ void CBINDInstallDlg::StopBINDService() /* * Start the BIND service */ -void CBINDInstallDlg::StartBINDService() -{ +void CBINDInstallDlg::StartBINDService() { SetCurrent(IDS_START_SERVICE); SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); - if(!hSCManager) - { + if (!hSCManager) { MsgBox(IDS_ERR_OPEN_SCM, GetErrMessage()); } - SC_HANDLE hBINDSvc = OpenService(hSCManager, BIND_SERVICE_NAME, SERVICE_ALL_ACCESS); - if(!hBINDSvc) - { + SC_HANDLE hBINDSvc = OpenService(hSCManager, BIND_SERVICE_NAME, + SERVICE_ALL_ACCESS); + if (!hBINDSvc) { MsgBox(IDS_ERR_OPEN_SERVICE, GetErrMessage()); } BOOL rc = StartService(hBINDSvc, 0, NULL); @@ -894,31 +1050,30 @@ void CBINDInstallDlg::StartBINDService() /* * Check to see if the BIND service is running or not */ -BOOL CBINDInstallDlg::CheckBINDService() -{ +BOOL CBINDInstallDlg::CheckBINDService() { SERVICE_STATUS svcStatus; SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); - if(hSCManager) - { - SC_HANDLE hBINDSvc = OpenService(hSCManager, BIND_SERVICE_NAME, SERVICE_ALL_ACCESS); - if(hBINDSvc) - { - BOOL rc = ControlService(hBINDSvc, SERVICE_CONTROL_INTERROGATE, &svcStatus); - if(!rc) + if (hSCManager) { + SC_HANDLE hBINDSvc = OpenService(hSCManager, BIND_SERVICE_NAME, + SERVICE_ALL_ACCESS); + if (hBINDSvc) { + BOOL rc = ControlService(hBINDSvc, + SERVICE_CONTROL_INTERROGATE, &svcStatus); + if (!rc) DWORD err = GetLastError(); - return(svcStatus.dwCurrentState == SERVICE_RUNNING); + return (svcStatus.dwCurrentState == SERVICE_RUNNING); } } - return(FALSE); + return (FALSE); } /* - * Display message boxes with variable args, using string table strings for the format specifiers + * Display message boxes with variable args, using string table strings + * for the format specifiers */ -int CBINDInstallDlg::MsgBox(int id, ...) -{ +int CBINDInstallDlg::MsgBox(int id, ...) { CString format; va_list va; char buf[BUFSIZ]; @@ -930,11 +1085,10 @@ int CBINDInstallDlg::MsgBox(int id, ...) vsprintf(buf, format, va); va_end(va); - return(MessageBox(buf)); + return (MessageBox(buf)); } -int CBINDInstallDlg::MsgBox(int id, UINT type, ...) -{ +int CBINDInstallDlg::MsgBox(int id, UINT type, ...) { CString format; va_list va; char buf[BUFSIZ]; @@ -952,8 +1106,7 @@ int CBINDInstallDlg::MsgBox(int id, UINT type, ...) /* * Call GetLastError(), retrieve the message associated with the error */ -CString CBINDInstallDlg::GetErrMessage(DWORD err) -{ +CString CBINDInstallDlg::GetErrMessage(DWORD err) { LPVOID msgBuf; static char buf[BUFSIZ]; @@ -968,8 +1121,7 @@ CString CBINDInstallDlg::GetErrMessage(DWORD err) return(buf); } -void CBINDInstallDlg::ProgramGroup(BOOL create) -{ +void CBINDInstallDlg::ProgramGroup(BOOL create) { TCHAR path[MAX_PATH], commonPath[MAX_PATH], fileloc[MAX_PATH], linkpath[MAX_PATH]; HRESULT hres; IShellLink *psl = NULL; @@ -977,18 +1129,15 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) ITEMIDLIST *itemList = NULL; HRESULT hr = SHGetMalloc(&pMalloc); - if(hr != NOERROR) - { + if (hr != NOERROR) { MessageBox("Could not get a handle to Shell memory object"); return; } hr = SHGetSpecialFolderLocation(m_hWnd, CSIDL_COMMON_PROGRAMS, &itemList); - if(hr != NOERROR) - { + if (hr != NOERROR) { MessageBox("Could not get a handle to the Common Programs folder"); - if(itemList) - { + if (itemList) { pMalloc->Free(itemList); } return; @@ -997,8 +1146,7 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) hr = SHGetPathFromIDList(itemList, commonPath); pMalloc->Free(itemList); - if(create) - { + if (create) { sprintf(path, "%s\\ISC", commonPath); CreateDirectory(path, NULL); @@ -1007,8 +1155,7 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) hres = CoInitialize(NULL); - if (SUCCEEDED(hres)) - { + if (SUCCEEDED(hres)) { // Get a pointer to the IShellLink interface. hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *)&psl); if (SUCCEEDED(hres)) @@ -1021,8 +1168,7 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) psl->SetDescription("BIND Control Panel"); hres = psl->QueryInterface(IID_IPersistFile, (void **)&ppf); - if (SUCCEEDED(hres)) - { + if (SUCCEEDED(hres)) { WCHAR wsz[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, linkpath, -1, wsz, MAX_PATH); @@ -1030,8 +1176,7 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) ppf->Release(); } - if(GetFileAttributes("readme.txt") != -1) - { + if (GetFileAttributes("readme.txt") != -1) { sprintf(fileloc, "%s\\Readme.txt", m_targetDir); sprintf(linkpath, "%s\\Readme.lnk", path); @@ -1039,8 +1184,7 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) psl->SetDescription("BIND Readme"); hres = psl->QueryInterface(IID_IPersistFile, (void **)&ppf); - if (SUCCEEDED(hres)) - { + if (SUCCEEDED(hres)) { WCHAR wsz[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, linkpath, -1, wsz, MAX_PATH); @@ -1053,8 +1197,7 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) CoUninitialize(); } } - else - { + else { TCHAR filename[MAX_PATH]; WIN32_FIND_DATA fd; @@ -1062,16 +1205,13 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) sprintf(filename, "%s\\*.*", path); HANDLE hFind = FindFirstFile(filename, &fd); - if(hFind != INVALID_HANDLE_VALUE) - { - do - { - if(strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, "..")) - { + if (hFind != INVALID_HANDLE_VALUE) { + do { + if (strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, "..")) { sprintf(filename, "%s\\%s", path, fd.cFileName); DeleteFile(filename); } - } while(FindNextFile(hFind, &fd)); + } while (FindNextFile(hFind, &fd)); FindClose(hFind); } RemoveDirectory(path); @@ -1080,10 +1220,8 @@ void CBINDInstallDlg::ProgramGroup(BOOL create) } } -CString CBINDInstallDlg::DestDir(int destination) -{ - switch(destination) - { +CString CBINDInstallDlg::DestDir(int destination) { + switch(destination) { case FileData::TargetDir: return m_targetDir; case FileData::BinDir: diff --git a/bin/win32/BINDInstall/BINDInstallDlg.h b/bin/win32/BINDInstall/BINDInstallDlg.h index 9f8915b4..dcb09ee7 100644 --- a/bin/win32/BINDInstall/BINDInstallDlg.h +++ b/bin/win32/BINDInstall/BINDInstallDlg.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: BINDInstallDlg.h,v 1.3.2.1 2004/03/09 06:10:32 marka Exp $ */ +/* $Id: BINDInstallDlg.h,v 1.3.12.3 2004/03/08 09:04:21 marka Exp $ */ /* * Copyright (c) 1999-2000 by Nortel Networks Corporation @@ -72,6 +72,7 @@ protected: void DeleteFiles(BOOL uninstall); void RegisterService(); + void UpdateService(); void UnregisterService(BOOL uninstall); void RegisterMessages(); @@ -80,6 +81,8 @@ protected: void FailedInstall(); void SetItemStatus(UINT nID, BOOL bSuccess = TRUE); + void GetCurrentServiceAccountName(); + BOOL ValidateServiceAccount(); protected: CString DestDir(int destination); int MsgBox(int id, ...); @@ -94,9 +97,16 @@ protected: CString m_etcDir; CString m_binDir; CString m_winSysDir; - BOOL m_reboot; + BOOL m_installed; CString m_currentDir; - + BOOL m_accountExists; + BOOL m_accountUsed; + CString m_currentAccount; + CString m_accountName; + 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/DirBrowse.cpp b/bin/win32/BINDInstall/DirBrowse.cpp index ba8354e8..c0862602 100644 --- a/bin/win32/BINDInstall/DirBrowse.cpp +++ b/bin/win32/BINDInstall/DirBrowse.cpp @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: DirBrowse.cpp,v 1.3.2.1 2004/03/09 06:10:32 marka Exp $ */ +/* $Id: DirBrowse.cpp,v 1.3.206.1 2004/03/06 10:22:53 marka Exp $ */ /* * Copyright (c) 1999-2000 by Nortel Networks Corporation diff --git a/bin/win32/BINDInstall/DirBrowse.h b/bin/win32/BINDInstall/DirBrowse.h index d01ec49b..d0a70c23 100644 --- a/bin/win32/BINDInstall/DirBrowse.h +++ b/bin/win32/BINDInstall/DirBrowse.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: DirBrowse.h,v 1.3.2.1 2004/03/09 06:10:32 marka Exp $ */ +/* $Id: DirBrowse.h,v 1.3.206.1 2004/03/06 10:22:54 marka Exp $ */ /* * Copyright (c) 1999-2000 by Nortel Networks Corporation diff --git a/bin/win32/BINDInstall/StdAfx.h b/bin/win32/BINDInstall/StdAfx.h index d5929bba..2607529c 100644 --- a/bin/win32/BINDInstall/StdAfx.h +++ b/bin/win32/BINDInstall/StdAfx.h @@ -3,10 +3,6 @@ // are changed infrequently // -#ifndef _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - #if !defined(AFX_STDAFX_H__61537819_39FC_11D3_A97A_00105A12BD65__INCLUDED_) #define AFX_STDAFX_H__61537819_39FC_11D3_A97A_00105A12BD65__INCLUDED_ diff --git a/bin/win32/BINDInstall/resource.h b/bin/win32/BINDInstall/resource.h index 02f6802d..fd142d32 100644 --- a/bin/win32/BINDInstall/resource.h +++ b/bin/win32/BINDInstall/resource.h @@ -50,11 +50,19 @@ #define IDS_NO_VERSION 49 #define IDS_EXISTING_NEWER 50 #define IDS_FILE_BAD 51 +#define IDS_ERR_TOOPRIVED 52 +#define IDS_ERR_BADACCOUNT 53 +#define IDS_ERR_WRONGPRIV 54 +#define IDS_CREATEACCOUNT_FAILED 55 +#define IDS_ERR_PASSWORD 56 +#define IDS_ERR_UPDATE_SERVICE 57 #define IDD_BINDINSTALL_DIALOG 102 #define IDR_MAINFRAME 128 #define IDD_BROWSE 129 #define IDI_CHECK 130 #define IDI_X 132 +#define IDC_CURSOR1 142 +#define IDD_DIALOG1 143 #define IDC_TARGETDIR 1001 #define IDC_BROWSE 1002 #define IDC_DIRLIST 1004 @@ -77,14 +85,17 @@ #define IDC_DRIVES 1021 #define IDC_CURRENT 1021 #define IDC_START 1022 +#define IDC_ACCOUNT_NAME 1030 +#define IDC_ACCOUNT_PASSWORD 1031 +#define IDC_ACCOUNT_PASSWORD_CONFIRM 1032 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 142 +#define _APS_NEXT_RESOURCE_VALUE 144 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1027 -#define _APS_NEXT_SYMED_VALUE 101 +#define _APS_NEXT_SYMED_VALUE 104 #endif #endif |