#include "stdafx.h"
#include "PostInstallUtils.h"
#include "StartProcCmdLineInfo.h"


CStartProcCmdLineInfo::CStartProcCmdLineInfo(void)
{
}


CStartProcCmdLineInfo::~CStartProcCmdLineInfo(void)
{
}


void CStartProcCmdLineInfo::ParseParam(
    const TCHAR* pszParam,
    BOOL bFlag,
    BOOL bLast
    )
{
    CString sParam(pszParam);
    if (bFlag&&(sParam == _T("install"))) {
        theApp.m_bInstallDriver = true;
    }
    else if (bFlag&&(sParam == _T("uninstall")))
    {
        theApp.m_bUninstallDriver = true;
    }
    else if (bFlag&&((sParam == _T("h")) || (sParam == _T("?"))))
    {
        theApp.m_bUsageOut = true;
    }
    else if (bFlag)
    {
        theApp.m_bParseError = true;
    }
    else if (bLast && !bFlag)
    {
        theApp.m_bParseError = true;
    }
    if (bLast && theApp.m_bInstallDriver && theApp.m_bUninstallDriver)
    {
        theApp.m_bParseError = true;
    }
    if (bLast && theApp.m_bParseError)
    {
        theApp.m_bUsageOut = true;
    }
}
