Example #1
0
int _tmain(int argc,TCHAR const ** argv){
	SetConsoleTitle(_T("racaljk-host tools"));
	switch (__Check_Parameters(argc,argv)){
/*		CASE(EXEC_START_NORMAL,Shell("-rrun"));
		CASE(EXEC_START_RUNAS|EXEC_START_NORMAL,NormalEntry());
		CASE(EXEC_START_RUNAS|EXEC_START_INSTALL_SERVICE,Func_Service_Install(argv[0]));
		CASE(EXEC_START_RUNAS|EXEC_START_UNINSTALL_SERVICE,Func_Service_UnInstall());
		CASE(EXEC_START_INSTALL_SERVICE,Shell("-rinstall"));
		CASE(EXEC_START_UNINSTALL_SERVICE,Shell("-runinstall"));
		CASE(EXEC_START_SERVICE,StartServiceCtrlDispatcher(STE));
		CASE(EXEC_START_HELP,_tprintf(SHOW_HELP,Sname));*/
/*		case EXEC_BAD_PARAMETERS:
		_tprintf(_T("Bad Parameters."));
		abort();*/
		CASE(EXEC_START_NORMAL,NormalEntry());
		CASE(EXEC_START_INSTALL_SERVICE,Func_Service_Install(argv[0]));
		CASE(EXEC_START_UNINSTALL_SERVICE,Func_Service_UnInstall());
		CASE(EXEC_START_SERVICE,StartServiceCtrlDispatcher(STE));
		CASE(EXEC_START_HELP,__show_str(SHOW_HELP,Sname));
		CASE(EXEC_DEBUG_RESET,___debug_point_reset());
		CASE(SHOW_LICENSE,__show_str(szMitLicenseRaw,NULL));
		default:break;
	}
	return 0;
}
Example #2
0
int _tmain(int argc,LPTSTR * argv){
	GetVersionEx(&_os_);
	SetConsoleTitle(_T("racaljk-host tools"));
	if (argc==1) Shell("-r");
	else
		if (!_tcscmp(_T("-r"),argv[1])) NormalEntry(false);
		else
			if (!_tcscmp(_T("-i"),argv[1])) Shell("-install");
			else
				if (!_tcscmp(_T("-install"),argv[1])) Func_Service_Install(argv[0]);
				else
					if (!_tcscmp(_T("-svc"),argv[1])) StartServiceCtrlDispatcher(STE);
					else 
						if (!_tcscmp(_T("-u"),argv[1])) Shell("-uninstall");
						else
							if (!_tcscmp(_T("-uninstall"),argv[1])) Func_Service_UnInstall();
							else _tprintf(_T("Bad Parameters.\n")),abort();
	return 0;
}