ReactOS 0.4.16-dev-2208-g6350669
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
8{
15};
16
17inline BOOL
19{
20 return (x > LICENSE_NONE && x <= LICENSE_MAX);
21}
22
24{
52};
53
54inline BOOL
56{
62
63 return (x >= ENUM_AVAILABLE_MIN && x <= ENUM_AVAILABLE_MAX);
64}
65
66inline BOOL
68{
69 return (x >= ENUM_INSTALLED_MIN && x <= ENUM_INSTALLED_MAX);
70}
71
73{
74 UCF_NONE = 0x00,
75 UCF_SILENT = 0x01,
76 UCF_MODIFY = 0x02,
78};
80
82{
84 INSTALLER_EXEINZIP, // setup.exe we extract from a .zip file
85 INSTALLER_GENERATE, // .zip file automatically converted to installer by rapps
89};
90
91#define DB_VERSION L"Version"
92#define DB_CATEGORY L"Category"
93#define DB_PUBLISHER L"Publisher"
94#define DB_REGNAME L"RegName"
95#define DB_INSTALLER L"Installer"
96#define DB_INSTALLER_GENERATE L"Generate"
97#define DB_INSTALLER_EXEINZIP L"ExeInZip"
98#define DB_SCOPE L"Scope" // User or Machine
99#define DB_SAVEAS L"SaveAs"
100#define DB_SILENTARGS L"SilentParameters"
101#define DB_NTVER L"NTVersion" // "Max-" || "Min-Max" || "Min" || "Min+"
102
103#define DB_GENINSTSECTION L"Generate"
104#define GENERATE_ARPSUBKEY L"RApps" // Our uninstall data is stored here
105
106#define DB_EXEINZIPSECTION L"ExeInZip"
107#define DB_EXEINZIP_EXE L"Exe"
108
109class CAppRichEdit;
110class CConfigParser;
111
113{
114 public:
115 CAppInfo(const CStringW &Identifier, AppsCategories Category);
116 virtual ~CAppInfo();
117
118 const CStringW szIdentifier; // PkgName or KeyName
120
125
126 virtual BOOL
127 Valid() const = 0;
128 virtual BOOL
130 virtual BOOL
132 virtual BOOL
134 virtual VOID
135 ShowAppInfo(CAppRichEdit *RichEdit) = 0;
136 virtual VOID
137 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const = 0;
138 virtual VOID
139 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) = 0;
140 virtual InstallerType
141 GetInstallerType(bool NestedType = false) const { return INSTALLER_UNKNOWN; }
142 virtual InstallerType
143 GetInstallerInfo(CStringW &SilentParameters) const { return GetInstallerType(); }
144 virtual BOOL
146};
147
149{
158
159 VOID
161 VOID
163 VOID
167
168 public:
170 CConfigParser *Parser,
171 const CStringW &PkgName,
172 AppsCategories Category,
173 const CPathW &BasePath);
175
177 GetConfigParser() const { return m_Parser; }
178
179 bool
180 IsCompatible() const;
181
182 virtual BOOL
183 Valid() const override;
184 virtual BOOL
185 CanModify() override;
186 virtual BOOL
187 RetrieveIcon(CStringW &Path) const override;
188 virtual BOOL
190 virtual VOID
191 ShowAppInfo(CAppRichEdit *RichEdit) override;
192 virtual VOID
193 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override;
194 virtual VOID
195 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override;
196 virtual InstallerType
197 GetInstallerType(bool NestedType = false) const override;
198 virtual InstallerType
199 GetInstallerInfo(CStringW &SilentParameters) const override;
200 virtual BOOL
202};
203
205{
210
211 BOOL
213 BOOL
214 GetApplicationRegDword(LPCWSTR lpKeyName, DWORD *lpValue);
215 VOID
216 AddApplicationRegString(CAppRichEdit *RichEdit, UINT StringID, const CStringW &String, DWORD TextFlags);
217
218 VOID
220 VOID
222
223 public:
227
228 CRegKey& GetRegKey() { return m_hKey; }
229
230 virtual BOOL
231 Valid() const override;
232 virtual BOOL
233 CanModify() override;
234 virtual BOOL
235 RetrieveIcon(CStringW &Path) const override;
236 virtual BOOL
238 virtual VOID
239 ShowAppInfo(CAppRichEdit *RichEdit) override;
240 virtual VOID
241 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override;
242 virtual VOID
243 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override;
244 virtual InstallerType
245 GetInstallerType(bool NestedType = false) const override;
246 virtual BOOL
248};
249
250BOOL
252BOOL
253ExtractAndRunGeneratedInstaller(const CAvailableApplicationInfo &AppInfo, LPCWSTR Archive, bool Silent);
255ExtractArchiveForExecution(PCWSTR pszArchive, const CStringW &PackageName, CStringW &TempDir, CStringW &App);
PRTL_UNICODE_STRING_BUFFER Path
BOOL ExtractAndRunGeneratedInstaller(const CAvailableApplicationInfo &AppInfo, LPCWSTR Archive, bool Silent)
Definition: geninst.cpp:681
LicenseType
Definition: appinfo.h:8
@ LICENSE_NONE
Definition: appinfo.h:9
@ LICENSE_OPENSOURCE
Definition: appinfo.h:10
@ LICENSE_MIN
Definition: appinfo.h:13
@ LICENSE_MAX
Definition: appinfo.h:14
@ LICENSE_TRIAL
Definition: appinfo.h:12
@ LICENSE_FREEWARE
Definition: appinfo.h:11
BOOL IsAvailableEnum(INT x)
Definition: appinfo.h:55
BOOL IsInstalledEnum(INT x)
Definition: appinfo.h:67
BOOL IsKnownLicenseType(INT x)
Definition: appinfo.h:18
HRESULT ExtractArchiveForExecution(PCWSTR pszArchive, const CStringW &PackageName, CStringW &TempDir, CStringW &App)
Definition: geninst.cpp:850
UninstallCommandFlags
Definition: appinfo.h:73
@ UCF_NONE
Definition: appinfo.h:74
@ UCF_SILENT
Definition: appinfo.h:75
@ UCF_SAMEPROCESS
Definition: appinfo.h:77
@ UCF_MODIFY
Definition: appinfo.h:76
InstallerType
Definition: appinfo.h:82
@ INSTALLER_NSIS
Definition: appinfo.h:88
@ INSTALLER_UNKNOWN
Definition: appinfo.h:83
@ INSTALLER_EXEINZIP
Definition: appinfo.h:84
@ INSTALLER_INNO
Definition: appinfo.h:87
@ INSTALLER_GENERATE
Definition: appinfo.h:85
@ INSTALLER_MSI
Definition: appinfo.h:86
BOOL UninstallGenerated(CInstalledApplicationInfo &AppInfo, UninstallCommandFlags Flags)
Definition: geninst.cpp:842
AppsCategories
Definition: appinfo.h:24
@ ENUM_CAT_LIBS
Definition: appinfo.h:39
@ ENUM_CAT_ENGINEER
Definition: appinfo.h:34
@ ENUM_CAT_VIDEO
Definition: appinfo.h:27
@ ENUM_CAT_FINANCE
Definition: appinfo.h:35
@ ENUM_CAT_OFFICE
Definition: appinfo.h:31
@ ENUM_CAT_EDU
Definition: appinfo.h:33
@ ENUM_CAT_AUDIO
Definition: appinfo.h:26
@ ENUM_CAT_TOOLS
Definition: appinfo.h:37
@ ENUM_UPDATES
Definition: appinfo.h:46
@ ENUM_AVAILABLE_MAX
Definition: appinfo.h:51
@ ENUM_CAT_SELECTED
Definition: appinfo.h:42
@ ENUM_ALL_AVAILABLE
Definition: appinfo.h:25
@ ENUM_CAT_INTERNET
Definition: appinfo.h:30
@ ENUM_CAT_GAMES
Definition: appinfo.h:29
@ ENUM_CAT_THEMES
Definition: appinfo.h:40
@ ENUM_INSTALLED_MAX
Definition: appinfo.h:49
@ ENUM_LASTCATEGORY
Definition: appinfo.h:43
@ ENUM_INSTALLED_MIN
Definition: appinfo.h:48
@ ENUM_INSTALLED_APPLICATIONS
Definition: appinfo.h:45
@ ENUM_CAT_GRAPHICS
Definition: appinfo.h:28
@ ENUM_CAT_DEVEL
Definition: appinfo.h:32
@ ENUM_INVALID
Definition: appinfo.h:47
@ ENUM_CAT_DRIVERS
Definition: appinfo.h:38
@ ENUM_ALL_INSTALLED
Definition: appinfo.h:44
@ ENUM_CAT_SCIENCE
Definition: appinfo.h:36
@ ENUM_AVAILABLE_MIN
Definition: appinfo.h:50
@ ENUM_CAT_OTHER
Definition: appinfo.h:41
@ 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:124
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit)=0
CStringW szDisplayIcon
Definition: appinfo.h:121
virtual BOOL CanModify()=0
CStringW szDisplayName
Definition: appinfo.h:122
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload)=0
virtual InstallerType GetInstallerInfo(CStringW &SilentParameters) const
Definition: appinfo.h:143
virtual BOOL Valid() const =0
CStringW szDisplayVersion
Definition: appinfo.h:123
virtual BOOL RetrieveScreenshot(CStringW &Path)=0
virtual ~CAppInfo()
Definition: appinfo.cpp:26
virtual InstallerType GetInstallerType(bool NestedType=false) const
Definition: appinfo.h:141
const AppsCategories iCategory
Definition: appinfo.h:119
const CStringW szIdentifier
Definition: appinfo.h:118
bool IsCompatible() const
Definition: appinfo.cpp:299
CSimpleArray< LCID > m_LanguageLCIDs
Definition: appinfo.h:156
CConfigParser * GetConfigParser() const
Definition: appinfo.h:177
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override
Definition: appinfo.cpp:397
virtual BOOL RetrieveScreenshot(CStringW &Path) override
Definition: appinfo.cpp:346
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override
Definition: appinfo.cpp:380
virtual InstallerType GetInstallerInfo(CStringW &SilentParameters) const override
Definition: appinfo.cpp:440
virtual BOOL CanModify() override
Definition: appinfo.cpp:332
virtual BOOL Valid() const override
Definition: appinfo.cpp:326
virtual BOOL UninstallApplication(UninstallCommandFlags Flags) override
Definition: appinfo.cpp:448
VOID InsertLanguageInfo(CAppRichEdit *RichEdit)
Definition: appinfo.cpp:209
CConfigParser * m_Parser
Definition: appinfo.h:150
virtual BOOL RetrieveIcon(CStringW &Path) const override
Definition: appinfo.cpp:338
CSimpleArray< CStringW > m_szScrnshotLocation
Definition: appinfo.h:151
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit) override
Definition: appinfo.cpp:78
VOID InsertVersionInfo(CAppRichEdit *RichEdit)
Definition: appinfo.cpp:124
virtual InstallerType GetInstallerType(bool NestedType=false) const override
Definition: appinfo.cpp:416
CRegKey & GetRegKey()
Definition: appinfo.h:228
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit) override
Definition: appinfo.cpp:487
virtual BOOL RetrieveScreenshot(CStringW &Path) override
Definition: appinfo.cpp:626
BOOL GetApplicationRegDword(LPCWSTR lpKeyName, DWORD *lpValue)
Definition: appinfo.cpp:742
virtual InstallerType GetInstallerType(bool NestedType=false) const override
Definition: appinfo.cpp:644
CStringW m_szUninstallString
Definition: appinfo.h:208
virtual BOOL Valid() const override
Definition: appinfo.cpp:602
virtual BOOL RetrieveIcon(CStringW &Path) const override
Definition: appinfo.cpp:619
BOOL GetApplicationRegString(LPCWSTR lpKeyName, CStringW &String)
Definition: appinfo.cpp:696
VOID AddApplicationRegString(CAppRichEdit *RichEdit, UINT StringID, const CStringW &String, DWORD TextFlags)
Definition: appinfo.cpp:473
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override
Definition: appinfo.cpp:638
virtual BOOL CanModify() override
Definition: appinfo.cpp:608
virtual BOOL UninstallApplication(UninstallCommandFlags Flags) override
Definition: appinfo.cpp:655
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override
Definition: appinfo.cpp:632
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:741
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:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2705
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2439
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185