From 40c61442ef73e42a44624493f21bac8ab4066043 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Wed, 31 Jan 2024 18:34:56 +0000 Subject: [PATCH] Stop calling `EnsureIMEIsDisabledForServiceAccount` As a preparation to simplify mozc::win32::UninstallHelper (#866), we stop calling EnsureIMEIsDisabledForServiceAccount with this commit. Unlike IMM32 installation, we never enable Mozc TIP if the target user is a service. Thus there should be no need to make sure to disable Mozc TIP for service accounts while uninstalling Mozc. #codehealth PiperOrigin-RevId: 603093188 --- src/win32/custom_action/custom_action.cc | 17 --------------- src/win32/custom_action/custom_action.def | 1 - src/win32/custom_action/custom_action.h | 4 ---- src/win32/installer/installer_64bit.wxs | 23 +-------------------- src/win32/installer/installer_oss_64bit.wxs | 23 +-------------------- 5 files changed, 2 insertions(+), 66 deletions(-) diff --git a/src/win32/custom_action/custom_action.cc b/src/win32/custom_action/custom_action.cc index 2b654b0ee..bd9b9bd32 100644 --- a/src/win32/custom_action/custom_action.cc +++ b/src/win32/custom_action/custom_action.cc @@ -265,23 +265,6 @@ UINT __stdcall RestoreUserIMEEnvironment(MSIHANDLE msi_handle) { return result ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; } -// [Return='ignore'] -UINT __stdcall EnsureIMEIsDisabledForServiceAccount(MSIHANDLE msi_handle) { - DEBUG_BREAK_FOR_DEBUGGER(); - bool is_service = false; - if (!mozc::WinUtil::IsServiceAccount(&is_service)) { - return ERROR_INSTALL_FAILURE; - } - if (!is_service) { - // Do nothing if this is not a service account. - return ERROR_SUCCESS; - } - - const bool result = - mozc::win32::UninstallHelper::EnsureIMEIsRemovedForCurrentUser(true); - return result ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; -} - // [Return='ignore'] // Hides the cancel button on a progress dialog shown by the installer shows. // Please see the following page for details. diff --git a/src/win32/custom_action/custom_action.def b/src/win32/custom_action/custom_action.def index f9ea1cde6..fc094a7a0 100644 --- a/src/win32/custom_action/custom_action.def +++ b/src/win32/custom_action/custom_action.def @@ -7,7 +7,6 @@ EXPORTS OpenUninstallSurveyPage ShutdownServer RestoreUserIMEEnvironment - EnsureIMEIsDisabledForServiceAccount HideCancelButton SaveCustomActionData RestoreServiceState diff --git a/src/win32/custom_action/custom_action.h b/src/win32/custom_action/custom_action.h index b2aa45486..8265dce32 100644 --- a/src/win32/custom_action/custom_action.h +++ b/src/win32/custom_action/custom_action.h @@ -63,10 +63,6 @@ UINT __stdcall ShutdownServer(MSIHANDLE msi_handle); // uninstall_helper.h for details. UINT __stdcall RestoreUserIMEEnvironment(MSIHANDLE msi_handle); -// Ensures that Mozc is disabled for the service account. See the comment in -// uninstall_helper.h for details. -UINT __stdcall EnsureIMEIsDisabledForServiceAccount(MSIHANDLE msi_handle); - // Hides the cancel button on a progress dialog shown by the installer. UINT __stdcall HideCancelButton(MSIHANDLE msi_handle); diff --git a/src/win32/installer/installer_64bit.wxs b/src/win32/installer/installer_64bit.wxs index 09cf058e5..0cbd42a57 100644 --- a/src/win32/installer/installer_64bit.wxs +++ b/src/win32/installer/installer_64bit.wxs @@ -423,14 +423,6 @@ DllEntry='ShutdownServer' Impersonate='yes' Return='ignore' /> - - @@ -474,18 +466,9 @@ (REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE) - - - (REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE) - + After='RestoreUserIMEEnvironment' > (REMOVE="ALL") AND UPGRADINGPRODUCTCODE AND (VersionNT64) @@ -538,10 +521,6 @@ (NOT (REMOVE="ALL")) AND (VersionNT64) - (NOT (REMOVE="ALL")) - - (NOT (REMOVE="ALL")) diff --git a/src/win32/installer/installer_oss_64bit.wxs b/src/win32/installer/installer_oss_64bit.wxs index 22de594fb..92e77f07e 100644 --- a/src/win32/installer/installer_oss_64bit.wxs +++ b/src/win32/installer/installer_oss_64bit.wxs @@ -356,14 +356,6 @@ DllEntry='ShutdownServer' Impersonate='yes' Return='ignore' /> - - @@ -397,18 +389,9 @@ (REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE) - - - (REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE) - + After='RestoreUserIMEEnvironment' > (REMOVE="ALL") AND UPGRADINGPRODUCTCODE AND (VersionNT64) @@ -458,10 +441,6 @@ (NOT (REMOVE="ALL")) AND (VersionNT64) - (NOT (REMOVE="ALL")) - - (NOT (REMOVE="ALL"))