ReactOS 0.4.16-dev-1338-g8aab5a9
appinfo.h File Reference
#include <atlstr.h>
#include <atlpath.h>
#include <atlsimpcoll.h>
Include dependency graph for appinfo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CAppInfo
 
class  CAvailableApplicationInfo
 
class  CInstalledApplicationInfo
 

Macros

#define DB_VERSION   L"Version"
 
#define DB_CATEGORY   L"Category"
 
#define DB_PUBLISHER   L"Publisher"
 
#define DB_REGNAME   L"RegName"
 
#define DB_INSTALLER   L"Installer"
 
#define DB_INSTALLER_GENERATE   L"Generate"
 
#define DB_INSTALLER_EXEINZIP   L"ExeInZip"
 
#define DB_SCOPE   L"Scope"
 
#define DB_SAVEAS   L"SaveAs"
 
#define DB_GENINSTSECTION   L"Generate"
 
#define GENERATE_ARPSUBKEY   L"RApps"
 
#define DB_EXEINZIPSECTION   L"ExeInZip"
 
#define DB_EXEINZIP_EXE   L"Exe"
 

Enumerations

enum  LicenseType {
  LICENSE_NONE , LICENSE_OPENSOURCE = 1 , LICENSE_FREEWARE = 2 , LICENSE_TRIAL = 3 ,
  LICENSE_MIN = LICENSE_NONE , LICENSE_MAX = LICENSE_TRIAL
}
 
enum  AppsCategories {
  ENUM_ALL_AVAILABLE , ENUM_CAT_AUDIO , ENUM_CAT_VIDEO , ENUM_CAT_GRAPHICS ,
  ENUM_CAT_GAMES , ENUM_CAT_INTERNET , ENUM_CAT_OFFICE , ENUM_CAT_DEVEL ,
  ENUM_CAT_EDU , ENUM_CAT_ENGINEER , ENUM_CAT_FINANCE , ENUM_CAT_SCIENCE ,
  ENUM_CAT_TOOLS , ENUM_CAT_DRIVERS , ENUM_CAT_LIBS , ENUM_CAT_THEMES ,
  ENUM_CAT_OTHER , ENUM_CAT_SELECTED , ENUM_LASTCATEGORY = ENUM_CAT_SELECTED - 1 , ENUM_ALL_INSTALLED = 30 ,
  ENUM_INSTALLED_APPLICATIONS , ENUM_UPDATES , ENUM_INVALID , ENUM_INSTALLED_MIN = ENUM_ALL_INSTALLED ,
  ENUM_INSTALLED_MAX = ENUM_UPDATES , ENUM_AVAILABLE_MIN = ENUM_ALL_AVAILABLE , ENUM_AVAILABLE_MAX = ENUM_CAT_SELECTED
}
 
enum  UninstallCommandFlags { UCF_NONE = 0x00 , UCF_MODIFY = 0x01 , UCF_SILENT = 0x02 , UCF_SAMEPROCESS = 0x04 }
 
enum  InstallerType { INSTALLER_UNKNOWN , INSTALLER_GENERATE , INSTALLER_EXEINZIP }
 

Functions

BOOL IsKnownLicenseType (INT x)
 
BOOL IsAvailableEnum (INT x)
 
BOOL IsInstalledEnum (INT x)
 
 DEFINE_ENUM_FLAG_OPERATORS (UninstallCommandFlags)
 
BOOL UninstallGenerated (CInstalledApplicationInfo &AppInfo, UninstallCommandFlags Flags)
 
BOOL ExtractAndRunGeneratedInstaller (const CAvailableApplicationInfo &AppInfo, LPCWSTR Archive)
 
HRESULT ExtractArchiveForExecution (PCWSTR pszArchive, const CStringW &PackageName, CStringW &TempDir, CStringW &App)
 

Macro Definition Documentation

◆ DB_CATEGORY

#define DB_CATEGORY   L"Category"

Definition at line 90 of file appinfo.h.

◆ DB_EXEINZIP_EXE

#define DB_EXEINZIP_EXE   L"Exe"

Definition at line 103 of file appinfo.h.

◆ DB_EXEINZIPSECTION

#define DB_EXEINZIPSECTION   L"ExeInZip"

Definition at line 102 of file appinfo.h.

◆ DB_GENINSTSECTION

#define DB_GENINSTSECTION   L"Generate"

Definition at line 99 of file appinfo.h.

◆ DB_INSTALLER

#define DB_INSTALLER   L"Installer"

Definition at line 93 of file appinfo.h.

