GunzLaucnher - Update1.mrs and Update Launcher.

Results 1 to 13 of 13
  1. #1
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    262Posts

    GunzLaucnher - Update1.mrs and Update Launcher.

    I'm trying to update I get a gunzlauncher.exe desconteo 9 seconds and open the launcher is not updated, and I work the update1.mrs but do not work.

    why is this happening?.


  2. #2
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    You need to fix your updater.exe to update launcher by itself.
    and
    Whenever you make update1 file , always keep your files open and not encrypted in update1.

    means if you are adding lobby.xml , just do this
    Update1 (folder) -> Interface(folder) --> Default (folder) -> Lobby.xml

    and then Encrypt Update1 to .mrs file. put in client and start. it works.

  3. #3
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    262Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    I've done all that and I did well, but do not understand what the update.exe tell me how I fix it?.

    I want to know if the code is correct, this function here has to do with the function of update1.mrs.



    PHP Code:
    bool MZFileSystem::AddItem(MZFILEDESCpDesc)
    {
        
    char key[_MAX_PATH];
        
    strcpy(key,pDesc->m_szFileName);
        
    strlwr(key);
        
        
    _RPT1(_CRT_WARN,"%s\n",key);

        
    ZFLISTITOR it=m_ZFileList.find(key);
        if(
    it!=m_ZFileList.end())
        {
            
    MZFILEDESC *pOld=it->second;

            
    // Function
            
    double diff=difftime(dos2unixtime(pDesc->m_modTime),dos2unixtime(pOld->m_modTime));
            if(
    diff<0//  UltraGunZ
            
    {
                
    // Files Update
                 
    int nOldPkgNum=GetUpdatePackageNumber(pOld->m_szZFileName);
                 
    int nNewPkgNum=GetUpdatePackageNumber(pDesc->m_szZFileName);
                 
    _ASSERT(nOldPkgNum>nNewPkgNum);

                 return 
    false;
            }

            
    // MAIET
            
    delete pOld;
            
    m_ZFileList.erase(it);
        }

        
    m_ZFileList.insert(ZFLIST::value_type(string(key), pDesc));
        return 
    true;

    Log Launcher

    Code:
    Log start : Wed May 01 10:59:55 2013
    
    Current Directory : C:\Users\Jordy\Desktop\GunZ\GunZ 3.0
    10:59:55:668   [APP] OS version : Professional  (Build 7600)
    10:59:56:231   [APP] Window created successfully.
    10:59:58:372   [ZUpdate] Create.
    10:59:58:372   [ZFileTransfer] Create.
    10:59:58:372   [ZFileTransfer] Create successfully complete.
    10:59:58:372   [ZFileTransfer] Open connection.
    10:59:58:387   [ZFileTransfer] Open connection successfully complete.
    10:59:58:387   [ZFileTransfer] Change directory.
    10:59:58:387   [ZFileTransfer] Change directory successfully complete.
    10:59:58:387   [ZUpdate] Create successfully compete.
    10:59:58:403   [APP] Download patch info file
    10:59:58:403   [ZUpdate] Start update.
    10:59:58:403   [ZFileTransfer] Download file : ./patch.xml  to  ./patch.xml
    10:59:58:403   [ZFileTransfer] Download successfully complete.
    10:59:58:403   [ZUpdate] Get update info.
    10:59:58:418   [ZUpdate] Get update info successfully complete.
    10:59:58:418   [ZUpdate] Check valid from patch list.
    11:00:24:872   [ZUpdatePatchNode] Needs to update : ./Gunz.exe
    11:00:24:918   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : './model.mrs'
    11:00:24:934   [ZUpdatePatchNode] Needs to update : ./model.mrs
    11:00:25:043   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : './Update1.mrs'
    11:00:25:043   [ZUpdatePatchNode] Needs to update : ./Update1.mrs
    11:00:25:043   [ZUpdate] Check valid from patch list successfully complete.
    11:00:25:043   [ZUpdate] + Total patch file count : 3
    11:00:25:043   [ZUpdate] + Total patch file size : 31925925 bytes
    11:00:25:043   [APP] Exist patch file(s)
    11:00:25:231   [APP] Start file updating...
    11:00:25:231   [ZUpdate] Patch files.
    11:00:25:231   [ZFileTransfer] Download file : ./Gunz.exe  to  C:\Users\Jordy\Desktop\GunZ\GunZ 3.0 New\PATCH\Gunz.exe_
    11:00:27:028   [ZFileTransfer] Download successfully complete.
    11:00:27:028   [ZUpdate] Successfully download '.\PATCH\Gunz.exe_'
    11:00:27:075   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : '.\PATCH\model.mrs_'
    11:00:27:122   [ZFileTransfer] Download file : ./model.mrs  to  C:\Users\Jordy\Desktop\GunZ\GunZ 3.0 New\PATCH\model.mrs_
    11:00:30:250   [ZFileTransfer] Download successfully complete.
    11:00:30:250   [ZUpdate] Successfully download '.\PATCH\model.mrs_'
    11:00:30:250   [ZFileTransfer] Download file : ./Update1.mrs  to  C:\Users\Jordy\Desktop\GunZ\GunZ 3.0 \PATCH\Update1.mrs_
    11:00:30:375   [ZFileTransfer] Download successfully complete.
    11:00:30:375   [ZUpdate] Successfully download '.\PATCH\Update1.mrs_'
    11:00:30:375   [ZUpdate] Patch files successfully complete.
    11:00:30:375   [ZUpdate] Move patch files.
    11:00:40:078   [ZUpdate] Copy patch file from '.\PATCH\Gunz.exe_'  to  '.\Gunz.exe'
    11:00:52:015   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : '.\PATCH\model.mrs_'
    11:00:52:015   [ZUpdate] ERROR : Invalid CRC '.\PATCH\model.mrs_'
    11:00:52:015   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : '.\PATCH\Update1.mrs_'
    11:00:52:015   [ZUpdate] ERROR : Invalid CRC '.\PATCH\Update1.mrs_'
    11:00:52:031   [ZUpdate] Move patch files successfully complete.
    11:00:52:031   [ZUpdate] ERROR : Cannot move patch files.
    11:00:52:031   [APP] ERROR - Update fail
    11:00:52:031   [APP] Updater error message :
    
    This file is corrupt or missing : '.\PATCH\model.mrs_'
         [Tip] Please check for file authorization
         [Tip] Try delete this file
    This file is corrupt or missing : '.\PATCH\model.mrs_'
         [Tip] Please check for file authorization
         [Tip] Try delete this file
    Invalid CRC from the downloaded patch file. : .\PATCH\model.mrs_
         [Tip] Please check for anti-virus program or firewall running on your system.
    This file is corrupt or missing : '.\PATCH\Update1.mrs_'
         [Tip] Please check for file authorization
         [Tip] Try delete this file
    Invalid CRC from the downloaded patch file. : .\PATCH\Update1.mrs_
         [Tip] Please check for anti-virus program or firewall running on your system.
    
    11:00:52:031   [App] File transfer error message :

  4. #4
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    262Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    how to fix these coment up.

  5. #5
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    replace this thing in NewAppDlg.cpp of Update.exe source !

    NewAppDlg.cpp :

    Spoiler:

    #include "stdafx.h"
    #include "NewAppDlg.h"
    #include <Mmsystem.h>
    #include <Tlhelp32.h>



    // Defines
    #define LAUNCHER_FILENAME "GunzLauncher.exe" // °ÇÁî ·±ÃÄ ½ÇÇà ÆÄÀÏ À̸§



    // DoDataExchange
    void CNewAppDlg::DoDataExchange( CDataExchange* pDX)
    {
    CDDBDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CNewAppDlg)
    DDX_Control(pDX, IDOK, m_cOK);
    //}}AFX_DATA_MAP
    }


    // Message map
    BEGIN_MESSAGE_MAP( CNewAppDlg, CDDBDialog)
    //{{AFX_MSG_MAP(CNewAppDlg)
    ON_WM_TIMER()
    ON_WM_CLOSE()
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()


    /************************************************************************************
    Dialog
    *************************************************************************************/
    // Ŭ·¡½º »ý¼ºÀÚ
    CNewAppDlg::CNewAppDlg( CWnd* pParent) : CDDBDialog( IDD_DIALOG_MAINDLG, pParent)
    {
    // À̰÷¿¡¼­ »ý¼ºÇÒ ´ÙÀ̾ó·Î±×ÀÇ Á¤º¸¸¦ ÀÔ·ÂÇÑ´Ù
    // Á» ´õ ÀÚ¼¼ÇÑ ¼³¸íÀ» ¿øÇϸé CDDBDialog.h È­ÀÏÀÇ Structure of CDDBDIALOGINFO ³»¿ëÀ» Âü°íÇÑ´Ù
    CDDBDLGINFO DlgInfo;
    DlgInfo.nWidth = 300;
    DlgInfo.nHeight = 200;
    DlgInfo.IDSkinResource = IDR_BMP_MAINDLG;
    DlgInfo.IDIconResource = IDR_ICO_MAINFRAME;
    DlgInfo.nTextColor = RGB( 38, 38, 38);
    DlgInfo.nTextBkColor = RGB( 182, 182, 182);

    //#ifdef LOCALE_NHNUSA
    DlgInfo.nTextColor = RGB( 150, 150, 150);
    DlgInfo.nTextBkColor = RGB( 38, 38, 38);
    /*#else
    DlgInfo.bUseTitlebar = true;
    #endif*/

    SetDialogInfo( DlgInfo);
    }


    CNewAppDlg::~CNewAppDlg()
    {
    }


    /************************************************************************************
    Ŭ·¡½º ¸Þ¼¼Áö Çڵ鷯
    *************************************************************************************/
    // OnInitDialog : ´ÙÀ̾ó·Î±×¸¦ ÃʱâÈ­´Â ÇÔ¼ö
    BOOL CNewAppDlg::OnInitDialog()
    {
    CDDBDialog::OnInitDialog();


    // ´ÙÀ̾ó·Î±× ŸÀÌÆ² º¯°æ
    SetWindowText( "GunZ Updater");


    //#ifdef LOCALE_NHNUSA
    GetScreen()->PutText( 1, 3, GetWidth(), 20, 16, "Arial", "GunZ Updater", RGB( 20, 20, 20), TS_BOLD, DT_CENTER);
    GetScreen()->PutText( 0, 2, GetWidth(), 20, 16, "Arial", "GunZ Updater", RGB( 200, 200, 200), TS_BOLD, DT_CENTER);
    GetScreen()->PutBox( 12, 24, GetWidth() - 24, GetHeight() - 68, RGB( 80, 80, 80));
    //#endif


    // ´ÙÀ̾ó·Î±× À§Ä¡ À̵¿ ¹× Å©±â Á¶Àý
    CRect rect;
    GetWindowRect( &rect);
    int nWidth = rect.Width(), nHeight = rect.Height();
    rect.right = rect.left + nWidth;
    rect.bottom = rect.top + nHeight;
    MoveWindow( rect, true);


    // ¸Þ½ÃÁö Ç¥½Ã
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->ResetContent();
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->MoveWindow( 13, 25, GetWidth() - 26, GetHeight() - 70);
    OutputMsg( "Ready...");


    // ¹öư ÃʱâÈ­
    m_cOK.InitDDBButton( IDR_BMP_BUTTON, NULL);
    m_cOK.MoveWindow( GetWidth() / 2 - m_cOK.GetWidth() / 2, GetHeight() - 35);
    m_cOK.EnableWindow( FALSE);


    // ŸÀÌ¸Ó °³½Ã
    SetTimer( 0, 200, NULL);


    return true;
    }


    /************************************************************************************
    ŸÀ̸Ó
    *************************************************************************************/
    void CNewAppDlg::OnTimer(UINT nIDEvent)
    {
    // ¾÷µ¥ÀÌÆ® ŸÀ̸Ó
    if ( nIDEvent == 0)
    {
    static DWORD tStartTime = timeGetTime();
    DWORD currTime = timeGetTime() - tStartTime;


    // ·±ÃÄ ÇÁ·Î¼¼½º°¡ Á¾·áµÇ´Â °ÍÀ» È®ÀÎÇÑ´Ù
    static bool bClosedLauncher = false;
    if ( !bClosedLauncher && (currTime > 500))
    {
    bClosedLauncher = FindLauncherProcess();
    }


    // ÆÄÀÏ ÆÐÄ¡
    if ( bClosedLauncher)
    {
    static int nPatchCount = 0;
    static int nErrorCount = 0;
    switch ( nPatchCount)
    {
    case 0 :
    nPatchCount++;
    if ( PatchFile( ".\\PATCH\\GunzLauncher.exe_", ".\\GunzLauncher.exe") == false)
    nErrorCount++;
    break;

    case 1 :
    nPatchCount++;
    if ( PatchFile( ".\\PATCH\\HanAuthForClient.dll_", ".\\HanAuthForClient.dll") == false)
    nErrorCount++;
    break;

    case 2 :
    nPatchCount++;
    if ( PatchFile( ".\\PATCH\\HanReportForClient.dll_", ".\\HanReportForClient.dll") == false)
    nErrorCount++;
    break;

    case 3 :
    nPatchCount++;

    if ( nErrorCount)
    {
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->ShowScrollBar( SB_HORZ);
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->SetHorizontalExtent( 1000);

    char szMsg[ 512];
    sprintf( szMsg, "%d error has been found.", nErrorCount);
    OutputMsg( szMsg);
    }
    else
    OutputMsg( "Patch successfully completed.");

    tStartTime = timeGetTime();
    m_cOK.EnableWindow( TRUE);
    break;

    // À©µµ¿ì Á¾·á
    case 4 :
    if ( (nErrorCount == 0) && (currTime > 2000))
    OnOK();
    break;

    default :
    break;
    }
    }
    }


    CDDBDialog::OnTimer(nIDEvent);
    }


    /************************************************************************************
    ¸Þ½ÃÁö Ãâ·ÂÇÏ´Â ÇÔ¼ö
    *************************************************************************************/
    void CNewAppDlg::OutputMsg( const char* pszMsg)
    {
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->AddString( pszMsg);
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->SetCaretIndex( ((CListBox*)GetDlgItem( IDC_OUTPUT))->GetCount());
    }


    /************************************************************************************
    Á¾·á ó¸®
    *************************************************************************************/
    void CNewAppDlg::OnOK()
    {
    // ·±Ãĸ¦ ´Ù½Ã ½ÃÀÛÇÑ´Ù.
    char szCmdLine[ 4096] = { 0,};
    sprintf( szCmdLine, ".\\GunzLauncher.exe \"%s\"", GetCommandLine());
    WinExec( szCmdLine, SW_SHOW);


    // À©µµ¿ì Á¾·á
    CDialog::OnOK();
    }

    void CNewAppDlg::OnCancel()
    {
    }


    /************************************************************************************
    ÆÐÄ¡ ½ÃÀÛ
    *************************************************************************************/
    bool CNewAppDlg::FindLauncherProcess()
    {
    // ·±Ãİ¡ ¾ÆÁ÷ ½ÇÇàÁßÀÎÁö È®ÀÎÇÑ´Ù
    if ( FindProcess( LAUNCHER_FILENAME) != NULL)
    return false;


    // ¸¸¾àÀ» À§Çؼ­ 1ÃÊ Á¤µµ ±â´Ù¸°´Ù
    Sleep( 1000);

    return true;
    }


    /************************************************************************************
    ÆÄÀÏ ÆÐÄ¡
    *************************************************************************************/
    bool CNewAppDlg::PatchFile( const char* szPatchFileName, const char* szFileName)
    {
    // ¾÷µ¥ÀÌÆ® ÆÄÀÏÀ» ã´Â´Ù
    WIN32_FIND_DATA FindData;
    HANDLE hFind = FindFirstFile( _T( szPatchFileName), &FindData);
    if ( hFind != INVALID_HANDLE_VALUE) // ÆÄÀÏÀÌ ÀÖÀ¸¸é...
    {
    FindClose( hFind);


    // ¾÷µ¥ÀÌÆ® ÆÄÀÏÀ» º¹»çÇÑ´Ù.
    if ( CopyFile( _T( szPatchFileName), _T( szFileName), false) == TRUE) // º¹»ç ÇßÀ¸¸é...
    {
    // ¾÷µ¥ÀÌÆ® ÆÄÀÏÀ» »èÁ¦ÇÑ´Ù.
    DeleteFile( _T( szPatchFileName));


    // Ãâ·Â ¸Þ½ÃÁö ÀÛ¼º
    char szMsg[ 512];
    sprintf( szMsg, "%s : Patched", szFileName);
    OutputMsg( szMsg);

    return true;
    }

    // º¹»ç ½ÇÆÐÀ̸é...
    else
    {
    // ¿¡·¯ ÄÚµå
    LPVOID lpMsgBuf;
    DWORD error = GetLastError();
    FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
    NULL, error, MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT),
    (LPTSTR)&lpMsgBuf, 0, NULL);

    // Ãâ·Â ¸Þ½ÃÁö ÀÛ¼º
    char szMsg[ 512];
    sprintf( szMsg, "%s : Failed (%s)\n", szFileName, lpMsgBuf);
    OutputMsg( szMsg);

    LocalFree( lpMsgBuf);

    return false;
    }
    }


    return true;
    }


    /************************************************************************************
    ÇØ´ç ÇÁ·Î¼¼½ºÀÇ ÇÚµéÀ» ±¸ÇÑ´Ù
    *************************************************************************************/
    /* 98¿¡¼­ µ¿ÀÛ ¾ÈÇÔ... =_=
    HANDLE CNewAppDlg::FindProcess( const char* pszFileName)
    {
    DWORD ProcessIDList[ 1024], cbNeeded;

    if ( !EnumProcesses( ProcessIDList, sizeof( ProcessIDList), &cbNeeded))
    return NULL;

    // Calculate how many process identifiers were returned.
    int nProcessCount = cbNeeded / sizeof( DWORD);

    for ( int i = 0; i < nProcessCount; i++)
    {
    DWORD nProcessID = ProcessIDList[ i];

    char szProcessName[ MAX_PATH] = "unknown";
    char szProcessPath[ MAX_PATH] = "unknown";

    // Get a handle to the process.
    HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, TRUE, nProcessID);
    if ( NULL != hProcess) // Get the process name.
    {
    HMODULE hMod;
    DWORD cbNeeded;

    if ( EnumProcessModules( hProcess, &hMod, sizeof( hMod), &cbNeeded))
    {
    GetModuleBaseName( hProcess, hMod, szProcessName, sizeof( szProcessName));
    GetModuleFileNameEx( hProcess, hMod, szProcessPath, sizeof( szProcessPath));

    // ÆÄÀÏ À̸§¸¸ ºñ±³
    if ( stricmp( pszFileName, szProcessName) == 0)
    return hProcess;

    // Àüü °æ·Î±îÁö ºñ±³
    else if ( stricmp( pszFileName, szProcessPath) == 0)
    return hProcess;
    }

    CloseHandle( hProcess);
    }
    }

    return NULL;
    }
    */

    HANDLE CNewAppDlg::FindProcess( const char* pszFileName)
    {
    // Take a snapshot of all processes in the system.
    HANDLE hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0);
    if ( hProcessSnap == INVALID_HANDLE_VALUE)
    return NULL;


    // Set the size of the structure before using it.
    PROCESSENTRY32 pe32;
    pe32.dwSize = sizeof( PROCESSENTRY32);


    // Retrieve information about the first process, and exit if unsuccessful
    if ( !Process32First( hProcessSnap, &pe32))
    {
    CloseHandle( hProcessSnap);
    return NULL;
    }


    // Now walk the snapshot of processes, and
    // display information about each process in turn
    do
    {
    // Retrieve the priority class.
    DWORD dwPriorityClass = 0;
    HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);

    if ( hProcess == NULL)
    continue;


    // Get module name
    char szModuleName[ 256];
    strcpy( szModuleName, (LPCTSTR)pe32.szExeFile);

    if ( stricmp( pszFileName, szModuleName) == 0)
    {
    // Find module
    CloseHandle( hProcess);
    CloseHandle( hProcessSnap);

    return hProcess;
    }

    CloseHandle( hProcess);

    } while( Process32Next( hProcessSnap, &pe32));


    CloseHandle( hProcessSnap);

    return NULL;
    }

  6. #6
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    262Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    these is the solution?, okey me tested.

  7. #7
    Ecchi addicted adz28 is offline
    MemberRank
    Nov 2008 Join Date
    IkebukuroLocation
    524Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    Quote Originally Posted by megol View Post
    these is the solution?, okey me tested.
    No, this is only for make Launcher patch itself.

  8. #8
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    262Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    Quote Originally Posted by Ronny786 View Post
    replace this thing in NewAppDlg.cpp of Update.exe source !

    NewAppDlg.cpp :

    Spoiler:

    #include "stdafx.h"
    #include "NewAppDlg.h"
    #include <Mmsystem.h>
    #include <Tlhelp32.h>



    // Defines
    #define LAUNCHER_FILENAME "GunzLauncher.exe" // °ÇÁî ·±ÃÄ ½ÇÇà ÆÄÀÏ À̸§



    // DoDataExchange
    void CNewAppDlg::DoDataExchange( CDataExchange* pDX)
    {
    CDDBDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CNewAppDlg)
    DDX_Control(pDX, IDOK, m_cOK);
    //}}AFX_DATA_MAP
    }


    // Message map
    BEGIN_MESSAGE_MAP( CNewAppDlg, CDDBDialog)
    //{{AFX_MSG_MAP(CNewAppDlg)
    ON_WM_TIMER()
    ON_WM_CLOSE()
    //}}AFX_MSG_MAP
    END_MESSAGE_MAP()


    /************************************************************************************
    Dialog
    *************************************************************************************/
    // Ŭ·¡½º »ý¼ºÀÚ
    CNewAppDlg::CNewAppDlg( CWnd* pParent) : CDDBDialog( IDD_DIALOG_MAINDLG, pParent)
    {
    // À̰÷¿¡¼­ »ý¼ºÇÒ ´ÙÀ̾ó·Î±×ÀÇ Á¤º¸¸¦ ÀÔ·ÂÇÑ´Ù
    // Á» ´õ ÀÚ¼¼ÇÑ ¼³¸íÀ» ¿øÇϸé CDDBDialog.h È­ÀÏÀÇ Structure of CDDBDIALOGINFO ³»¿ëÀ» Âü°íÇÑ´Ù
    CDDBDLGINFO DlgInfo;
    DlgInfo.nWidth = 300;
    DlgInfo.nHeight = 200;
    DlgInfo.IDSkinResource = IDR_BMP_MAINDLG;
    DlgInfo.IDIconResource = IDR_ICO_MAINFRAME;
    DlgInfo.nTextColor = RGB( 38, 38, 38);
    DlgInfo.nTextBkColor = RGB( 182, 182, 182);

    //#ifdef LOCALE_NHNUSA
    DlgInfo.nTextColor = RGB( 150, 150, 150);
    DlgInfo.nTextBkColor = RGB( 38, 38, 38);
    /*#else
    DlgInfo.bUseTitlebar = true;
    #endif*/

    SetDialogInfo( DlgInfo);
    }


    CNewAppDlg::~CNewAppDlg()
    {
    }


    /************************************************************************************
    Ŭ·¡½º ¸Þ¼¼Áö Çڵ鷯
    *************************************************************************************/
    // OnInitDialog : ´ÙÀ̾ó·Î±×¸¦ ÃʱâÈ­´Â ÇÔ¼ö
    BOOL CNewAppDlg::OnInitDialog()
    {
    CDDBDialog::OnInitDialog();


    // ´ÙÀ̾ó·Î±× ŸÀÌÆ² º¯°æ
    SetWindowText( "GunZ Updater");


    //#ifdef LOCALE_NHNUSA
    GetScreen()->PutText( 1, 3, GetWidth(), 20, 16, "Arial", "GunZ Updater", RGB( 20, 20, 20), TS_BOLD, DT_CENTER);
    GetScreen()->PutText( 0, 2, GetWidth(), 20, 16, "Arial", "GunZ Updater", RGB( 200, 200, 200), TS_BOLD, DT_CENTER);
    GetScreen()->PutBox( 12, 24, GetWidth() - 24, GetHeight() - 68, RGB( 80, 80, 80));
    //#endif


    // ´ÙÀ̾ó·Î±× À§Ä¡ À̵¿ ¹× Å©±â Á¶Àý
    CRect rect;
    GetWindowRect( &rect);
    int nWidth = rect.Width(), nHeight = rect.Height();
    rect.right = rect.left + nWidth;
    rect.bottom = rect.top + nHeight;
    MoveWindow( rect, true);


    // ¸Þ½ÃÁö Ç¥½Ã
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->ResetContent();
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->MoveWindow( 13, 25, GetWidth() - 26, GetHeight() - 70);
    OutputMsg( "Ready...");


    // ¹öư ÃʱâÈ­
    m_cOK.InitDDBButton( IDR_BMP_BUTTON, NULL);
    m_cOK.MoveWindow( GetWidth() / 2 - m_cOK.GetWidth() / 2, GetHeight() - 35);
    m_cOK.EnableWindow( FALSE);


    // ŸÀÌ¸Ó °³½Ã
    SetTimer( 0, 200, NULL);


    return true;
    }


    /************************************************************************************
    ŸÀ̸Ó
    *************************************************************************************/
    void CNewAppDlg::OnTimer(UINT nIDEvent)
    {
    // ¾÷µ¥ÀÌÆ® ŸÀ̸Ó
    if ( nIDEvent == 0)
    {
    static DWORD tStartTime = timeGetTime();
    DWORD currTime = timeGetTime() - tStartTime;


    // ·±ÃÄ ÇÁ·Î¼¼½º°¡ Á¾·áµÇ´Â °ÍÀ» È®ÀÎÇÑ´Ù
    static bool bClosedLauncher = false;
    if ( !bClosedLauncher && (currTime > 500))
    {
    bClosedLauncher = FindLauncherProcess();
    }


    // ÆÄÀÏ ÆÐÄ¡
    if ( bClosedLauncher)
    {
    static int nPatchCount = 0;
    static int nErrorCount = 0;
    switch ( nPatchCount)
    {
    case 0 :
    nPatchCount++;
    if ( PatchFile( ".\\PATCH\\GunzLauncher.exe_", ".\\GunzLauncher.exe") == false)
    nErrorCount++;
    break;

    case 1 :
    nPatchCount++;
    if ( PatchFile( ".\\PATCH\\HanAuthForClient.dll_", ".\\HanAuthForClient.dll") == false)
    nErrorCount++;
    break;

    case 2 :
    nPatchCount++;
    if ( PatchFile( ".\\PATCH\\HanReportForClient.dll_", ".\\HanReportForClient.dll") == false)
    nErrorCount++;
    break;

    case 3 :
    nPatchCount++;

    if ( nErrorCount)
    {
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->ShowScrollBar( SB_HORZ);
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->SetHorizontalExtent( 1000);

    char szMsg[ 512];
    sprintf( szMsg, "%d error has been found.", nErrorCount);
    OutputMsg( szMsg);
    }
    else
    OutputMsg( "Patch successfully completed.");

    tStartTime = timeGetTime();
    m_cOK.EnableWindow( TRUE);
    break;

    // À©µµ¿ì Á¾·á
    case 4 :
    if ( (nErrorCount == 0) && (currTime > 2000))
    OnOK();
    break;

    default :
    break;
    }
    }
    }


    CDDBDialog::OnTimer(nIDEvent);
    }


    /************************************************************************************
    ¸Þ½ÃÁö Ãâ·ÂÇÏ´Â ÇÔ¼ö
    *************************************************************************************/
    void CNewAppDlg::OutputMsg( const char* pszMsg)
    {
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->AddString( pszMsg);
    ((CListBox*)GetDlgItem( IDC_OUTPUT))->SetCaretIndex( ((CListBox*)GetDlgItem( IDC_OUTPUT))->GetCount());
    }


    /************************************************************************************
    Á¾·á ó¸®
    *************************************************************************************/
    void CNewAppDlg::OnOK()
    {
    // ·±Ãĸ¦ ´Ù½Ã ½ÃÀÛÇÑ´Ù.
    char szCmdLine[ 4096] = { 0,};
    sprintf( szCmdLine, ".\\GunzLauncher.exe \"%s\"", GetCommandLine());
    WinExec( szCmdLine, SW_SHOW);


    // À©µµ¿ì Á¾·á
    CDialog::OnOK();
    }

    void CNewAppDlg::OnCancel()
    {
    }


    /************************************************************************************
    ÆÐÄ¡ ½ÃÀÛ
    *************************************************************************************/
    bool CNewAppDlg::FindLauncherProcess()
    {
    // ·±Ãİ¡ ¾ÆÁ÷ ½ÇÇàÁßÀÎÁö È®ÀÎÇÑ´Ù
    if ( FindProcess( LAUNCHER_FILENAME) != NULL)
    return false;


    // ¸¸¾àÀ» À§Çؼ­ 1ÃÊ Á¤µµ ±â´Ù¸°´Ù
    Sleep( 1000);

    return true;
    }


    /************************************************************************************
    ÆÄÀÏ ÆÐÄ¡
    *************************************************************************************/
    bool CNewAppDlg::PatchFile( const char* szPatchFileName, const char* szFileName)
    {
    // ¾÷µ¥ÀÌÆ® ÆÄÀÏÀ» ã´Â´Ù
    WIN32_FIND_DATA FindData;
    HANDLE hFind = FindFirstFile( _T( szPatchFileName), &FindData);
    if ( hFind != INVALID_HANDLE_VALUE) // ÆÄÀÏÀÌ ÀÖÀ¸¸é...
    {
    FindClose( hFind);


    // ¾÷µ¥ÀÌÆ® ÆÄÀÏÀ» º¹»çÇÑ´Ù.
    if ( CopyFile( _T( szPatchFileName), _T( szFileName), false) == TRUE) // º¹»ç ÇßÀ¸¸é...
    {
    // ¾÷µ¥ÀÌÆ® ÆÄÀÏÀ» »èÁ¦ÇÑ´Ù.
    DeleteFile( _T( szPatchFileName));


    // Ãâ·Â ¸Þ½ÃÁö ÀÛ¼º
    char szMsg[ 512];
    sprintf( szMsg, "%s : Patched", szFileName);
    OutputMsg( szMsg);

    return true;
    }

    // º¹»ç ½ÇÆÐÀ̸é...
    else
    {
    // ¿¡·¯ ÄÚµå
    LPVOID lpMsgBuf;
    DWORD error = GetLastError();
    FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
    NULL, error, MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT),
    (LPTSTR)&lpMsgBuf, 0, NULL);

    // Ãâ·Â ¸Þ½ÃÁö ÀÛ¼º
    char szMsg[ 512];
    sprintf( szMsg, "%s : Failed (%s)\n", szFileName, lpMsgBuf);
    OutputMsg( szMsg);

    LocalFree( lpMsgBuf);

    return false;
    }
    }


    return true;
    }


    /************************************************************************************
    ÇØ´ç ÇÁ·Î¼¼½ºÀÇ ÇÚµéÀ» ±¸ÇÑ´Ù
    *************************************************************************************/
    /* 98¿¡¼­ µ¿ÀÛ ¾ÈÇÔ... =_=
    HANDLE CNewAppDlg::FindProcess( const char* pszFileName)
    {
    DWORD ProcessIDList[ 1024], cbNeeded;

    if ( !EnumProcesses( ProcessIDList, sizeof( ProcessIDList), &cbNeeded))
    return NULL;

    // Calculate how many process identifiers were returned.
    int nProcessCount = cbNeeded / sizeof( DWORD);

    for ( int i = 0; i < nProcessCount; i++)
    {
    DWORD nProcessID = ProcessIDList[ i];

    char szProcessName[ MAX_PATH] = "unknown";
    char szProcessPath[ MAX_PATH] = "unknown";

    // Get a handle to the process.
    HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, TRUE, nProcessID);
    if ( NULL != hProcess) // Get the process name.
    {
    HMODULE hMod;
    DWORD cbNeeded;

    if ( EnumProcessModules( hProcess, &hMod, sizeof( hMod), &cbNeeded))
    {
    GetModuleBaseName( hProcess, hMod, szProcessName, sizeof( szProcessName));
    GetModuleFileNameEx( hProcess, hMod, szProcessPath, sizeof( szProcessPath));

    // ÆÄÀÏ À̸§¸¸ ºñ±³
    if ( stricmp( pszFileName, szProcessName) == 0)
    return hProcess;

    // Àüü °æ·Î±îÁö ºñ±³
    else if ( stricmp( pszFileName, szProcessPath) == 0)
    return hProcess;
    }

    CloseHandle( hProcess);
    }
    }

    return NULL;
    }
    */

    HANDLE CNewAppDlg::FindProcess( const char* pszFileName)
    {
    // Take a snapshot of all processes in the system.
    HANDLE hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0);
    if ( hProcessSnap == INVALID_HANDLE_VALUE)
    return NULL;


    // Set the size of the structure before using it.
    PROCESSENTRY32 pe32;
    pe32.dwSize = sizeof( PROCESSENTRY32);


    // Retrieve information about the first process, and exit if unsuccessful
    if ( !Process32First( hProcessSnap, &pe32))
    {
    CloseHandle( hProcessSnap);
    return NULL;
    }


    // Now walk the snapshot of processes, and
    // display information about each process in turn
    do
    {
    // Retrieve the priority class.
    DWORD dwPriorityClass = 0;
    HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);

    if ( hProcess == NULL)
    continue;


    // Get module name
    char szModuleName[ 256];
    strcpy( szModuleName, (LPCTSTR)pe32.szExeFile);

    if ( stricmp( pszFileName, szModuleName) == 0)
    {
    // Find module
    CloseHandle( hProcess);
    CloseHandle( hProcessSnap);

    return hProcess;
    }

    CloseHandle( hProcess);

    } while( Process32Next( hProcessSnap, &pe32));


    CloseHandle( hProcessSnap);

    return NULL;
    }

    The updated code works fine, but to replace the old files with the new gives the same error, the updates for the new that are not in the client.

    because?

  9. #9
    Ecchi addicted adz28 is offline
    MemberRank
    Nov 2008 Join Date
    IkebukuroLocation
    524Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    Quote Originally Posted by megol View Post
    The updated code works fine, but to replace the old files with the new gives the same error, the updates for the new that are not in the client.

    because?
    Because what he gave you is just for make the launcher replace itself, nothing related to file replacing, that is a problem of the ZLauncher solution, not the ZLauncherUpdater.

  10. #10
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    Quote Originally Posted by megol View Post
    The updated code works fine, but to replace the old files with the new gives the same error, the updates for the new that are not in the client.

    because?
    you should appreciate the help dude, nobody gives out fixed source. now try to help yourself, refer updater make changes .
    1 hint for you : Comment UpgradeMRS on something like that in launcher source.

  11. #11
    Proficient Member CoreAI is offline
    MemberRank
    Apr 2013 Join Date
    177Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    This has helped me big time, thanks Ronny.. now perhaps you could be kind enough to help me on my other thread :S?

  12. #12
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    262Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    Now does not detect modified mrs files and have not updated the GunzLauncher, and does not replace the file you want to upgrade?.
    and GunzLauncher continues even in the "PATCH/GunzLauncher.exe_" well and does not leave that folder.

  13. #13
    RailGunZ Soon! megol is offline
    MemberRank
    Jun 2012 Join Date
    262Posts

    Re: GunzLaucnher - Update1.mrs and Update Launcher.

    This also happens when I use "TheDuelZPatchBuilder" I get all these errors:

    Code:
    Log start : Wed May 01 10:59:55 2013
    
    Current Directory : C:\Users\Jordy\Desktop\GunZ\GunZ 3.0
    10:59:55:668   [APP] OS version : Professional  (Build 7600)
    10:59:56:231   [APP] Window created successfully.
    10:59:58:372   [ZUpdate] Create.
    10:59:58:372   [ZFileTransfer] Create.
    10:59:58:372   [ZFileTransfer] Create successfully complete.
    10:59:58:372   [ZFileTransfer] Open connection.
    10:59:58:387   [ZFileTransfer] Open connection successfully complete.
    10:59:58:387   [ZFileTransfer] Change directory.
    10:59:58:387   [ZFileTransfer] Change directory successfully complete.
    10:59:58:387   [ZUpdate] Create successfully compete.
    10:59:58:403   [APP] Download patch info file
    10:59:58:403   [ZUpdate] Start update.
    10:59:58:403   [ZFileTransfer] Download file : ./patch.xml  to  ./patch.xml
    10:59:58:403   [ZFileTransfer] Download successfully complete.
    10:59:58:403   [ZUpdate] Get update info.
    10:59:58:418   [ZUpdate] Get update info successfully complete.
    10:59:58:418   [ZUpdate] Check valid from patch list.
    11:00:24:872   [ZUpdatePatchNode] Needs to update : ./Gunz.exe
    11:00:24:918   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : './model.mrs'
    11:00:24:934   [ZUpdatePatchNode] Needs to update : ./model.mrs
    11:00:25:043   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : './Update1.mrs'
    11:00:25:043   [ZUpdatePatchNode] Needs to update : ./Update1.mrs
    11:00:25:043   [ZUpdate] Check valid from patch list successfully complete.
    11:00:25:043   [ZUpdate] + Total patch file count : 3
    11:00:25:043   [ZUpdate] + Total patch file size : 31925925 bytes
    11:00:25:043   [APP] Exist patch file(s)
    11:00:25:231   [APP] Start file updating...
    11:00:25:231   [ZUpdate] Patch files.
    11:00:25:231   [ZFileTransfer] Download file : ./Gunz.exe  to  C:\Users\Jordy\Desktop\GunZ\GunZ 3.0 New\PATCH\Gunz.exe_
    11:00:27:028   [ZFileTransfer] Download successfully complete.
    11:00:27:028   [ZUpdate] Successfully download '.\PATCH\Gunz.exe_'
    11:00:27:075   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : '.\PATCH\model.mrs_'
    11:00:27:122   [ZFileTransfer] Download file : ./model.mrs  to  C:\Users\Jordy\Desktop\GunZ\GunZ 3.0 New\PATCH\model.mrs_
    11:00:30:250   [ZFileTransfer] Download successfully complete.
    11:00:30:250   [ZUpdate] Successfully download '.\PATCH\model.mrs_'
    11:00:30:250   [ZFileTransfer] Download file : ./Update1.mrs  to  C:\Users\Jordy\Desktop\GunZ\GunZ 3.0 \PATCH\Update1.mrs_
    11:00:30:375   [ZFileTransfer] Download successfully complete.
    11:00:30:375   [ZUpdate] Successfully download '.\PATCH\Update1.mrs_'
    11:00:30:375   [ZUpdate] Patch files successfully complete.
    11:00:30:375   [ZUpdate] Move patch files.
    11:00:40:078   [ZUpdate] Copy patch file from '.\PATCH\Gunz.exe_'  to  '.\Gunz.exe'
    11:00:52:015   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : '.\PATCH\model.mrs_'
    11:00:52:015   [ZUpdate] ERROR : Invalid CRC '.\PATCH\model.mrs_'
    11:00:52:015   [ZUpdate:GetCRC] ERROR : Cannot initialize this file : '.\PATCH\Update1.mrs_'
    11:00:52:015   [ZUpdate] ERROR : Invalid CRC '.\PATCH\Update1.mrs_'
    11:00:52:031   [ZUpdate] Move patch files successfully complete.
    11:00:52:031   [ZUpdate] ERROR : Cannot move patch files.
    11:00:52:031   [APP] ERROR - Update fail
    11:00:52:031   [APP] Updater error message :
    
    This file is corrupt or missing : '.\PATCH\model.mrs_'
         [Tip] Please check for file authorization
         [Tip] Try delete this file
    This file is corrupt or missing : '.\PATCH\model.mrs_'
         [Tip] Please check for file authorization
         [Tip] Try delete this file
    Invalid CRC from the downloaded patch file. : .\PATCH\model.mrs_
         [Tip] Please check for anti-virus program or firewall running on your system.
    This file is corrupt or missing : '.\PATCH\Update1.mrs_'
         [Tip] Please check for file authorization
         [Tip] Try delete this file
    Invalid CRC from the downloaded patch file. : .\PATCH\Update1.mrs_
         [Tip] Please check for anti-virus program or firewall running on your system.
    
    11:00:52:031   [App] File transfer error message :
    and when I use "ZPatchBuilder" does not give me much mistakes, but the launcher is not updated and does not detect the old files to be easily upgradeable, the checksum I think no works.

    I want a launcher and repaired, please where I can get one.



Advertisement