[RAPPS] Fix command line handling

This commit is contained in:
Mark Jansen 2018-06-05 22:08:18 +02:00
parent 4f8dc9c266
commit f133d01f20
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
3 changed files with 7 additions and 7 deletions

View 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;
}

View 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;

View 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();