[RAPPS] Add /APPWIZ command-line key to open "Installed" section

Addendum to ab7ddc44. CORE-18981
This commit is contained in:
Stanislav Motylkov 2023-05-22 01:34:02 +03:00
parent d6fecc52d1
commit ff1fa4f38a
4 changed files with 13 additions and 5 deletions

View file

@ -82,7 +82,7 @@ CSideTreeView::~CSideTreeView()
// **** CMainWindow ****
CMainWindow::CMainWindow(CAppDB *db) : m_ClientPanel(NULL), m_Db(db), SelectedEnumType(ENUM_ALL_INSTALLED)
CMainWindow::CMainWindow(CAppDB *db, BOOL bAppwiz) : m_ClientPanel(NULL), m_Db(db), bAppwizMode(bAppwiz), SelectedEnumType(ENUM_ALL_INSTALLED)
{
}
@ -123,7 +123,7 @@ CMainWindow::InitCategoriesList()
m_TreeView->SetImageList();
m_TreeView->Expand(hRootItemInstalled, TVE_EXPAND);
m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
m_TreeView->SelectItem(hRootItemAvailable);
m_TreeView->SelectItem(bAppwizMode ? hRootItemInstalled : hRootItemAvailable);
}
BOOL

View file

@ -57,12 +57,13 @@ class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
CAtlList<CAppInfo *> m_Selected;
BOOL bUpdating = FALSE;
BOOL bAppwizMode;
CStringW szSearchPattern;
AppsCategories SelectedEnumType;
public:
CMainWindow(CAppDB *db);
explicit CMainWindow(CAppDB *db, BOOL bAppwiz = FALSE);
~CMainWindow();

View file

@ -1,5 +1,6 @@
#pragma once
#define CMD_KEY_APPWIZ L"APPWIZ"
#define CMD_KEY_INSTALL L"INSTALL"
#define CMD_KEY_SETUP L"SETUP"
#define CMD_KEY_FIND L"FIND"

View file

@ -222,6 +222,7 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
{
INT argc;
LPWSTR *argv = CommandLineToArgvW(lpCmdLine, &argc);
BOOL bAppwizMode = FALSE;
if (!argv)
{
@ -232,6 +233,11 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
GetStorageDirectory(Directory);
CAppDB db(Directory);
if (argc > 1 && MatchCmdOption(argv[1], CMD_KEY_APPWIZ))
{
bAppwizMode = TRUE;
}
if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
{
db.RemoveCached();
@ -239,7 +245,7 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
db.UpdateAvailable();
db.UpdateInstalled();
if (argc == 1) // RAPPS is launched without options
if (argc == 1 || bAppwizMode) // RAPPS is launched without options or APPWIZ mode is requested
{
// Check whether the RAPPS MainWindow is already launched in another process
HANDLE hMutex;
@ -256,7 +262,7 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
return FALSE;
}
CMainWindow wnd(&db);
CMainWindow wnd(&db, bAppwizMode);
MainWindowLoop(&wnd, nCmdShow);
if (hMutex)