ReactOS 0.4.17-dev-243-g1369312
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#define DB_DEPENDENCIES L"Dependencies"
103
104#define DB_GENINSTSECTION L"Generate"
105#define GENERATE_ARPSUBKEY L"RApps" // Our uninstall data is stored here
106
107#define DB_EXEINZIPSECTION L"ExeInZip"
108#define DB_EXEINZIP_EXE L"Exe"
109
110class CAppRichEdit;
111class CConfigParser;
112
114{
115 public:
116 CAppInfo(const CStringW &Identifier, AppsCategories Category);
117 virtual ~CAppInfo();
118
119 const CStringW szIdentifier; // PkgName or KeyName
121
126
127 virtual BOOL
128 Valid() const = 0;
129 virtual BOOL
131 virtual BOOL
133 virtual BOOL
135 virtual VOID
136 ShowAppInfo(CAppRichEdit *RichEdit) = 0;
137 virtual VOID
138 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const = 0;
139 virtual VOID
140 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) = 0;
141 virtual InstallerType
142 GetInstallerType(bool NestedType = false) const { return INSTALLER_UNKNOWN; }
143 virtual InstallerType
144 GetInstallerInfo(CStringW &SilentParameters) const { return GetInstallerType(); }
145 virtual BOOL
147};
148
150{
159
160 VOID
162 VOID
164 VOID
168
169 public:
171 CConfigParser *Parser,
172 const CStringW &PkgName,
173 AppsCategories Category,
174 const CPathW &BasePath);
176
178 GetConfigParser() const { return m_Parser; }
179
180 bool
181 IsCompatible() const;
182 bool
183 IsInstalled(CStringW *pOutKeyName = NULL) const;
184
185 virtual BOOL
186 Valid() const override;
187 virtual BOOL
188 CanModify() override;
189 virtual BOOL
190 RetrieveIcon(CStringW &Path) const override;
191 virtual BOOL
193 virtual VOID
194 ShowAppInfo(CAppRichEdit *RichEdit) override;
195 virtual VOID
196 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override;
197 virtual VOID
198 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override;
199 virtual InstallerType
200 GetInstallerType(bool NestedType = false) const override;
201 virtual InstallerType
202 GetInstallerInfo(CStringW &SilentParameters) const override;
203 virtual BOOL
205};
206
208{
213
214 BOOL
216 BOOL
217 GetApplicationRegDword(LPCWSTR lpKeyName, DWORD *lpValue);
218 VOID
219 AddApplicationRegString(CAppRichEdit *RichEdit, UINT StringID, const CStringW &String, DWORD TextFlags);
220
221 VOID
223 VOID
225
226 public:
230
231 CRegKey& GetRegKey() { return m_hKey; }
232
233 virtual BOOL
234 Valid() const override;
235 virtual BOOL
236 CanModify() override;
237 virtual BOOL
238 RetrieveIcon(CStringW &Path) const override;
239 virtual BOOL
241 virtual VOID
242 ShowAppInfo(CAppRichEdit *RichEdit) override;
243 virtual VOID
244 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override;
245 virtual VOID
246 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override;
247 virtual InstallerType
248 GetInstallerType(bool NestedType = false) const override;
249 virtual BOOL
251};
252
253BOOL
255BOOL
256ExtractAndRunGeneratedInstaller(const CAvailableApplicationInfo &AppInfo, LPCWSTR Archive, bool Silent);
258ExtractArchiveForExecution(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:125
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit)=0
CStringW szDisplayIcon
Definition: appinfo.h:122
virtual BOOL CanModify()=0
CStringW szDisplayName
Definition: appinfo.h:123
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload)=0
virtual InstallerType GetInstallerInfo(CStringW &SilentParameters) const
Definition: appinfo.h:144
virtual BOOL Valid() const =0
CStringW szDisplayVersion
Definition: appinfo.h:124
virtual BOOL RetrieveScreenshot(CStringW &Path)=0
virtual ~CAppInfo()
Definition: appinfo.cpp:26
virtual InstallerType GetInstallerType(bool NestedType=false) const
Definition: appinfo.h:142
const AppsCategories iCategory
Definition: appinfo.h:120
const CStringW szIdentifier
Definition: appinfo.h:119
bool IsCompatible() const
Definition: appinfo.cpp:315
CSimpleArray< LCID > m_LanguageLCIDs
Definition: appinfo.h:157
CConfigParser * GetConfigParser() const
Definition: appinfo.h:178
bool IsInstalled(CStringW *pOutKeyName=NULL) const
Definition: appinfo.cpp:124
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override
Definition: appinfo.cpp:413
virtual BOOL RetrieveScreenshot(CStringW &Path) override
Definition: appinfo.cpp:362
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override
Definition: appinfo.cpp:396
virtual InstallerType GetInstallerInfo(CStringW &SilentParameters) const override
Definition: appinfo.cpp:456
virtual BOOL CanModify() override
Definition: appinfo.cpp:348
virtual BOOL Valid() const override
Definition: appinfo.cpp:342
virtual BOOL UninstallApplication(UninstallCommandFlags Flags) override
Definition: appinfo.cpp:464
VOID InsertLanguageInfo(CAppRichEdit *RichEdit)
Definition: appinfo.cpp:225
CConfigParser * m_Parser
Definition: appinfo.h:151
virtual BOOL RetrieveIcon(CStringW &Path) const override
Definition: appinfo.cpp:354
CSimpleArray< CStringW > m_szScrnshotLocation
Definition: appinfo.h:152
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit) override
Definition: appinfo.cpp:78
VOID InsertVersionInfo(CAppRichEdit *RichEdit)
Definition: appinfo.cpp:140
virtual InstallerType GetInstallerType(bool NestedType=false) const override
Definition: appinfo.cpp:432
CRegKey & GetRegKey()
Definition: appinfo.h:231
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit) override
Definition: appinfo.cpp:503
virtual BOOL RetrieveScreenshot(CStringW &Path) override
Definition: appinfo.cpp:642
BOOL GetApplicationRegDword(LPCWSTR lpKeyName, DWORD *lpValue)
Definition: appinfo.cpp:758
virtual InstallerType GetInstallerType(bool NestedType=false) const override
Definition: appinfo.cpp:660
CStringW m_szUninstallString
Definition: appinfo.h:211
virtual BOOL Valid() const override
Definition: appinfo.cpp:618
virtual BOOL RetrieveIcon(CStringW &Path) const override
Definition: appinfo.cpp:635
BOOL GetApplicationRegString(LPCWSTR lpKeyName, CStringW &String)
Definition: appinfo.cpp:712
VOID AddApplicationRegString(CAppRichEdit *RichEdit, UINT StringID, const CStringW &String, DWORD TextFlags)
Definition: appinfo.cpp:489
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override
Definition: appinfo.cpp:654
virtual BOOL CanModify() override
Definition: appinfo.cpp:624
virtual BOOL UninstallApplication(UninstallCommandFlags Flags) override
Definition: appinfo.cpp:671
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override
Definition: appinfo.cpp:648
#define NULL
Definition: types.h:112
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
const uint16_t * LPCWSTR
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