ReactOS 0.4.16-dev-1142-g8029339
appinfo.h
Go to the documentation of this file.
1#pragma once
2
3#include <atlstr.h>
4#include <atlpath.h>
5#include <atlsimpcoll.h>
6
7
9{
16};
17
18inline BOOL
20{
21 return (x > LICENSE_NONE && x <= LICENSE_MAX);
22}
23
25{
53};
54
55inline BOOL
57{
63
64 return (x >= ENUM_AVAILABLE_MIN && x <= ENUM_AVAILABLE_MAX);
65}
66
67inline BOOL
69{
70 return (x >= ENUM_INSTALLED_MIN && x <= ENUM_INSTALLED_MAX);
71}
72
74{
75 UCF_NONE = 0x00,
76 UCF_MODIFY = 0x01,
77 UCF_SILENT = 0x02,
79};
81
83{
85 INSTALLER_GENERATE, // .zip file automatically converted to installer by rapps
87};
88
89#define DB_VERSION L"Version"
90#define DB_CATEGORY L"Category"
91#define DB_PUBLISHER L"Publisher"
92#define DB_REGNAME L"RegName"
93#define DB_INSTALLER L"Installer"
94#define DB_INSTALLER_GENERATE L"Generate"
95#define DB_INSTALLER_EXEINZIP L"ExeInZip"
96#define DB_SCOPE L"Scope" // User or Machine
97#define DB_SAVEAS L"SaveAs"
98
99#define DB_GENINSTSECTION L"Generate"
100#define GENERATE_ARPSUBKEY L"RApps" // Our uninstall data is stored here
101
102#define DB_EXEINZIPSECTION L"ExeInZip"
103#define DB_EXEINZIP_EXE L"Exe"
104
105class CAppRichEdit;
106class CConfigParser;
107
109{
110 public:
111 CAppInfo(const CStringW &Identifier, AppsCategories Category);
112 virtual ~CAppInfo();
113
114 const CStringW szIdentifier; // PkgName or KeyName
116
121
122 virtual BOOL
123 Valid() const = 0;
124 virtual BOOL
126 virtual BOOL
128 virtual BOOL
130 virtual VOID
131 ShowAppInfo(CAppRichEdit *RichEdit) = 0;
132 virtual VOID
133 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const = 0;
134 virtual VOID
135 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) = 0;
136 virtual InstallerType
138 virtual BOOL
140};
141
143{
152
153 VOID
155 VOID
157 VOID
161
162 public:
164 CConfigParser *Parser,
165 const CStringW &PkgName,
166 AppsCategories Category,
167 const CPathW &BasePath);
169
171 GetConfigParser() const { return m_Parser; }
172
173 virtual BOOL
174 Valid() const override;
175 virtual BOOL
176 CanModify() override;
177 virtual BOOL
178 RetrieveIcon(CStringW &Path) const override;
179 virtual BOOL
181 virtual VOID
182 ShowAppInfo(CAppRichEdit *RichEdit) override;
183 virtual VOID
184 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override;
185 virtual VOID
186 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override;
187 virtual InstallerType
188 GetInstallerType() const override;
189 virtual BOOL
191};
192
194{
199
200 BOOL
202 BOOL
203 GetApplicationRegDword(LPCWSTR lpKeyName, DWORD *lpValue);
204 VOID
205 AddApplicationRegString(CAppRichEdit *RichEdit, UINT StringID, const CStringW &String, DWORD TextFlags);
206
207 VOID
209 VOID
211
212 public:
216
217 CRegKey& GetRegKey() { return m_hKey; }
218
219 virtual BOOL
220 Valid() const override;
221 virtual BOOL
222 CanModify() override;
223 virtual BOOL
224 RetrieveIcon(CStringW &Path) const override;
225 virtual BOOL
227 virtual VOID
228 ShowAppInfo(CAppRichEdit *RichEdit) override;
229 virtual VOID
230 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override;
231 virtual VOID
232 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override;
233 virtual InstallerType
234 GetInstallerType() const override;
235 virtual BOOL
237};
238
239BOOL
241BOOL
244ExtractArchiveForExecution(PCWSTR pszArchive, const CStringW &PackageName, CStringW &TempDir, CStringW &App);
PRTL_UNICODE_STRING_BUFFER Path
LicenseType
Definition: appinfo.h:9
@ LICENSE_NONE
Definition: appinfo.h:10
@ LICENSE_OPENSOURCE
Definition: appinfo.h:11
@ LICENSE_MIN
Definition: appinfo.h:14
@ LICENSE_MAX
Definition: appinfo.h:15
@ LICENSE_TRIAL
Definition: appinfo.h:13
@ LICENSE_FREEWARE
Definition: appinfo.h:12
BOOL ExtractAndRunGeneratedInstaller(const CAvailableApplicationInfo &AppInfo, LPCWSTR Archive)
Definition: geninst.cpp:677
BOOL IsAvailableEnum(INT x)
Definition: appinfo.h:56
BOOL IsInstalledEnum(INT x)
Definition: appinfo.h:68
BOOL IsKnownLicenseType(INT x)
Definition: appinfo.h:19
HRESULT ExtractArchiveForExecution(PCWSTR pszArchive, const CStringW &PackageName, CStringW &TempDir, CStringW &App)
Definition: geninst.cpp:845
UninstallCommandFlags
Definition: appinfo.h:74
@ UCF_NONE
Definition: appinfo.h:75
@ UCF_SILENT
Definition: appinfo.h:77
@ UCF_SAMEPROCESS
Definition: appinfo.h:78
@ UCF_MODIFY
Definition: appinfo.h:76
InstallerType
Definition: appinfo.h:83
@ INSTALLER_UNKNOWN
Definition: appinfo.h:84
@ INSTALLER_EXEINZIP
Definition: appinfo.h:86
@ INSTALLER_GENERATE
Definition: appinfo.h:85
BOOL UninstallGenerated(CInstalledApplicationInfo &AppInfo, UninstallCommandFlags Flags)
Definition: geninst.cpp:837
AppsCategories
Definition: appinfo.h:25
@ ENUM_CAT_LIBS
Definition: appinfo.h:40
@ ENUM_CAT_ENGINEER
Definition: appinfo.h:35
@ ENUM_CAT_VIDEO
Definition: appinfo.h:28
@ ENUM_CAT_FINANCE
Definition: appinfo.h:36
@ ENUM_CAT_OFFICE
Definition: appinfo.h:32
@ ENUM_CAT_EDU
Definition: appinfo.h:34
@ ENUM_CAT_AUDIO
Definition: appinfo.h:27
@ ENUM_CAT_TOOLS
Definition: appinfo.h:38
@ ENUM_UPDATES
Definition: appinfo.h:47
@ ENUM_AVAILABLE_MAX
Definition: appinfo.h:52
@ ENUM_CAT_SELECTED
Definition: appinfo.h:43
@ ENUM_ALL_AVAILABLE
Definition: appinfo.h:26
@ ENUM_CAT_INTERNET
Definition: appinfo.h:31
@ ENUM_CAT_GAMES
Definition: appinfo.h:30
@ ENUM_CAT_THEMES
Definition: appinfo.h:41
@ ENUM_INSTALLED_MAX
Definition: appinfo.h:50
@ ENUM_LASTCATEGORY
Definition: appinfo.h:44
@ ENUM_INSTALLED_MIN
Definition: appinfo.h:49
@ ENUM_INSTALLED_APPLICATIONS
Definition: appinfo.h:46
@ ENUM_CAT_GRAPHICS
Definition: appinfo.h:29
@ ENUM_CAT_DEVEL
Definition: appinfo.h:33
@ ENUM_INVALID
Definition: appinfo.h:48
@ ENUM_CAT_DRIVERS
Definition: appinfo.h:39
@ ENUM_ALL_INSTALLED
Definition: appinfo.h:45
@ ENUM_CAT_SCIENCE
Definition: appinfo.h:37
@ ENUM_AVAILABLE_MIN
Definition: appinfo.h:51
@ ENUM_CAT_OTHER
Definition: appinfo.h:42
@ Identifier
Definition: asmpp.cpp:95
virtual BOOL UninstallApplication(UninstallCommandFlags Flags)=0
virtual BOOL RetrieveIcon(CStringW &Path) const =0
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const =0
CStringW szComments
Definition: appinfo.h:120
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit)=0
CStringW szDisplayIcon
Definition: appinfo.h:117
virtual BOOL CanModify()=0
virtual InstallerType GetInstallerType() const
Definition: appinfo.h:137
CStringW szDisplayName
Definition: appinfo.h:118
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload)=0
virtual BOOL Valid() const =0
CStringW szDisplayVersion
Definition: appinfo.h:119
virtual BOOL RetrieveScreenshot(CStringW &Path)=0
virtual ~CAppInfo()
Definition: appinfo.cpp:26
const AppsCategories iCategory
Definition: appinfo.h:115
const CStringW szIdentifier
Definition: appinfo.h:114
virtual InstallerType GetInstallerType() const override
Definition: appinfo.cpp:379
CSimpleArray< LCID > m_LanguageLCIDs
Definition: appinfo.h:150
CConfigParser * GetConfigParser() const
Definition: appinfo.h:171
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override
Definition: appinfo.cpp:370
virtual BOOL RetrieveScreenshot(CStringW &Path) override
Definition: appinfo.cpp:319
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override
Definition: appinfo.cpp:353
virtual BOOL CanModify() override
Definition: appinfo.cpp:305
virtual BOOL Valid() const override
Definition: appinfo.cpp:299
virtual BOOL UninstallApplication(UninstallCommandFlags Flags) override
Definition: appinfo.cpp:391
VOID InsertLanguageInfo(CAppRichEdit *RichEdit)
Definition: appinfo.cpp:209
CConfigParser * m_Parser
Definition: appinfo.h:144
virtual BOOL RetrieveIcon(CStringW &Path) const override
Definition: appinfo.cpp:311
CSimpleArray< CStringW > m_szScrnshotLocation
Definition: appinfo.h:145
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit) override
Definition: appinfo.cpp:78
VOID InsertVersionInfo(CAppRichEdit *RichEdit)
Definition: appinfo.cpp:124
CRegKey & GetRegKey()
Definition: appinfo.h:217
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit) override
Definition: appinfo.cpp:430
virtual BOOL RetrieveScreenshot(CStringW &Path) override
Definition: appinfo.cpp:569
BOOL GetApplicationRegDword(LPCWSTR lpKeyName, DWORD *lpValue)
Definition: appinfo.cpp:685
CStringW m_szUninstallString
Definition: appinfo.h:197
virtual BOOL Valid() const override
Definition: appinfo.cpp:545
virtual BOOL RetrieveIcon(CStringW &Path) const override
Definition: appinfo.cpp:562
BOOL GetApplicationRegString(LPCWSTR lpKeyName, CStringW &String)
Definition: appinfo.cpp:639
VOID AddApplicationRegString(CAppRichEdit *RichEdit, UINT StringID, const CStringW &String, DWORD TextFlags)
Definition: appinfo.cpp:416
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override
Definition: appinfo.cpp:581
virtual BOOL CanModify() override
Definition: appinfo.cpp:551
virtual InstallerType GetInstallerType() const override
Definition: appinfo.cpp:587
virtual BOOL UninstallApplication(UninstallCommandFlags Flags) override
Definition: appinfo.cpp:598
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override
Definition: appinfo.cpp:575
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define C_ASSERT(e)
Definition: intsafe.h:73
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE)
Definition: ntbasedef.h:737
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185