ReactOS 0.4.16-dev-1946-g52006dd
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
102#define DB_GENINSTSECTION L"Generate"
103#define GENERATE_ARPSUBKEY L"RApps" // Our uninstall data is stored here
104
105#define DB_EXEINZIPSECTION L"ExeInZip"
106#define DB_EXEINZIP_EXE L"Exe"
107
108class CAppRichEdit;
109class CConfigParser;
110
112{
113 public:
114 CAppInfo(const CStringW &Identifier, AppsCategories Category);
115 virtual ~CAppInfo();
116
117 const CStringW szIdentifier; // PkgName or KeyName
119
124
125 virtual BOOL
126 Valid() const = 0;
127 virtual BOOL
129 virtual BOOL
131 virtual BOOL
133 virtual VOID
134 ShowAppInfo(CAppRichEdit *RichEdit) = 0;
135 virtual VOID
136 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const = 0;
137 virtual VOID
138 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) = 0;
139 virtual InstallerType
140 GetInstallerType(bool NestedType = false) const { return INSTALLER_UNKNOWN; }
141 virtual InstallerType
142 GetInstallerInfo(CStringW &SilentParameters) const { return GetInstallerType(); }
143 virtual BOOL
145};
146
148{
157
158 VOID
160 VOID
162 VOID
166
167 public:
169 CConfigParser *Parser,
170 const CStringW &PkgName,
171 AppsCategories Category,
172 const CPathW &BasePath);
174
176 GetConfigParser() const { return m_Parser; }
177
178 virtual BOOL
179 Valid() const override;
180 virtual BOOL
181 CanModify() override;
182 virtual BOOL
183 RetrieveIcon(CStringW &Path) const override;
184 virtual BOOL
186 virtual VOID
187 ShowAppInfo(CAppRichEdit *RichEdit) override;
188 virtual VOID
189 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override;
190 virtual VOID
191 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override;
192 virtual InstallerType
193 GetInstallerType(bool NestedType = false) const override;
194 virtual InstallerType
195 GetInstallerInfo(CStringW &SilentParameters) const override;
196 virtual BOOL
198};
199
201{
206
207 BOOL
209 BOOL
210 GetApplicationRegDword(LPCWSTR lpKeyName, DWORD *lpValue);
211 VOID
212 AddApplicationRegString(CAppRichEdit *RichEdit, UINT StringID, const CStringW &String, DWORD TextFlags);
213
214 VOID
216 VOID
218
219 public:
223
224 CRegKey& GetRegKey() { return m_hKey; }
225
226 virtual BOOL
227 Valid() const override;
228 virtual BOOL
229 CanModify() override;
230 virtual BOOL
231 RetrieveIcon(CStringW &Path) const override;
232 virtual BOOL
234 virtual VOID
235 ShowAppInfo(CAppRichEdit *RichEdit) override;
236 virtual VOID
237 GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override;
238 virtual VOID
239 GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override;
240 virtual InstallerType
241 GetInstallerType(bool NestedType = false) const override;
242 virtual BOOL
244};
245
246BOOL
248BOOL
249ExtractAndRunGeneratedInstaller(const CAvailableApplicationInfo &AppInfo, LPCWSTR Archive, bool Silent);
251ExtractArchiveForExecution(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:123
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit)=0
CStringW szDisplayIcon
Definition: appinfo.h:120
virtual BOOL CanModify()=0
CStringW szDisplayName
Definition: appinfo.h:121
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload)=0
virtual InstallerType GetInstallerInfo(CStringW &SilentParameters) const
Definition: appinfo.h:142
virtual BOOL Valid() const =0
CStringW szDisplayVersion
Definition: appinfo.h:122
virtual BOOL RetrieveScreenshot(CStringW &Path)=0
virtual ~CAppInfo()
Definition: appinfo.cpp:26
virtual InstallerType GetInstallerType(bool NestedType=false) const
Definition: appinfo.h:140
const AppsCategories iCategory
Definition: appinfo.h:118
const CStringW szIdentifier
Definition: appinfo.h:117
CSimpleArray< LCID > m_LanguageLCIDs
Definition: appinfo.h:155
CConfigParser * GetConfigParser() const
Definition: appinfo.h:176
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 InstallerType GetInstallerInfo(CStringW &SilentParameters) const override
Definition: appinfo.cpp:413
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:421
VOID InsertLanguageInfo(CAppRichEdit *RichEdit)
Definition: appinfo.cpp:209
CConfigParser * m_Parser
Definition: appinfo.h:149
virtual BOOL RetrieveIcon(CStringW &Path) const override
Definition: appinfo.cpp:311
CSimpleArray< CStringW > m_szScrnshotLocation
Definition: appinfo.h:150
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:389
CRegKey & GetRegKey()
Definition: appinfo.h:224
virtual VOID ShowAppInfo(CAppRichEdit *RichEdit) override
Definition: appinfo.cpp:460
virtual BOOL RetrieveScreenshot(CStringW &Path) override
Definition: appinfo.cpp:599
BOOL GetApplicationRegDword(LPCWSTR lpKeyName, DWORD *lpValue)
Definition: appinfo.cpp:715
virtual InstallerType GetInstallerType(bool NestedType=false) const override
Definition: appinfo.cpp:617
CStringW m_szUninstallString
Definition: appinfo.h:204
virtual BOOL Valid() const override
Definition: appinfo.cpp:575
virtual BOOL RetrieveIcon(CStringW &Path) const override
Definition: appinfo.cpp:592
BOOL GetApplicationRegString(LPCWSTR lpKeyName, CStringW &String)
Definition: appinfo.cpp:669
VOID AddApplicationRegString(CAppRichEdit *RichEdit, UINT StringID, const CStringW &String, DWORD TextFlags)
Definition: appinfo.cpp:446
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload) override
Definition: appinfo.cpp:611
virtual BOOL CanModify() override
Definition: appinfo.cpp:581
virtual BOOL UninstallApplication(UninstallCommandFlags Flags) override
Definition: appinfo.cpp:628
virtual VOID GetDownloadInfo(CStringW &Url, CStringW &Sha1, ULONG &SizeInBytes) const override
Definition: appinfo.cpp:605
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