ReactOS 0.4.17-dev-243-g1369312
unattended.cpp File Reference
#include "gui.h"
#include "unattended.h"
#include "configparser.h"
#include <setupapi.h>
#include <conutils.h>
Include dependency graph for unattended.cpp:

Go to the source code of this file.

Functions

static BOOL MatchCmdOption (LPWSTR argvOption, LPCWSTR szOptToMacth)
 
static void InitRappsConsole ()
 
static CAppInfoSearchForAppWithDisplayName (CAppDB &db, AppsCategories Type, LPCWSTR Name)
 
static BOOL HandleInstallCommand (CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
 
static BOOL HandleSetupCommand (CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
 
static BOOL HandleUninstallCommand (CAppDB &db, UINT argcLeft, LPWSTR *argvLeft)
 
static BOOL HandleGenerateInstallerCommand (CAppDB &db, UINT argcLeft, LPWSTR *argvLeft)
 
static BOOL HandleFindCommand (CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
 
static BOOL HandleInfoCommand (CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
 
static VOID PrintHelpCommand ()
 
BOOL ParseCmdAndExecute (LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
 

Function Documentation

◆ HandleFindCommand()

static BOOL HandleFindCommand ( CAppDB db,
LPWSTR  szCommand,
int  argcLeft,
LPWSTR argvLeft 
)
static

Definition at line 232 of file unattended.cpp.

233{
234 if (argcLeft < 1)
235 {
237 return FALSE;
238 }
239
242
243 for (int i = 0; i < argcLeft; i++)
244 {
245 LPCWSTR lpszSearch = argvLeft[i];
247
248 POSITION CurrentListPosition = List.GetHeadPosition();
249 while (CurrentListPosition)
250 {
251 CAppInfo *Info = List.GetNext(CurrentListPosition);
252
253 if (SearchPatternMatch(Info->szDisplayName, lpszSearch) || SearchPatternMatch(Info->szComments, lpszSearch))
254 {
255 ConPrintf(StdOut, L"%s (%s)\n", Info->szDisplayName.GetString(), Info->szIdentifier.GetString());
256 }
257 }
258
259 ConPrintf(StdOut, L"\n");
260 }
261
262 return TRUE;
263}
@ ENUM_ALL_AVAILABLE
Definition: appinfo.h:25
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:544
#define IDS_CMD_FIND_RESULT_FOR
Definition: resource.h:237
#define IDS_CMD_NEED_PARAMS
Definition: resource.h:235
VOID GetApps(CAtlList< CAppInfo * > &List, AppsCategories Type) const
Definition: appdb.cpp:128
void ConPrintf(FILE *fp, LPCWSTR psz,...)
#define StdOut
Definition: conutils_noros.h:6
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define L(x)
Definition: resources.c:13
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
INT __cdecl ConResMsgPrintf(IN PCON_STREAM Stream, IN DWORD dwFlags, IN UINT uID,...)
Definition: outstream.c:1458
const uint16_t * LPCWSTR
Definition: typedefs.h:57
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by ParseCmdAndExecute().

◆ HandleGenerateInstallerCommand()

static BOOL HandleGenerateInstallerCommand ( CAppDB db,
UINT  argcLeft,
LPWSTR argvLeft 
)
static

Definition at line 211 of file unattended.cpp.

212{
213 bool bSilent = false;
214 if (argcLeft && !StrCmpIW(argvLeft[0], L"/S"))
215 {
216 bSilent = true;
217 --argcLeft;
218 ++argvLeft;
219 }
220
221 if (argcLeft != 2)
222 return FALSE;
223
225 if (!pAI)
226 return FALSE;
227
228 return ExtractAndRunGeneratedInstaller(*pAI, argvLeft[1], bSilent);
229}
CAvailableApplicationInfo * FindAvailableByPackageName(const CStringW &name)
Definition: appdb.cpp:95
int WINAPI StrCmpIW(const WCHAR *str, const WCHAR *comp)
Definition: string.c:456
BOOL ExtractAndRunGeneratedInstaller(const CAvailableApplicationInfo &AppInfo, LPCWSTR Archive, bool Silent)
Definition: geninst.cpp:681

Referenced by ParseCmdAndExecute().

◆ HandleInfoCommand()

static BOOL HandleInfoCommand ( CAppDB db,
LPWSTR  szCommand,
int  argcLeft,
LPWSTR argvLeft 
)
static

Definition at line 266 of file unattended.cpp.

267{
268 if (argcLeft < 1)
269 {
271 return FALSE;
272 }
273
274 for (int i = 0; i < argcLeft; i++)
275 {
276 LPCWSTR PackageName = argvLeft[i];
277 CAppInfo *AppInfo = db->FindByPackageName(PackageName);
278 if (!AppInfo)
279 {
281 }
282 else
283 {
285
286 ConPuts(StdOut, AppInfo->szDisplayName);
287
288 if (!AppInfo->szDisplayVersion.IsEmpty())
289 {
292 }
293
294 CStringW License, Size, UrlSite, UrlDownload;
295 AppInfo->GetDisplayInfo(License, Size, UrlSite, UrlDownload);
296
297 if (!License.IsEmpty())
298 {
300 ConPuts(StdOut, License);
301 }
302
303 if (!Size.IsEmpty())
304 {
307 }
308
309 if (!UrlSite.IsEmpty())
310 {
312 ConPuts(StdOut, UrlSite);
313 }
314
315 if (AppInfo->szComments)
316 {
318 ConPuts(StdOut, AppInfo->szComments);
319 }
320
321 if (!UrlDownload.IsEmpty())
322 {
324 ConPuts(StdOut, UrlDownload);
325 }
326 ConPuts(StdOut, L"\n");
327 }
328 ConPuts(StdOut, L"\n");
329 }
330 return TRUE;
331}
#define IDS_AINFO_SIZE
Definition: resource.h:173
#define IDS_AINFO_VERSION
Definition: resource.h:171
#define IDS_CMD_PACKAGE_INFO
Definition: resource.h:239
#define IDS_AINFO_LICENSE
Definition: resource.h:175
#define IDS_AINFO_DESCRIPTION
Definition: resource.h:172
#define IDS_AINFO_URLSITE
Definition: resource.h:174
#define IDS_AINFO_URLDOWNLOAD
Definition: resource.h:176
#define IDS_CMD_PACKAGE_NOT_FOUND
Definition: resource.h:238
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
CAppInfo * FindByPackageName(const CStringW &name)
Definition: appdb.h:34
CStringW szComments
Definition: appinfo.h:125
CStringW szDisplayName
Definition: appinfo.h:123
virtual VOID GetDisplayInfo(CStringW &License, CStringW &Size, CStringW &UrlSite, CStringW &UrlDownload)=0
CStringW szDisplayVersion
Definition: appinfo.h:124
void ConPuts(FILE *fp, LPCWSTR psz)
Definition: conutils_noros.h:8
void ConResPrintf(FILE *fp, UINT nID,...)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539

Referenced by ParseCmdAndExecute().

◆ HandleInstallCommand()

static BOOL HandleInstallCommand ( CAppDB db,
LPWSTR  szCommand,
int  argcLeft,
LPWSTR argvLeft 
)
static

Definition at line 63 of file unattended.cpp.

64{
66 if (argcLeft >= 1 && !StrCmpIW(L"/S", argvLeft[0]))
67 {
69 argvLeft = &argvLeft[1], --argcLeft;
70 }
71
72 if (argcLeft < 1)
73 {
76 return FALSE;
77 }
78
79 CAtlList<CAppInfo *> Applications;
80 for (int i = 0; i < argcLeft; i++)
81 {
82 LPCWSTR PackageName = argvLeft[i];
83 CAppInfo *AppInfo = db->FindByPackageName(PackageName);
84 if (AppInfo)
85 {
86 Applications.AddTail(AppInfo);
87 }
88 }
89
90 return DownloadListOfApplications(Applications, flags);
91}
#define IDS_CMD_NEED_PACKAGE_NAME
Definition: resource.h:233
POSITION AddTail(INARGTYPE element)
Definition: atlcoll.h:629
GLbitfield flags
Definition: glext.h:7161
unsigned int UINT
Definition: ndis.h:50
@ DAF_MODAL
Definition: dialogs.h:14
@ DAF_SILENT
Definition: dialogs.h:13
BOOL DownloadListOfApplications(const CAtlList< CAppInfo * > &AppsList, UINT Flags=0)
Definition: loaddlg.cpp:1220
static void InitRappsConsole()
Definition: unattended.cpp:31

Referenced by ParseCmdAndExecute().

◆ HandleSetupCommand()

static BOOL HandleSetupCommand ( CAppDB db,
LPWSTR  szCommand,
int  argcLeft,
LPWSTR argvLeft 
)
static

Definition at line 94 of file unattended.cpp.

95{
97 if (argcLeft >= 1 && !StrCmpIW(L"/S", argvLeft[0]))
98 {
100 argvLeft = &argvLeft[1], --argcLeft;
101 }
102
103 if (argcLeft != 1)
104 {
107 return FALSE;
108 }
109
110 CAtlList<CAppInfo *> Applications;
111 HINF InfHandle = SetupOpenInfFileW(argvLeft[0], NULL, INF_STYLE_WIN4, NULL);
112 if (InfHandle == INVALID_HANDLE_VALUE)
113 {
114 return FALSE;
115 }
116
118 if (SetupFindFirstLineW(InfHandle, L"RAPPS", L"Install", &Context))
119 {
120 WCHAR szPkgName[MAX_PATH];
121 do
122 {
123 if (SetupGetStringFieldW(&Context, 1, szPkgName, _countof(szPkgName), NULL))
124 {
125 CAppInfo *AppInfo = db->FindByPackageName(szPkgName);
126 if (AppInfo)
127 {
128 Applications.AddTail(AppInfo);
129 }
130 }
131 } while (SetupFindNextLine(&Context, &Context));
132 }
133 SetupCloseInfFile(InfHandle);
134
135 return DownloadListOfApplications(Applications, flags);
136}
#define IDS_CMD_NEED_FILE_NAME
Definition: resource.h:234
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
#define INF_STYLE_WIN4
Definition: infsupp.h:43
short WCHAR
Definition: pedump.c:58
#define _countof(array)
Definition: sndvol32.h:70
_In_ PVOID Context
Definition: storport.h:2269
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:56
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:82
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45

Referenced by ParseCmdAndExecute().

◆ HandleUninstallCommand()

static BOOL HandleUninstallCommand ( CAppDB db,
UINT  argcLeft,
LPWSTR argvLeft 
)
static

Definition at line 139 of file unattended.cpp.

140{
141 UINT argi = 0, silent = FALSE, byregkeyname = FALSE;
142 for (; argcLeft; ++argi, --argcLeft)
143 {
144 if (!StrCmpIW(argvLeft[argi], L"/S"))
145 ++silent;
146 else if (!StrCmpIW(argvLeft[argi], L"/K"))
147 ++byregkeyname;
148 else
149 break;
150 }
151 if (argcLeft != 1)
152 return FALSE;
153
155 LPCWSTR name = argvLeft[argi];
156 BOOL retval = FALSE;
157 CAppInfo *pInfo = NULL, *pDelete = NULL;
158
159 if (!byregkeyname)
160 {
161 for (UINT i = ENUM_INSTALLED_MIN; !pInfo && i <= ENUM_INSTALLED_MAX; ++i)
162 {
164 }
165
166 if (!pInfo)
167 {
169 if (p && p->IsInstalled(&buf))
170 {
171 name = buf.GetString();
172 byregkeyname = TRUE;
173 }
174 }
175 }
176
177 if (byregkeyname)
178 {
179 // Force a specific key type if requested (<M|U>[32|64]<\\KeyName>)
180 if (name[0])
181 {
182 REGSAM wow = 0;
183 UINT i = 1;
184 if (name[i] == '3' && name[i + 1])
185 wow = KEY_WOW64_32KEY, i += 2;
186 else if (name[i] == '6' && name[i + 1])
187 wow = KEY_WOW64_64KEY, i += 2;
188
189 if (name[i++] == '\\')
190 {
191 pInfo = CAppDB::CreateInstalledAppInstance(name + i, name[0] == 'U', wow);
192 }
193 }
194
195 if (!pInfo)
196 {
198 }
199 pDelete = pInfo;
200 }
201
202 if (pInfo)
203 {
205 }
206 delete pDelete;
207 return retval;
208}
@ UCF_NONE
Definition: appinfo.h:74
@ UCF_SILENT
Definition: appinfo.h:75
@ UCF_SAMEPROCESS
Definition: appinfo.h:77
AppsCategories
Definition: appinfo.h:24
@ ENUM_INSTALLED_MAX
Definition: appinfo.h:49
@ ENUM_INSTALLED_MIN
Definition: appinfo.h:48
static CInstalledApplicationInfo * CreateInstalledAppByRegistryKey(LPCWSTR KeyName, HKEY hKeyParent, UINT KeyIndex)
Definition: appdb.cpp:209
static CInstalledApplicationInfo * CreateInstalledAppInstance(LPCWSTR KeyName, BOOL User, REGSAM WowSam)
Definition: appdb.cpp:291
virtual BOOL UninstallApplication(UninstallCommandFlags Flags)=0
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
static BOOL silent
Definition: msiexec.c:42
Definition: name.c:39
static CAppInfo * SearchForAppWithDisplayName(CAppDB &db, AppsCategories Type, LPCWSTR Name)
Definition: unattended.cpp:47
int retval
Definition: wcstombs.cpp:91
ACCESS_MASK REGSAM
Definition: winreg.h:76
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46

Referenced by ParseCmdAndExecute().

◆ InitRappsConsole()

static void InitRappsConsole ( )
static

Definition at line 31 of file unattended.cpp.

32{
33 // First, try to attach to our parent's console
35 {
36 // Did we already have a console?
38 {
39 // No, try to open a new one
41 }
42 }
43 ConInitStdStreams(); // Initialize the Console Standard Streams
44}
BOOL WINAPI AttachConsole(IN DWORD dwProcessId)
Definition: console.c:147
#define ConInitStdStreams()
Definition: conutils_noros.h:5
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
BOOL WINAPI AllocConsole(void)
Definition: console.c:492
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define ATTACH_PARENT_PROCESS
Definition: wincon.h:43

Referenced by HandleInstallCommand(), HandleSetupCommand(), and ParseCmdAndExecute().

◆ MatchCmdOption()

static BOOL MatchCmdOption ( LPWSTR  argvOption,
LPCWSTR  szOptToMacth 
)
static

Definition at line 16 of file unattended.cpp.

17{
18 WCHAR FirstCharList[] = {L'-', L'/'};
19
20 for (UINT i = 0; i < _countof(FirstCharList); i++)
21 {
22 if (argvOption[0] == FirstCharList[i])
23 {
24 return StrCmpIW(argvOption + 1, szOptToMacth) == 0;
25 }
26 }
27 return FALSE;
28}

Referenced by ParseCmdAndExecute().

◆ ParseCmdAndExecute()

BOOL ParseCmdAndExecute ( LPWSTR  lpCmdLine,
BOOL  bIsFirstLaunch,
int  nCmdShow 
)

Definition at line 345 of file unattended.cpp.

346{
347 INT argc;
348 LPWSTR *argv = CommandLineToArgvW(lpCmdLine, &argc);
349 if (!argv)
350 return FALSE;
351
353
354 BOOL bAppwizMode = (argc > 1 && MatchCmdOption(argv[1], CMD_KEY_APPWIZ));
355 if (!bAppwizMode)
356 {
358 if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
359 db.RemoveCached();
360
361 db.UpdateAvailable();
362 }
363
364 db.UpdateInstalled();
365
366 if (argc == 1 || bAppwizMode) // RAPPS is launched without options or APPWIZ mode is requested
367 {
368 // Check whether the RAPPS MainWindow is already launched in another process
369 CStringW szWindowText(MAKEINTRESOURCEW(bAppwizMode ? IDS_APPWIZ_TITLE : IDS_APPTITLE));
370 LPCWSTR pszMutex = bAppwizMode ? L"RAPPWIZ" : MAINWINDOWMUTEX;
371
372 HANDLE hMutex = CreateMutexW(NULL, FALSE, pszMutex);
374 {
375 /* If already started, find its window */
376 HWND hWindow;
377 for (int wait = 2500, inter = 250; wait > 0; wait -= inter)
378 {
379 if ((hWindow = FindWindowW(szWindowClass, szWindowText)) != NULL)
380 break;
381 Sleep(inter);
382 }
383
384 if (hWindow)
385 {
386 /* Activate the window in the other instance */
387 ShowWindow(hWindow, SW_SHOWNA);
388 SwitchToThisWindow(hWindow, TRUE);
389 if (bAppwizMode)
391
392 if (hMutex)
394
395 return FALSE;
396 }
397 }
398 szWindowText.Empty();
399
400 CMainWindow wnd(&db, bAppwizMode);
401 MainWindowLoop(&wnd, nCmdShow);
402
403 if (hMutex)
405
406 return TRUE;
407 }
408
410 {
411 return HandleInstallCommand(&db, argv[1], argc - 2, argv + 2);
412 }
413 else if (MatchCmdOption(argv[1], CMD_KEY_SETUP))
414 {
415 return HandleSetupCommand(&db, argv[1], argc - 2, argv + 2);
416 }
418 {
419 return HandleUninstallCommand(db, argc - 2, argv + 2);
420 }
421 else if (MatchCmdOption(argv[1], CMD_KEY_GENINST))
422 {
423 return HandleGenerateInstallerCommand(db, argc - 2, argv + 2);
424 }
425
427
429 {
430 return HandleFindCommand(&db, argv[1], argc - 2, argv + 2);
431 }
432 else if (MatchCmdOption(argv[1], CMD_KEY_INFO))
433 {
434 return HandleInfoCommand(&db, argv[1], argc - 2, argv + 2);
435 }
437 {
439 return TRUE;
440 }
441 else
442 {
443 // unrecognized/invalid options
446 return FALSE;
447 }
448}
#define IDS_APPTITLE
Definition: resource.h:3
#define ID_ACTIVATE_APPWIZ
Definition: resource.h:89
#define IDS_CMD_INVALID_OPTION
Definition: resource.h:236
#define IDS_APPWIZ_TITLE
Definition: resource.h:97
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:21
Definition: appdb.h:9
static CStringW GetDefaultPath()
Definition: appdb.cpp:87
void ConResPuts(FILE *fp, UINT nID)
#define CloseHandle
Definition: compat.h:739
MonoAssembly int argc
Definition: metahost.c:107
VOID MainWindowLoop(CMainWindow *wnd, INT nShowCmd)
Definition: gui.cpp:899
const TCHAR szWindowClass[]
Definition: magnifier.c:28
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
HANDLE hMutex
Definition: mutex.c:11
#define argv
Definition: mplay32.c:18
#define MAINWINDOWMUTEX
Definition: rapps.h:23
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:79
BOOL bUpdateAtStart
Definition: settings.h:8
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:726
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:525
rwlock_t lock
Definition: tcpcore.h:0
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
static BOOL HandleInfoCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:266
static BOOL HandleUninstallCommand(CAppDB &db, UINT argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:139
static BOOL MatchCmdOption(LPWSTR argvOption, LPCWSTR szOptToMacth)
Definition: unattended.cpp:16
static BOOL HandleFindCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:232
static VOID PrintHelpCommand()
Definition: unattended.cpp:334
static BOOL HandleInstallCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:63
static BOOL HandleGenerateInstallerCommand(CAppDB &db, UINT argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:211
static BOOL HandleSetupCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:94
#define CMD_KEY_INFO
Definition: unattended.h:9
#define CMD_KEY_INSTALL
Definition: unattended.h:6
#define CMD_KEY_SETUP
Definition: unattended.h:7
#define CMD_KEY_HELP
Definition: unattended.h:10
#define CMD_KEY_UNINSTALL
Definition: unattended.h:5
#define CMD_KEY_HELP_ALT
Definition: unattended.h:11
#define CMD_KEY_GENINST
Definition: unattended.h:4
#define CMD_KEY_APPWIZ
Definition: unattended.h:3
#define CMD_KEY_FIND
Definition: unattended.h:8
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1768
#define SW_SHOWNA
Definition: winuser.h:789
#define PostMessage
Definition: winuser.h:5998
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by wWinMain().

◆ PrintHelpCommand()

static VOID PrintHelpCommand ( )
static

Definition at line 334 of file unattended.cpp.

335{
336 ConPrintf(StdOut, L"\n");
338 ConPrintf(StdOut, L"\n\n");
339
341 ConPrintf(StdOut, L"%ls\n", UsageString);
342}
#define IDS_CMD_USAGE
Definition: resource.h:232
const WCHAR UsageString[]
Definition: unattended.h:14

Referenced by ParseCmdAndExecute().

◆ SearchForAppWithDisplayName()

static CAppInfo * SearchForAppWithDisplayName ( CAppDB db,
AppsCategories  Type,
LPCWSTR  Name 
)
static

Definition at line 47 of file unattended.cpp.

48{
50 db.GetApps(List, Type);
51 for (POSITION it = List.GetHeadPosition(); it;)
52 {
53 CAppInfo *Info = List.GetNext(it);
54 if (SearchPatternMatch(Info->szDisplayName, Name))
55 {
56 return Info;
57 }
58 }
59 return NULL;
60}
Type
Definition: Type.h:7
LPWSTR Name
Definition: desk.c:124

Referenced by HandleUninstallCommand().