Skip to content

Commit

Permalink
Prelaunch processes from post install dialog in Windows
Browse files Browse the repository at this point in the history
This is a follow up to my previous commit [1], which started executing
the following command

 mozc_broker --mode=prelaunch_processes

to pre-launch 'mozc_server' and 'mozc_renderer' whenever the user logs
in on Windows because these processes cannot be launched from sandboxed
processes such as 'SearchHost.exe'.

With this commit, effectively the same workaround will be performed
after installing Mozc and while executing post install dialog.

Closes #845.

 [1]: 0488082

PiperOrigin-RevId: 582383447
  • Loading branch information
yukawa authored and hiroyuki-komatsu committed Nov 14, 2023
1 parent f2ff1fd commit a8a1b70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/post_install_dialog/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ mozc_cc_qt_library(
"//gui/base:singleton_window_helper",
"//usage_stats",
] + mozc_select(
windows = ["//base/win32:scoped_com"],
windows = [
"//base:const",
"//base:process",
"//base/win32:scoped_com",
],
),
)

Expand Down
7 changes: 7 additions & 0 deletions src/gui/post_install_dialog/post_install_dialog_libmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include "gui/post_install_dialog/post_install_dialog.h"

#ifdef _WIN32
#include "base/const.h"
#include "base/process.h"
#include "base/win32/scoped_com.h"
#endif // _WIN32

Expand All @@ -50,6 +52,11 @@ int RunPostInstallDialog(int argc, char *argv[]) {

mozc::SystemUtil::DisableIME();

#ifdef _WIN32
mozc::Process::SpawnMozcProcess(mozc::kMozcBroker,
"--mode=prelaunch_processes");
#endif // _WIN32

std::string name = "post_install_dialog.";
name += mozc::SystemUtil::GetDesktopNameAsString();

Expand Down

0 comments on commit a8a1b70

Please sign in to comment.