ReactOS  0.4.13-dev-259-g5ca9c9c
unattended.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CMD_KEY_INSTALL   L"/INSTALL"
 
#define CMD_KEY_SETUP   L"/SETUP"
 

Functions

BOOL UseCmdParameters (LPWSTR lpCmdLine)
 

Macro Definition Documentation

◆ CMD_KEY_INSTALL

#define CMD_KEY_INSTALL   L"/INSTALL"

Definition at line 3 of file unattended.h.

◆ CMD_KEY_SETUP

#define CMD_KEY_SETUP   L"/SETUP"

Definition at line 4 of file unattended.h.

Function Documentation

◆ UseCmdParameters()

BOOL UseCmdParameters ( LPWSTR  lpCmdLine)

Definition at line 16 of file unattended.cpp.

17 {
18  INT argc;
19  LPWSTR* argv = CommandLineToArgvW(lpCmdLine, &argc);
20 
21  if (!argv || argc < MIN_ARGS)
22  {
23  return FALSE;
24  }
25 
26  // TODO: use DB filenames as names because they're shorter
28  if (!StrCmpIW(argv[1], CMD_KEY_INSTALL))
29  {
30  for (INT i = 2; i < argc; ++i)
31  {
32  arrNames.Add(argv[i]);
33  }
34  }
35  else
36  if (!StrCmpIW(argv[1], CMD_KEY_SETUP))
37  {
39  if (InfHandle == INVALID_HANDLE_VALUE)
40  {
41  return FALSE;
42  }
43 
45  if (SetupFindFirstLineW(InfHandle, L"RAPPS", L"Install", &Context))
46  {
48  do
49  {
51  {
52  arrNames.Add(szName);
53  }
54  } while (SetupFindNextLine(&Context, &Context));
55  }
56  SetupCloseInfFile(InfHandle);
57  }
58  else
59  {
60  return FALSE;
61  }
62 
63  CAvailableApps apps;
64  apps.UpdateAppsDB();
66 
68  if (arrAppInfo.GetSize() > 0)
69  {
71  return TRUE;
72  }
73 
74  return FALSE;
75 }
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
#define INF_STYLE_WIN4
Definition: infsupp.h:41
#define CMD_KEY_SETUP
Definition: unattended.h:4
#define CMD_KEY_INSTALL
Definition: unattended.h:3
#define _countof(array)
Definition: fontsub.cpp:30
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
#define argv
Definition: mplay32.c:18
static BOOL UpdateAppsDB()
Definition: available.cpp:285
int GetSize() const
Definition: atlsimpcoll.h:104
int32_t INT
Definition: typedefs.h:56
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
#define MIN_ARGS
Definition: unattended.cpp:14
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ATL::CSimpleArray< CAvailableApplicationInfo > FindInfoList(const ATL::CSimpleArray< ATL::CStringW > &arrAppsNames) const
Definition: available.cpp:413
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:76
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
static const WCHAR L[]
Definition: oid.c:1250
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc)
Definition: available.cpp:323
static BOOL DownloadListOfApplications(const ATL::CSimpleArray< CAvailableApplicationInfo > &AppsList, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:930
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
static const WCHAR szName[]
Definition: msipriv.h:1194
struct tagContext Context
Definition: acpixf.h:1012
WCHAR * LPWSTR
Definition: xmlstorage.h:184
int WINAPI StrCmpIW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:353
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by wWinMain().