void BranchInstallInfo::extractInstallChecks(const XML::gcXMLElement &icsNode, gcRefPtr<WildcardManager> &pWildCard, std::vector<InsCheck> &vInsChecks)
{
	icsNode.for_each_child("installlocation", [&vInsChecks, pWildCard, this](const XML::gcXMLElement &icNode)
	{
		const gcString iCheck = icNode.GetChild("check");
		const gcString iPath = icNode.GetChild("path");

		if (iCheck.empty() || iPath.empty())
			return;

		try
		{
			gcString strCheckRes = pWildCard->constructPath(iCheck.c_str());

			if (isInstalled())
			{
				if (!updateInstallCheck(strCheckRes, iPath))
					return;

				vInsChecks.push_back(InsCheck(strCheckRes.c_str(), m_szPath.c_str()));
			}
			else
			{
				vInsChecks.push_back(InsCheck(strCheckRes.c_str(), iPath.c_str()));
			}
		}
		catch (...)
		{
		}
	});
}
Beispiel #2
0
gcString BranchInfo::decodeCDKey(const gcString& strEncodedKey)
{
	if (strEncodedKey.empty())
		return "";

#ifdef WIN32
	std::string reg = UTIL::OS::getConfigValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\MachineGuid", true);
	gcString key("{0}_{1}", reg, m_ItemId.toInt64());
#else
	gcString key("{0}", m_ItemId.toInt64());
#endif

	return UTIL::OS::UserDecodeString(key, strEncodedKey);
}