#pragma once #include #include #include "appinfo.h" class CAppDB { private: CPathW m_BasePath; CAtlList m_Available; CAtlList m_Installed; BOOL EnumerateFiles(); static CInstalledApplicationInfo * EnumerateRegistry(CAtlList *List, LPCWSTR Name); static CInstalledApplicationInfo * CreateInstalledAppByRegistryKey(LPCWSTR KeyName, HKEY hKeyParent, UINT KeyIndex); public: CAppDB(const CStringW &path); static CStringW GetDefaultPath(); VOID GetApps(CAtlList &List, AppsCategories Type) const; CAvailableApplicationInfo * FindAvailableByPackageName(const CStringW &name); CAppInfo * FindByPackageName(const CStringW &name) { return FindAvailableByPackageName(name); } VOID UpdateAvailable(); VOID UpdateInstalled(); VOID RemoveCached(); static DWORD RemoveInstalledAppFromRegistry(const CAppInfo *Info); static CInstalledApplicationInfo * CreateInstalledAppByRegistryKey(LPCWSTR Name); static CInstalledApplicationInfo * CreateInstalledAppInstance(LPCWSTR KeyName, BOOL User, REGSAM WowSam); static HKEY EnumInstalledRootKey(UINT Index, REGSAM &RegSam); size_t GetAvailableCount() const { return m_Available.GetCount(); } };