ReactOS 0.4.15-dev-6712-g46b4b55
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_APPWIZ   L"APPWIZ"
 
#define CMD_KEY_INSTALL   L"INSTALL"
 
#define CMD_KEY_SETUP   L"SETUP"
 
#define CMD_KEY_FIND   L"FIND"
 
#define CMD_KEY_INFO   L"INFO"
 
#define CMD_KEY_HELP   L"?"
 
#define CMD_KEY_HELP_ALT   L"HELP"
 

Functions

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

Variables

const WCHAR UsageString []
 

Macro Definition Documentation

◆ CMD_KEY_APPWIZ

#define CMD_KEY_APPWIZ   L"APPWIZ"

Definition at line 3 of file unattended.h.

◆ CMD_KEY_FIND

#define CMD_KEY_FIND   L"FIND"

Definition at line 6 of file unattended.h.

◆ CMD_KEY_HELP

#define CMD_KEY_HELP   L"?"

Definition at line 8 of file unattended.h.

◆ CMD_KEY_HELP_ALT

#define CMD_KEY_HELP_ALT   L"HELP"

Definition at line 9 of file unattended.h.

◆ CMD_KEY_INFO

#define CMD_KEY_INFO   L"INFO"

Definition at line 7 of file unattended.h.

◆ CMD_KEY_INSTALL

#define CMD_KEY_INSTALL   L"INSTALL"

Definition at line 4 of file unattended.h.

◆ CMD_KEY_SETUP

#define CMD_KEY_SETUP   L"SETUP"

Definition at line 5 of file unattended.h.

Function Documentation

◆ ParseCmdAndExecute()

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

Definition at line 221 of file unattended.cpp.

222{
223 INT argc;
224 LPWSTR *argv = CommandLineToArgvW(lpCmdLine, &argc);
225 BOOL bAppwizMode = FALSE;
226
227 if (!argv)
228 {
229 return FALSE;
230 }
231
234 CAppDB db(Directory);
235
236 if (argc > 1 && MatchCmdOption(argv[1], CMD_KEY_APPWIZ))
237 {
238 bAppwizMode = TRUE;
239 }
240
241 if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
242 {
243 db.RemoveCached();
244 }
245 db.UpdateAvailable();
246 db.UpdateInstalled();
247
248 if (argc == 1 || bAppwizMode) // RAPPS is launched without options or APPWIZ mode is requested
249 {
250 // Check whether the RAPPS MainWindow is already launched in another process
252
255 {
256 /* If already started, find its window */
258
259 /* Activate window */
260 ShowWindow(hWindow, SW_SHOWNORMAL);
261 SetForegroundWindow(hWindow);
262 if (bAppwizMode)
264 return FALSE;
265 }
266
267 CMainWindow wnd(&db, bAppwizMode);
268 MainWindowLoop(&wnd, nCmdShow);
269
270 if (hMutex)
272
273 return TRUE;
274 }
275
277 {
278 return HandleInstallCommand(&db, argv[1], argc - 2, argv + 2);
279 }
280 else if (MatchCmdOption(argv[1], CMD_KEY_SETUP))
281 {
282 return HandleSetupCommand(&db, argv[1], argc - 2, argv + 2);
283 }
284
286
288 {
289 return HandleFindCommand(&db, argv[1], argc - 2, argv + 2);
290 }
291 else if (MatchCmdOption(argv[1], CMD_KEY_INFO))
292 {
293 return HandleInfoCommand(&db, argv[1], argc - 2, argv + 2);
294 }
296 {
298 return TRUE;
299 }
300 else
301 {
302 // unrecognized/invalid options
305 return FALSE;
306 }
307}
static int argc
Definition: ServiceArgs.c:12
#define StdOut
Definition: fc.c:14
void ConResPuts(FILE *fp, UINT nID)
Definition: fc.c:27
BOOL GetStorageDirectory(CStringW &lpDirectory)
Definition: misc.cpp:145
#define ID_ACTIVATE_APPWIZ
Definition: resource.h:89
#define IDS_CMD_INVALID_OPTION
Definition: resource.h:226
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
Definition: appdb.h:9
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID MainWindowLoop(CMainWindow *wnd, INT nShowCmd)
Definition: gui.cpp:787
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
CAtlStringW CStringW
Definition: atlstr.h:130
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
Definition: shell32_main.c:80
base for all directory entries
Definition: entries.h:138
BOOL bUpdateAtStart
Definition: settings.h:8
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:576
int32_t INT
Definition: typedefs.h:58
static BOOL HandleInfoCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:142
static BOOL MatchCmdOption(LPWSTR argvOption, LPCWSTR szOptToMacth)
Definition: unattended.cpp:15
static void InitRappsConsole()
Definition: unattended.cpp:30
static BOOL HandleFindCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:108
static VOID PrintHelpCommand()
Definition: unattended.cpp:210
static BOOL HandleInstallCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:46
static BOOL HandleSetupCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
Definition: unattended.cpp:70
#define CMD_KEY_INFO
Definition: unattended.h:7
#define CMD_KEY_INSTALL
Definition: unattended.h:4
#define CMD_KEY_SETUP
Definition: unattended.h:5
#define CMD_KEY_HELP
Definition: unattended.h:8
#define CMD_KEY_HELP_ALT
Definition: unattended.h:9
#define CMD_KEY_APPWIZ
Definition: unattended.h:3
#define CMD_KEY_FIND
Definition: unattended.h:6
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SW_SHOWNORMAL
Definition: winuser.h:764
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1730
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define PostMessage
Definition: winuser.h:5822
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by wWinMain().

Variable Documentation

◆ UsageString

const WCHAR UsageString[]
Initial value:
= L"RAPPS \
[/" CMD_KEY_HELP L"] \
[/" CMD_KEY_INSTALL L" packagename] \
[/" CMD_KEY_SETUP L" filename] \
[/" CMD_KEY_FIND L" string] \
[/" CMD_KEY_INFO L" packagename]"
#define L(x)
Definition: ntvdm.h:50

Definition at line 12 of file unattended.h.

Referenced by PrintHelpCommand().