src/Cedar/SW.c
// Determine whether detection of the component is successful

Determine whether detection of the component is successful
Determine whether detection of the component is successful
bool SwIsComponentDetected(SW* sw, SW_COMPONENT* c)
{
	UINT i;
	bool ret = true;
	if (sw == NULL || c == NULL)
	{
		return false;
	}
	for (i = 0;i < LIST_NUM(c->NeedFiles);i++)
	{
		char* name = LIST_DATA(c->NeedFiles, i);
		wchar_t name_w[MAX_SIZE];
		wchar_t fullpath[MAX_SIZE];
		StrToUni(name_w, sizeof(name_w), name);
		CombinePathW(fullpath, sizeof(fullpath), sw->InstallSrc, name_w);
		if (IsFileExistsW(fullpath) == false)
		{
			ret = false;
			break;
		}
	}
	if (c->InstallService == false)
	{
		if (sw->IsEasyInstaller || sw->IsWebInstaller)
		{
			ret = false;
		}
	}
	return ret;
}
bool SwIsComponentDetected ( SW * sw , SW_COMPONENT * c ) { UINT i ; bool ret = true ; if ( sw == NULL || c == NULL ) { return false ; } for ( i = 0 ; i < LIST_NUM ( c -> NeedFiles ) ; i ++ ) { char * name = LIST_DATA ( c -> NeedFiles , i ) ; wchar_t name_w [ MAX_SIZE ] ; wchar_t fullpath [ MAX_SIZE ] ; StrToUni ( name_w , sizeof ( name_w ) , name ) ; CombinePathW ( fullpath , sizeof ( fullpath ) , sw -> InstallSrc , name_w ) ; if ( IsFileExistsW ( fullpath ) == false ) { ret = false ; break ; } } if ( c -> InstallService == false ) { if ( sw -> IsEasyInstaller || sw -> IsWebInstaller ) { ret = false ; } } return ret ; }
Determine whether detection of the component is successful
Determine whether detection of the component is successful
// Validate arguments
 // Prevent installing only management tool
 // for Web installer or a simple installer
