[RAPPS] Re-add support for icons named after the ini file

This commit is contained in:
Mark Jansen 2020-09-30 19:24:52 +02:00
parent 12caaece25
commit 7a2c1f7d0b
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

@ -92,18 +92,32 @@ VOID CAvailableApplicationInfo::RetrieveGeneralInfo(AvailableStrings& AvlbString
}
}
ATL::CStringW IconPath = AvlbStrings.szAppsPath;
PathAppendW(IconPath.GetBuffer(MAX_PATH), L"icons");
// TODO: are we going to support specify an URL for an icon ?
ATL::CStringW IconLocation;
if (GetString(L"Icon", IconLocation))
{
// TODO: Does the filename contain anything stuff like ":" "<" ">" ?
// these stuff may lead to security issues
ATL::CStringW IconPath = AvlbStrings.szAppsPath;
PathAppendW(IconPath.GetBuffer(MAX_PATH), L"icons");
BOOL bSuccess = PathAppendNoDirEscapeW(IconPath.GetBuffer(), IconLocation.GetString());
IconPath.ReleaseBuffer();
if (bSuccess)
if (!bSuccess)
{
IconPath.Empty();
}
}
else
{
// inifile.ico
PathAppendW(IconPath.GetBuffer(), m_szPkgName);
IconPath.ReleaseBuffer();
IconPath += L".ico";
}
if (!IconPath.IsEmpty())
{
if (PathFileExistsW(IconPath))
{
m_szIconLocation = IconPath;
}