secureswitools/swisistools/source/interpretsislib/sisfile.cpp
branchRCL_3
changeset 24 5cc91383ab1e
parent 17 741e5bba2bd1
child 25 7333d7932ef7
equal deleted inserted replaced
23:cd189dac02f7 24:5cc91383ab1e
   202 
   202 
   203 	failed = failed || !success;
   203 	failed = failed || !success;
   204 
   204 
   205 	if (failed)
   205 	if (failed)
   206 		{
   206 		{
   207 		std::string x;
   207 		std::string x = wstring2string(this->GetPackageName());
   208 		throw InvalidSis(Ucs2ToUtf8(this->GetPackageName(),x),
   208 		throw InvalidSis(x, error, SIS_NOT_SUPPORTED);
   209 			error, SIS_NOT_SUPPORTED);
       
   210 		}
   209 		}
   211 	}
   210 	}
   212 
   211 
   213 bool SisFile::ProcessInstallOptionsWarning(const CSISInstallBlock& aInstallBlock, std::string& aError)
   212 bool SisFile::ProcessInstallOptionsWarning(const CSISInstallBlock& aInstallBlock, std::string& aError)
   214 	{
   213 	{
   261         case CSISFileDescription::EOpText:
   260         case CSISFileDescription::EOpText:
   262         	LWARN(L"File " << target << L" contains \"Display Text\" option that will be ignored." );
   261         	LWARN(L"File " << target << L" contains \"Display Text\" option that will be ignored." );
   263             success = true;
   262             success = true;
   264             break;
   263             break;
   265         case CSISFileDescription::EOpNull:
   264         case CSISFileDescription::EOpNull:
       
   265 		case CSISFileDescription::EOpNone:
   266             success = true;
   266             success = true;
   267             break;
   267             break;
   268         default:
   268         default:
   269             success = false;
   269             success = false;
   270             break;
   270             break;
   274     		{
   274     		{
   275 			aError += "SIS File contains install options : "+operation;
   275 			aError += "SIS File contains install options : "+operation;
   276 			break;
   276 			break;
   277 	    	}
   277 	    	}
   278 		}
   278 		}
       
   279 	return success;
   279 	}
   280 	}
   280 
   281 
   281 
   282 
   282 std::wstring SisFile::GetVendorName() const
   283 std::wstring SisFile::GetVendorName() const
   283 	{
   284 	{
   419 		{
   420 		{
   420 		const CSISIf& ifBlock = ifs[i];
   421 		const CSISIf& ifBlock = ifs[i];
   421 
   422 
   422 		if (ifBlock.WasteOfSpace())
   423 		if (ifBlock.WasteOfSpace())
   423 			{
   424 			{
   424 			std::string x;
       
   425 			std::string error = "corrupt SIS file";
   425 			std::string error = "corrupt SIS file";
   426 			throw InvalidSis(Ucs2ToUtf8(this->GetPackageName(),x), error, INVALID_SIS);
   426 			std::string x = wstring2string(this->GetPackageName());
       
   427 			throw InvalidSis(x, error, INVALID_SIS);
   427 			}
   428 			}
   428 
   429 
   429 		// Main expression
   430 		// Main expression
   430 		const ExpressionResult expressionResult = aEvaluator.Evaluate( ifBlock.Expression() );
   431 		const ExpressionResult expressionResult = aEvaluator.Evaluate( ifBlock.Expression() );
   431 		const bool processBlock = expressionResult.BoolValue();
   432 		const bool processBlock = expressionResult.BoolValue();