[RAPPS] Fix command line handling 601/head
authorMark Jansen <mark.jansen@reactos.org>
Tue, 5 Jun 2018 20:08:18 +0000 (22:08 +0200)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 9 Jun 2018 15:14:06 +0000 (17:14 +0200)
base/applications/rapps/available.cpp
base/applications/rapps/unattended.cpp
base/applications/rapps/winmain.cpp

index 61c5a16..c6ee68f 100644 (file)
@@ -402,7 +402,7 @@ CAvailableApplicationInfo* CAvailableApps::FindInfo(const ATL::CStringW& szAppNa
     while (CurrentListPosition != NULL)
     {
         info = m_InfoList.GetNext(CurrentListPosition);
-        if (info->m_szName == szAppName)
+        if (info->m_szName.CompareNoCase(szAppName) == 0)
         {
             return info;
         }
index 06f8537..7f7f351 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <setupapi.h>
 
-#define MIN_ARGS 2
+#define MIN_ARGS 3
 
 BOOL UseCmdParameters(LPWSTR lpCmdLine)
 {
@@ -25,17 +25,17 @@ BOOL UseCmdParameters(LPWSTR lpCmdLine)
 
     // TODO: use DB filenames as names because they're shorter
     ATL::CSimpleArray<ATL::CStringW> arrNames;
-    if (!StrCmpW(argv[0], CMD_KEY_INSTALL))
+    if (!StrCmpIW(argv[1], CMD_KEY_INSTALL))
     {
-        for (INT i = 1; i < argc; ++i)
+        for (INT i = 2; i < argc; ++i)
         {
             arrNames.Add(argv[i]);
         }
     }
     else
-    if (!StrCmpW(argv[0], CMD_KEY_SETUP))
+    if (!StrCmpIW(argv[1], CMD_KEY_SETUP))
     {
-        HINF InfHandle = SetupOpenInfFileW(argv[1], NULL, INF_STYLE_WIN4, NULL);
+        HINF InfHandle = SetupOpenInfFileW(argv[2], NULL, INF_STYLE_WIN4, NULL);
         if (InfHandle == INVALID_HANDLE_VALUE)
         {
             return FALSE;
index 3860237..98f44a1 100644 (file)
@@ -160,7 +160,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
     InitCommonControls();
 
     // skip window creation if there were some keys
-    if (!UseCmdParameters(lpCmdLine))
+    if (!UseCmdParameters(GetCommandLineW()))
     {
         if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
             CAvailableApps::ForceUpdateAppsDB();