reactos/base/applications/rapps/include/appdb.h
Whindmar Saksit 57b775ef6e
[RAPPS] Automatically generate installer/uninstaller for downloaded zip/cab files (#6652)
With a single database line added to applications distributed as zip/cab allows rapps.exe to act as an installer that automatically extracts the files and creates a startmenu shortcut. It can also uninstall the extracted files (and optionally other files and registry entries created by the application).
2024-05-08 23:58:54 +02:00

54 lines
1.3 KiB
C++

#pragma once
#include <atlcoll.h>
#include <atlpath.h>
#include "appinfo.h"
class CAppDB
{
private:
CPathW m_BasePath;
CAtlList<CAppInfo *> m_Available;
CAtlList<CAppInfo *> m_Installed;
BOOL
EnumerateFiles();
static CInstalledApplicationInfo *
EnumerateRegistry(CAtlList<CAppInfo *> *List, LPCWSTR Name);
static CInstalledApplicationInfo *
CreateInstalledAppByRegistryKey(LPCWSTR KeyName, HKEY hKeyParent, UINT KeyIndex);
public:
CAppDB(const CStringW &path);
VOID
GetApps(CAtlList<CAppInfo *> &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();
}
};