ReactOS 0.4.16-dev-1948-gd260c1d
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_SILENTARGS   L"SilentParameters"
 
#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_SILENT = 0x01 , UCF_MODIFY = 0x02 , UCF_SAMEPROCESS = 0x04 }
 
enum  InstallerType {
  INSTALLER_UNKNOWN , INSTALLER_EXEINZIP , INSTALLER_GENERATE , INSTALLER_MSI ,
  INSTALLER_INNO , INSTALLER_NSIS
}
 

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, bool Silent)
 
HRESULT ExtractArchiveForExecution (PCWSTR pszArchive, const CStringW &PackageName, CStringW &TempDir, CStringW &App)
 

Macro Definition Documentation

◆ DB_CATEGORY

#define DB_CATEGORY   L"Category"

Definition at line 92 of file appinfo.h.

◆ DB_EXEINZIP_EXE

#define DB_EXEINZIP_EXE   L"Exe"

Definition at line 106 of file appinfo.h.

◆ DB_EXEINZIPSECTION

#define DB_EXEINZIPSECTION   L"ExeInZip"

Definition at line 105 of file appinfo.h.

◆ DB_GENINSTSECTION

#define DB_GENINSTSECTION   L"Generate"

Definition at line 102 of file appinfo.h.

◆ DB_INSTALLER

#define DB_INSTALLER   L"Installer"

Definition at line 95 of file appinfo.h.

◆ DB_INSTALLER_EXEINZIP

#define DB_INSTALLER_EXEINZIP   L"ExeInZip"

Definition at line 97 of file appinfo.h.

◆ DB_INSTALLER_GENERATE

#define DB_INSTALLER_GENERATE   L"Generate"

Definition at line 96 of file appinfo.h.

◆ DB_PUBLISHER

#define DB_PUBLISHER   L"Publisher"

Definition at line 93 of file appinfo.h.

◆ DB_REGNAME

#define DB_REGNAME   L"RegName"

Definition at line 94 of file appinfo.h.

◆ DB_SAVEAS

#define DB_SAVEAS   L"SaveAs"

Definition at line 99 of file appinfo.h.

◆ DB_SCOPE

#define DB_SCOPE   L"Scope"

Definition at line 98 of file appinfo.h.

◆ DB_SILENTARGS

#define DB_SILENTARGS   L"SilentParameters"

Definition at line 100 of file appinfo.h.

◆ DB_VERSION

#define DB_VERSION   L"Version"

Definition at line 91 of file appinfo.h.

◆ GENERATE_ARPSUBKEY

#define GENERATE_ARPSUBKEY   L"RApps"

Definition at line 103 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 23 of file appinfo.h.

24{
52};
@ 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

◆ InstallerType

Enumerator
INSTALLER_UNKNOWN 
INSTALLER_EXEINZIP 
INSTALLER_GENERATE 
INSTALLER_MSI 
INSTALLER_INNO 
INSTALLER_NSIS 

Definition at line 81 of file appinfo.h.

82{
84 INSTALLER_EXEINZIP, // setup.exe we extract from a .zip file
85 INSTALLER_GENERATE, // .zip file automatically converted to installer by rapps
89};
@ 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

◆ LicenseType

Enumerator
LICENSE_NONE 
LICENSE_OPENSOURCE 
LICENSE_FREEWARE 
LICENSE_TRIAL 
LICENSE_MIN 
LICENSE_MAX 

Definition at line 7 of file appinfo.h.

8{
12 LICENSE_TRIAL = 3,
15};
@ 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

◆ UninstallCommandFlags

Enumerator
UCF_NONE 
UCF_SILENT 
UCF_MODIFY 
UCF_SAMEPROCESS 

Definition at line 72 of file appinfo.h.

73{
74 UCF_NONE = 0x00,
75 UCF_SILENT = 0x01,
76 UCF_MODIFY = 0x02,
77 UCF_SAMEPROCESS = 0x04,
78};
@ UCF_NONE
Definition: appinfo.h:74
@ UCF_SILENT
Definition: appinfo.h:75
@ UCF_SAMEPROCESS
Definition: appinfo.h:77
@ 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,
bool  Silent 
)

Definition at line 681 of file geninst.cpp.

682{
683 InstallInfo Info(AppInfo.szDisplayName, *AppInfo.GetConfigParser(), Archive);
684 Info.Silent = Silent;
685 g_pInfo = &Info;
686 return CreateUI(Info.Silent, ExtractAndInstallThread) ? !Info.Error : FALSE;
687}
CStringW szDisplayName
Definition: appinfo.h:121
CConfigParser * GetConfigParser() const
Definition: appinfo.h:176
#define FALSE
Definition: types.h:117
static DWORD CALLBACK ExtractAndInstallThread(LPVOID Parameter)
Definition: geninst.cpp:454
static struct CommonInfo * g_pInfo
static BOOL CreateUI(BOOL Silent, LPTHREAD_START_ROUTINE ThreadProc)
Definition: geninst.cpp:650
_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 850 of file geninst.cpp.

851{
852 WCHAR TempDirBuf[MAX_PATH], UniqueDir[MAX_PATH];
854 db.UpdateAvailable();
855 CAvailableApplicationInfo *pAppInfo = db.FindAvailableByPackageName(PackageName);
856 if (!pAppInfo)
858 CConfigParser *pCfg = pAppInfo->GetConfigParser();
859
860 if (!GetTempPathW(_countof(TempDirBuf), TempDirBuf))
861 return E_FAIL;
862 wsprintfW(UniqueDir, L"~%s-%u", RAPPS_NAME, GetCurrentProcessId());
863 TempDir = BuildPath(TempDirBuf, UniqueDir);
865 if (FAILED(hr))
866 return hr;
867
868 hr = HResultFromWin32(ExtractArchive(pszArchive, TempDir, NULL, NULL));
869 if (SUCCEEDED(hr))
870 {
873 {
875 HANDLE hFind = FindFirstFileW(Exe = BuildPath(TempDir, L"*.exe"), &wfd);
876 if (hFind != INVALID_HANDLE_VALUE)
877 {
878 FindClose(hFind);
879 Exe = wfd.cFileName;
880 }
881 }
882 App = BuildPath(TempDir, Exe);
885 }
886
887 if (FAILED(hr) && !TempDir.IsEmpty())
889 return hr;
890}
#define DB_EXEINZIPSECTION
Definition: appinfo.h:105
#define DB_EXEINZIP_EXE
Definition: appinfo.h:106
#define RAPPS_NAME
Definition: defines.h:34
static CStringW BuildPath(const T &Base, LPCWSTR Append)
Definition: misc.h:107
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:158
#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:159
_Field_z_ WCHAR cFileName[MAX_PATH]
Definition: minwinbase.h:291
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
#define ERROR_NOT_FOUND
Definition: winerror.h:1014
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 55 of file appinfo.h.

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

◆ IsInstalledEnum()

◆ IsKnownLicenseType()

BOOL IsKnownLicenseType ( INT  x)
inline

Definition at line 18 of file appinfo.h.

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

Referenced by CAvailableApplicationInfo::LicenseString().

◆ UninstallGenerated()

BOOL UninstallGenerated ( CInstalledApplicationInfo AppInfo,
UninstallCommandFlags  Flags 
)

Definition at line 842 of file geninst.cpp.

843{
845 g_pInfo = &Info;
846 return CreateUI(Info.Silent, UninstallThread) ? !Info.Error : FALSE;
847}
static DWORD CALLBACK UninstallThread(LPVOID Parameter)
Definition: geninst.cpp:707
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by CInstalledApplicationInfo::UninstallApplication().