
if ($update)\{
	// set the update filename
	//$update_file = strtolower("$product-$update_ver-$update_patchType-$build_target-update_lang.mar");
	$updates_path = "$updates_path$update_ver$channel/update/$build_target";
	if (!(file_exists($updates_path . "/" . $locale)))\{
		$locale=$update_lang;
	\}
	$updates_path = "$updates_path/$locale/";
	$fileup = scandir($updates_path);
	foreach($fileup as $file)\{
		if ($file === '.' or $file === '..') continue;
		if ((strpos($file, 'complete')) !== false) \{
			$update_file_complete = $file;
			$update_file_complete_link = str_replace(" ", "%20", $update_file_complete);
			if ( is_readable($updates_path . $update_file_complete))\{
				$update_complete =true;
				$update_file_complete_hash = hash_file("sha512", $updates_path . $update_file_complete);
				$update_file_complete_size = filesize($updates_path . $update_file_complete);
				continue;
			\}
		\}elseif (((strpos($file, "partial")) !== false) && ($major == false)) \{
			$update_file_partial = $file;
			$update_file_partial_link = str_replace(" ", "%20", $update_file_partial);
			if ( is_readable($updates_path . $update_file_partial))\{
				$update_partial = true;
				$update_file_partial_hash = hash_file("sha512", $updates_path . $update_file_partial);
				$update_file_partial_size = filesize($updates_path . $update_file_partial);
				continue;
			\}
		\}
	\}