diff --git a/base/applications/rapps/gui.cpp b/base/applications/rapps/gui.cpp index 2d5eb7e098a..9073b7bf957 100644 --- a/base/applications/rapps/gui.cpp +++ b/base/applications/rapps/gui.cpp @@ -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 diff --git a/base/applications/rapps/include/gui.h b/base/applications/rapps/include/gui.h index ee136f48133..07a07356475 100644 --- a/base/applications/rapps/include/gui.h +++ b/base/applications/rapps/include/gui.h @@ -57,12 +57,13 @@ class CMainWindow : public CWindowImpl CAtlList m_Selected; BOOL bUpdating = FALSE; + BOOL bAppwizMode; CStringW szSearchPattern; AppsCategories SelectedEnumType; public: - CMainWindow(CAppDB *db); + explicit CMainWindow(CAppDB *db, BOOL bAppwiz = FALSE); ~CMainWindow(); diff --git a/base/applications/rapps/include/unattended.h b/base/applications/rapps/include/unattended.h index 83aa2e06b9f..8eaaf93c244 100644 --- a/base/applications/rapps/include/unattended.h +++ b/base/applications/rapps/include/unattended.h @@ -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" diff --git a/base/applications/rapps/unattended.cpp b/base/applications/rapps/unattended.cpp index 9a5fa2a3fa5..a8a21d698aa 100644 --- a/base/applications/rapps/unattended.cpp +++ b/base/applications/rapps/unattended.cpp @@ -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)