◆ DB_INSTALLER_EXEINZIP

#define DB_INSTALLER_EXEINZIP   L"ExeInZip"

Definition at line 95 of file appinfo.h.

◆ DB_INSTALLER_GENERATE

#define DB_INSTALLER_GENERATE   L"Generate"

Definition at line 94 of file appinfo.h.

◆ DB_PUBLISHER

#define DB_PUBLISHER   L"Publisher"

Definition at line 91 of file appinfo.h.

◆ DB_REGNAME

#define DB_REGNAME   L"RegName"

Definition at line 92 of file appinfo.h.

◆ DB_SAVEAS

#define DB_SAVEAS   L"SaveAs"

Definition at line 97 of file appinfo.h.

◆ DB_SCOPE

#define DB_SCOPE   L"Scope"

Definition at line 96 of file appinfo.h.

◆ DB_VERSION

#define DB_VERSION   L"Version"

Definition at line 89 of file appinfo.h.

◆ GENERATE_ARPSUBKEY

#define GENERATE_ARPSUBKEY   L"RApps"

Definition at line 100 of file appinfo.h.

Enumeration Type Documentation

◆ AppsCategories

Enumerator
ENUM_ALL_AVAILABLE 
ENUM_CAT_AUDIO 
ENUM_CAT_VIDEO 
ENUM_CAT_GRAPHICS 
ENUM_CAT_GAMES 
ENUM_CAT_INTERNET 
ENUM_CAT_OFFICE 
ENUM_CAT_DEVEL 
ENUM_CAT_EDU 
ENUM_CAT_ENGINEER 
ENUM_CAT_FINANCE 
ENUM_CAT_SCIENCE 
ENUM_CAT_TOOLS 
ENUM_CAT_DRIVERS 
ENUM_CAT_LIBS 
ENUM_CAT_THEMES 
ENUM_CAT_OTHER 
ENUM_CAT_SELECTED 
ENUM_LASTCATEGORY 
ENUM_ALL_INSTALLED 
ENUM_INSTALLED_APPLICATIONS 
ENUM_UPDATES 
ENUM_INVALID 
ENUM_INSTALLED_MIN 
ENUM_INSTALLED_MAX 
ENUM_AVAILABLE_MIN 
ENUM_AVAILABLE_MAX 

Definition at line 24 of file appinfo.h.

25{
53};
@ 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

◆ InstallerType

Enumerator
INSTALLER_UNKNOWN 
INSTALLER_GENERATE 
INSTALLER_EXEINZIP 

Definition at line 82 of file appinfo.h.

83{
85 INSTALLER_GENERATE, // .zip file automatically converted to installer by rapps
87};
@ INSTALLER_UNKNOWN
Definition: appinfo.h:84
@ INSTALLER_EXEINZIP
Definition: appinfo.h:86
@ INSTALLER_GENERATE
Definition: appinfo.h:85

◆ LicenseType

Enumerator
LICENSE_NONE 
LICENSE_OPENSOURCE 
LICENSE_FREEWARE 
LICENSE_TRIAL 
LICENSE_MIN 
LICENSE_MAX 

Definition at line 8 of file appinfo.h.

9{
13 LICENSE_TRIAL = 3,
16};
@ 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

◆ UninstallCommandFlags

Enumerator
UCF_NONE 
UCF_MODIFY 
UCF_SILENT 
UCF_SAMEPROCESS 

Definition at line 73 of file appinfo.h.

74{
75 UCF_NONE = 0x00,
76 UCF_MODIFY = 0x01,
77 UCF_SILENT = 0x02,
78 UCF_SAMEPROCESS = 0x04,
79};
@ UCF_NONE
Definition: appinfo.h:75
@ UCF_SILENT
Definition: appinfo.h:77
@ UCF_SAMEPROCESS
Definition: appinfo.h:78
@ UCF_MODIFY
Definition: appinfo.h:76

Function Documentation

◆ DEFINE_ENUM_FLAG_OPERATORS()

DEFINE_ENUM_FLAG_OPERATORS ( UninstallCommandFlags  )

◆ ExtractAndRunGeneratedInstaller()

BOOL ExtractAndRunGeneratedInstaller ( const CAvailableApplicationInfo AppInfo,
LPCWSTR  Archive 
)

Definition at line 677 of file geninst.cpp.

