Files
ls-2019-source/extra/LS_Service/LS_launcher/Batch/InstallCommand.cpp
T
2026-11-07 13:30:45 +07:00

81 lines
1.4 KiB
C++

#include "StdAfx.h"
#include "InstallCommand.h"
#include "../resource.h"
#include "../LS_launcherDlg.h"
#include "../ServerDialog.h"
#include "../cFile.h"
InstallCommand::InstallCommand(): BaseCommand(BCT_INSTALL)
{
}
InstallCommand::~InstallCommand()
{
}
BOOL InstallCommand::ExecuteServiceAll(CServerDialog* dialog)
{
return ExecuteServiceOne(dialog);
}
BOOL InstallCommand::ExecuteServiceOne(CServerDialog* dialog)
{
if( !dialog )
return FALSE;
// ÀÌ¹Ì ¼³Ä¡µÆ´Ù¸é?
if( CheckContinueServiceOne( dialog ) )
{
m_state = CST_ALREADY_EXCUTE;
return TRUE;
}
m_state = CST_BEFORE_EXCUTE;
if( !dialog->CommandInstall( m_strings[0], m_strings[1], m_strings[2] ) )
{
return FALSE;
}
return TRUE;
}
BOOL InstallCommand::CheckContinueServiceAll(CServerDialog* dialog)
{
return CheckContinueServiceOne(dialog);
}
BOOL InstallCommand::CheckContinueServiceOne(CServerDialog* dialog)
{
if( !dialog )
return FALSE;
int index = dialog->FindServiceIndex( m_strings[0] );
if( index == -1 )
{
return FALSE;
}
return TRUE;
}
BOOL InstallCommand::IsValidDetail()
{
if( m_strings.size() != 3 )
return FALSE;
cFileReader exeFile;
if( !exeFile.Open( m_strings[1].GetBuffer() ) )
{
return FALSE;
}
exeFile.Close();
cFileReader iniFile;
if( !iniFile.Open( m_strings[2].GetBuffer() ) )
{
return FALSE;
}
iniFile.Close();
return TRUE;
}