https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a4ac3c84b2141802d0428…
commit a4ac3c84b2141802d0428daa7c90bb12ef3d90de
Author: 赫杨 <1160386205(a)qq.com>
AuthorDate: Mon Aug 17 03:04:45 2020 +0800
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Sep 6 17:10:17 2020 +0200
[RAPPS] now /INSTALL option use PkgName instead of software name
currently, PkgName is the name of ini file in DB (without suffix)
---
base/applications/rapps/available.cpp | 10 +++++-----
base/applications/rapps/include/available.h | 4 ++--
base/applications/rapps/unattended.cpp | 13 ++++++-------
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/base/applications/rapps/available.cpp
b/base/applications/rapps/available.cpp
index 88a1bf9a8b9..897251321f6 100644
--- a/base/applications/rapps/available.cpp
+++ b/base/applications/rapps/available.cpp
@@ -530,7 +530,7 @@ int CAvailableApps::GetSelectedCount()
return m_SelectedList.GetCount();
}
-CAvailableApplicationInfo* CAvailableApps::FindInfo(const ATL::CStringW& szAppName)
const
+CAvailableApplicationInfo* CAvailableApps::FindAppByPkgName(const ATL::CStringW&
szPkgName) const
{
if (m_InfoList.IsEmpty())
{
@@ -543,7 +543,7 @@ CAvailableApplicationInfo* CAvailableApps::FindInfo(const
ATL::CStringW& szAppNa
while (CurrentListPosition != NULL)
{
info = m_InfoList.GetNext(CurrentListPosition);
- if (info->m_szName.CompareNoCase(szAppName) == 0)
+ if (info->m_szPkgName.CompareNoCase(szPkgName) == 0)
{
return info;
}
@@ -551,12 +551,12 @@ CAvailableApplicationInfo* CAvailableApps::FindInfo(const
ATL::CStringW& szAppNa
return NULL;
}
-ATL::CSimpleArray<CAvailableApplicationInfo> CAvailableApps::FindInfoList(const
ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const
+ATL::CSimpleArray<CAvailableApplicationInfo>
CAvailableApps::FindAppsByPkgNameList(const ATL::CSimpleArray<ATL::CStringW>
&PkgNameList) const
{
ATL::CSimpleArray<CAvailableApplicationInfo> result;
- for (INT i = 0; i < arrAppsNames.GetSize(); ++i)
+ for (INT i = 0; i < PkgNameList.GetSize(); ++i)
{
- CAvailableApplicationInfo* Info = FindInfo(arrAppsNames[i]);
+ CAvailableApplicationInfo* Info = FindAppByPkgName(PkgNameList[i]);
if (Info)
{
result.Add(*Info);
diff --git a/base/applications/rapps/include/available.h
b/base/applications/rapps/include/available.h
index 8000c3b11fc..51e32c05230 100644
--- a/base/applications/rapps/include/available.h
+++ b/base/applications/rapps/include/available.h
@@ -125,8 +125,8 @@ public:
VOID RemoveAllSelected();
int GetSelectedCount();
- CAvailableApplicationInfo* FindInfo(const ATL::CStringW& szAppName) const;
- ATL::CSimpleArray<CAvailableApplicationInfo> FindInfoList(const
ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const;
+ CAvailableApplicationInfo* FindAppByPkgName(const ATL::CStringW& szPkgName)
const;
+ ATL::CSimpleArray<CAvailableApplicationInfo> FindAppsByPkgNameList(const
ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const;
//ATL::CSimpleArray<CAvailableApplicationInfo> GetSelected() const;
const ATL::CStringW& GetFolderPath() const;
diff --git a/base/applications/rapps/unattended.cpp
b/base/applications/rapps/unattended.cpp
index 540795be8d4..b37610c4149 100644
--- a/base/applications/rapps/unattended.cpp
+++ b/base/applications/rapps/unattended.cpp
@@ -22,13 +22,12 @@ BOOL UseCmdParameters(LPWSTR lpCmdLine)
return FALSE;
}
- // TODO: use DB filenames as names because they're shorter
- ATL::CSimpleArray<ATL::CStringW> arrNames;
+ ATL::CSimpleArray<ATL::CStringW> PkgNameList;
if (!StrCmpIW(argv[1], CMD_KEY_INSTALL))
{
for (INT i = 2; i < argc; ++i)
{
- arrNames.Add(argv[i]);
+ PkgNameList.Add(argv[i]);
}
}
else
@@ -43,12 +42,12 @@ BOOL UseCmdParameters(LPWSTR lpCmdLine)
INFCONTEXT Context;
if (SetupFindFirstLineW(InfHandle, L"RAPPS", L"Install",
&Context))
{
- WCHAR szName[MAX_PATH];
+ WCHAR szPkgName[MAX_PATH];
do
{
- if (SetupGetStringFieldW(&Context, 1, szName, _countof(szName),
NULL))
+ if (SetupGetStringFieldW(&Context, 1, szPkgName, _countof(szPkgName),
NULL))
{
- arrNames.Add(szName);
+ PkgNameList.Add(szPkgName);
}
} while (SetupFindNextLine(&Context, &Context));
}
@@ -63,7 +62,7 @@ BOOL UseCmdParameters(LPWSTR lpCmdLine)
apps.UpdateAppsDB();
apps.Enum(ENUM_ALL_AVAILABLE, NULL, NULL);
- ATL::CSimpleArray<CAvailableApplicationInfo> arrAppInfo =
apps.FindInfoList(arrNames);
+ ATL::CSimpleArray<CAvailableApplicationInfo> arrAppInfo =
apps.FindAppsByPkgNameList(PkgNameList);
if (arrAppInfo.GetSize() > 0)
{
DownloadListOfApplications(arrAppInfo, TRUE);