678{
679 InstallInfo Info(AppInfo.szDisplayName, *AppInfo.GetConfigParser(), Archive);
680 g_pInfo = &Info;
681 return CreateUI(Info.Silent, ExtractAndInstallThread) ? !Info.Error : FALSE;
682}
CStringW szDisplayName
Definition: appinfo.h:118
CConfigParser * GetConfigParser() const
Definition: appinfo.h:171
#define FALSE
Definition: types.h:117
static DWORD CALLBACK ExtractAndInstallThread(LPVOID Parameter)
Definition: geninst.cpp:450
static struct CommonInfo * g_pInfo
static BOOL CreateUI(BOOL Silent, LPTHREAD_START_ROUTINE ThreadProc)
Definition: geninst.cpp:646
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by HandleGenerateInstallerCommand().

◆ ExtractArchiveForExecution()

HRESULT ExtractArchiveForExecution ( PCWSTR  pszArchive,
const CStringW PackageName,
CStringW TempDir,
CStringW App 
)

Definition at line 845 of file geninst.cpp.

846{
847 WCHAR TempDirBuf[MAX_PATH], UniqueDir[MAX_PATH];
849 db.UpdateAvailable();
850 CAvailableApplicationInfo *pAppInfo = db.FindAvailableByPackageName(PackageName);
851 if (!pAppInfo)
853 CConfigParser *pCfg = pAppInfo->GetConfigParser();
854
855 if (!GetTempPathW(_countof(TempDirBuf), TempDirBuf))
856 return E_FAIL;
857 wsprintfW(UniqueDir, L"~%s-%u", RAPPS_NAME, GetCurrentProcessId());
858 TempDir = BuildPath(TempDirBuf, UniqueDir);
860 if (FAILED(hr))
861 return hr;
862
863 hr = HResultFromWin32(ExtractArchive(pszArchive, TempDir, NULL, NULL));
864 if (SUCCEEDED(hr))
865 {
868 {
870 HANDLE hFind = FindFirstFileW(Exe = BuildPath(TempDir, L"*.exe"), &wfd);
871 if (hFind != INVALID_HANDLE_VALUE)
872 {
873 FindClose(hFind);
874 Exe = wfd.cFileName;
875 }
876 }
877 App = BuildPath(TempDir, Exe);
880 }
881
882 if (FAILED(hr) && !TempDir.IsEmpty())
884 return hr;
885}
#define DB_EXEINZIPSECTION
Definition: appinfo.h:102
#define DB_EXEINZIP_EXE
Definition: appinfo.h:103
#define RAPPS_NAME
Definition: defines.h:34
static CStringW BuildPath(const T &Base, LPCWSTR Append)
Definition: misc.h:106
BOOL DeleteDirectoryTree(LPCWSTR Dir, HWND hwnd=NULL)
Definition: misc.cpp:513
UINT CreateDirectoryTree(LPCWSTR Dir)
Definition: misc.cpp:526
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
Definition: appdb.h:9
static CStringW GetDefaultPath()
Definition: appdb.cpp:39
UINT GetSectionString(LPCWSTR Section, LPCWSTR Name, CStringW &Result)
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
#define L(x)
Definition: resources.c:13
static UINT ExtractArchive(LPCWSTR Archive, const CStringW &OutputDir, EXTRACTCALLBACK Callback, void *Context)
Definition: geninst.cpp:157
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define HResultFromWin32
Definition: loader.cpp:14
HWND hMainWnd
Definition: magnifier.c:32
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
Definition: xml2sdb.h:149
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
#define ERROR_NOT_FOUND
Definition: winerror.h:690
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CDownloadManager::PerformDownloadAndInstall().

◆ IsAvailableEnum()

BOOL IsAvailableEnum ( INT  x)
inline

Definition at line 56 of file appinfo.h.

Referenced by CMainWindow::OnCommand(), and CMainWindow::UpdateApplicationsList().

◆ IsInstalledEnum()

◆ IsKnownLicenseType()

BOOL IsKnownLicenseType ( INT  x)
inline

Definition at line 19 of file appinfo.h.

20{
21 return (x > LICENSE_NONE && x <= LICENSE_MAX);
22}

Referenced by CAvailableApplicationInfo::LicenseString().

◆ UninstallGenerated()

BOOL UninstallGenerated ( CInstalledApplicationInfo AppInfo,
UninstallCommandFlags  Flags 
)

Definition at line 837 of file geninst.cpp.

838{
840 g_pInfo = &Info;
841 return CreateUI(Info.Silent, UninstallThread) ? !Info.Error : FALSE;
842}
static DWORD CALLBACK UninstallThread(LPVOID Parameter)
Definition: geninst.cpp:702
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by CInstalledApplicationInfo::UninstallApplication().