2024-12-21 10:04:04 +08:00
// PatchBuilderP4.cpp : <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> α <CEB1> <D7B7> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> Ŭ<> <C5AC> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> մϴ<D5B4> .
//
# include "stdafx.h"
# include "SundriesFunc.h"
# include "PatchBuilderP4.h"
# include "PatchBuilderP4Dlg.h"
# include "tinyxml.h"
# ifdef _DEBUG
# define new DEBUG_NEW
# endif
// CPatchBuilderP4App
BEGIN_MESSAGE_MAP ( CPatchBuilderP4App , CWinApp )
ON_COMMAND ( ID_HELP , & CWinApp : : OnHelp )
END_MESSAGE_MAP ( )
// CPatchBuilderP4App <20> <> <EFBFBD> <EFBFBD>
CPatchBuilderP4App : : CPatchBuilderP4App ( )
{
// TODO: <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> ڵ带 <20> ߰<EFBFBD> <DFB0> մϴ<D5B4> .
// InitInstance<63> <65> <20> <> <EFBFBD> <EFBFBD> <20> ߿<EFBFBD> <DFBF> <EFBFBD> <20> ʱ<EFBFBD> ȭ <20> ۾<EFBFBD> <DBBE> <EFBFBD> <20> <> ġ<EFBFBD> մϴ<D5B4> .
}
CPatchBuilderP4App : : ~ CPatchBuilderP4App ( )
{
LogWnd : : DestroyLog ( ) ;
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> CPatchBuilderP4App <20> <> ü<EFBFBD> Դϴ<D4B4> .
CPatchBuilderP4App theApp ;
// CPatchBuilderP4App <20> ʱ<EFBFBD> ȭ
BOOL CPatchBuilderP4App : : InitInstance ( )
{
// <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> α <CEB1> <20> Ŵ<EFBFBD> <C5B4> 佺Ʈ<E4BDBA> <C6AE> ComCtl32.dll <20> <> <EFBFBD> <EFBFBD> 6 <20> ̻<EFBFBD> <CCBB> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ͽ<EFBFBD> <20> <> <EFBFBD> ־<EFBFBD> <20> <> Ÿ<EFBFBD> <C5B8> <EFBFBD> <EFBFBD>
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ϴ<EFBFBD> <20> <> <EFBFBD> <EFBFBD> , Windows XP <20> <EFBFBD> <20> ݵ<EFBFBD> <DDB5> <EFBFBD> InitCommonControlsEx()<29> <> <20> ʿ<EFBFBD> <CABF> մϴ<D5B4> .
// InitCommonControlsEx()<29> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> â<> <C3A2> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ϴ<EFBFBD> .
INITCOMMONCONTROLSEX InitCtrls ;
InitCtrls . dwSize = sizeof ( InitCtrls ) ;
// <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> α <CEB1> <D7B7> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> Ʈ<EFBFBD> <C6AE> Ŭ<> <C5AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD>
// <20> <> <20> <EFBFBD> <D7B8> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ͻʽ ÿ<CABD> .
InitCtrls . dwICC = ICC_WIN95_CLASSES ;
InitCommonControlsEx ( & InitCtrls ) ;
CWinApp : : InitInstance ( ) ;
AfxEnableControlContainer ( ) ;
m_RegProfile . LoadProfile ( ) ;
CPatchBuilderP4Dlg dlg ;
m_pMainWnd = & dlg ;
UseLogFile ( ) ;
if ( m_RegProfile . GetProfileCount ( ) )
{
SProfile * pProfile = m_RegProfile . GetProfile ( 0 ) ;
dlg . m_szP4Url = pProfile - > szP4Url . c_str ( ) ;
dlg . m_szP4UrlFolder = pProfile - > szP4UrlFolder . c_str ( ) ;
dlg . m_szP4UrlServer = pProfile - > szP4UrlServer . c_str ( ) ;
dlg . m_szP4UrlServerFolder = pProfile - > szP4UrlServerFolder . c_str ( ) ;
dlg . m_szP4Workspace = pProfile - > szP4Workspace . c_str ( ) ;
dlg . m_szRMakeCmd = pProfile - > szRMakeCmd . c_str ( ) ;
dlg . m_szManualPatchExe = pProfile - > szManualPatchExe . c_str ( ) ;
dlg . m_szCountryCode = pProfile - > szCountryCode . c_str ( ) ;
}
else
{
dlg . m_szP4Url = " 10.0.1.40:1666 " ;
dlg . m_szP4UrlFolder = " //DragonNest/Client/... " ;
dlg . m_szP4UrlServer = " 10.0.1.40:1666 " ;
dlg . m_szP4UrlServerFolder = " //DragonNest/Server/... " ;
dlg . m_szP4Workspace = " c: \\ UpdateFolder " ;
dlg . m_szRMakeCmd = " \\ \\ 192.168.0.11 \\ tooldata \\ Utility \\ RMakeCmd.exe " ;
dlg . m_szCountryCode = " Kor " ;
dlg . m_szManualPatchExe = " \\ \\ 192.168.0.11 \\ tooldata \\ Utility \\ DnManualUpdater_KR.exe " ;
}
DWORD dwValue ;
GetRegistryNumber ( HKEY_CURRENT_USER , REG_SUBKEY , " MakeFullVersion " , dwValue ) ;
if ( dwValue ) dlg . m_bMakeFullVersion = TRUE ;
GetRegistryNumber ( HKEY_CURRENT_USER , REG_SUBKEY , " MakeServerData " , dwValue ) ;
if ( dwValue ) dlg . m_bCopyServerData = TRUE ;
GetRegistryNumber ( HKEY_CURRENT_USER , REG_SUBKEY , " RollBack " , dwValue ) ;
if ( dwValue ) dlg . m_bRollBack = TRUE ;
GetRegistryNumber ( HKEY_CURRENT_USER , REG_SUBKEY , " ManualPatch " , dwValue ) ;
if ( dwValue ) dlg . m_bManualPatch = TRUE ;
if ( strlen ( m_lpCmdLine ) )
{
char * pFindPtr ;
pFindPtr = strstr ( m_lpCmdLine , " Profile: " ) ;
if ( pFindPtr )
{
pFindPtr + = strlen ( " Profile: " ) ;
int nProfile = atoi ( pFindPtr ) ;
dlg . m_nDefaultProfile = nProfile ;
dlg . m_bAutoStart = TRUE ;
}
pFindPtr = strstr ( m_lpCmdLine , " /MakeFull:true " ) ;
if ( pFindPtr )
{
dlg . m_bMakeFullVersion = TRUE ;
}
else
{
pFindPtr = strstr ( m_lpCmdLine , " /MakeFull:false " ) ;
if ( pFindPtr )
{
dlg . m_bMakeFullVersion = FALSE ;
}
}
pFindPtr = strstr ( m_lpCmdLine , " /CopyServerData:true " ) ;
if ( pFindPtr )
{
dlg . m_bCopyServerData = TRUE ;
}
else
{
pFindPtr = strstr ( m_lpCmdLine , " /CopyServerData:false " ) ;
if ( pFindPtr )
{
dlg . m_bCopyServerData = FALSE ;
}
}
pFindPtr = strstr ( m_lpCmdLine , " /RollBack:true " ) ;
if ( pFindPtr )
{
dlg . m_bRollBack = TRUE ;
}
else
{
pFindPtr = strstr ( m_lpCmdLine , " /RollBack:false " ) ;
if ( pFindPtr )
{
dlg . m_bRollBack = FALSE ;
}
}
pFindPtr = strstr ( m_lpCmdLine , " /ManualPatch:true " ) ;
if ( pFindPtr )
{
dlg . m_bManualPatch = TRUE ;
}
else
{
pFindPtr = strstr ( m_lpCmdLine , " /ManualPatch:false " ) ;
if ( pFindPtr )
{
dlg . m_bManualPatch = FALSE ;
}
}
}
INT_PTR nResponse = dlg . DoModal ( ) ;
if ( nResponse = = IDOK )
{
}
else if ( nResponse = = IDCANCEL )
{
}
return FALSE ;
}
void CPatchBuilderP4App : : UseLogFile ( )
{
TCHAR szCurFileName [ MAX_PATH ] = { 0 , } ;
: : GetModuleFileName ( NULL , szCurFileName , MAX_PATH ) ;
TCHAR szDrive [ MAX_PATH ] = { 0 , } ;
TCHAR szDir [ MAX_PATH ] = { 0 , } ;
TCHAR szFileName [ MAX_PATH ] = { 0 , } ;
TCHAR szExt [ MAX_PATH ] = { 0 , } ;
_splitpath_s ( szCurFileName , szDrive , szDir , szFileName , szExt ) ;
CString _szCurPath ;
_szCurPath . Format ( _T ( " %s%s \\ Log " ) , szDrive , szDir ) ;
if ( GetFileAttributes ( _szCurPath . GetBuffer ( ) ) ! = FILE_ATTRIBUTE_DIRECTORY )
CreateDirectory ( _szCurPath . GetBuffer ( ) , NULL ) ;
LogWnd : : CreateLog ( true , LogWnd : : LOG_TARGET_FILE ) ;
}