Skip to content

Commit

Permalink
Stop calling EnsureIMEIsDisabledForServiceAccount
Browse files Browse the repository at this point in the history
As a preparation to simplify mozc::win32::UninstallHelper (google#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
  • Loading branch information
yukawa authored and hiroyuki-komatsu committed Jan 31, 2024
1 parent bfde768 commit 40c6144
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 66 deletions.
17 changes: 0 additions & 17 deletions src/win32/custom_action/custom_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/win32/custom_action/custom_action.def
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ EXPORTS
OpenUninstallSurveyPage
ShutdownServer
RestoreUserIMEEnvironment
EnsureIMEIsDisabledForServiceAccount
HideCancelButton
SaveCustomActionData
RestoreServiceState
Expand Down
4 changes: 0 additions & 4 deletions src/win32/custom_action/custom_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
23 changes: 1 addition & 22 deletions src/win32/installer/installer_64bit.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,6 @@
DllEntry='ShutdownServer' Impersonate='yes' Return='ignore' />
<CustomAction Id='RestoreUserIMEEnvironment' BinaryKey='GoogleIMEJaInstallerHelper.dll'
DllEntry='RestoreUserIMEEnvironment' Impersonate='yes' Return='ignore'/>
<CustomAction Id='EnsureIMEIsDisabledForServiceAccountBeforeUninstall'
BinaryKey='GoogleIMEJaInstallerHelper.dll' Execute='deferred'
DllEntry='EnsureIMEIsDisabledForServiceAccount' Impersonate='no'
Return='ignore'/>
<CustomAction Id='EnsureIMEIsDisabledForServiceAccountAfterInstall'
BinaryKey='GoogleIMEJaInstallerHelper.dll' Execute='deferred'
DllEntry='EnsureIMEIsDisabledForServiceAccount' Impersonate='no'
Return='ignore'/>
<CustomAction Id='InitialInstallation' BinaryKey='GoogleIMEJaInstallerHelper.dll'
DllEntry='InitialInstallation' Execute='deferred'
Impersonate='no' />
Expand Down Expand Up @@ -474,18 +466,9 @@
<Custom Action='RestoreUserIMEEnvironment' After='SelfUnregModules'>
(REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE)
</Custom>
<!--
EnsureIMEIsDisabledForServiceAccountBeforeUninstall should be invoked
before Mozc's KLID is removed, which means you should call this action
before UnregisterTIPRollback64.
-->
<Custom Action='EnsureIMEIsDisabledForServiceAccountBeforeUninstall'
After='RestoreUserIMEEnvironment' >
(REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE)
</Custom>
<!-- This action invoked only when removal of the old product failed. -->
<Custom Action='UnregisterTIPRollback64'
After='EnsureIMEIsDisabledForServiceAccountBeforeUninstall' >
After='RestoreUserIMEEnvironment' >
(REMOVE="ALL") AND UPGRADINGPRODUCTCODE AND (VersionNT64)
</Custom>
<Custom Action='UnregisterTIP64' After='UnregisterTIPRollback64' >
Expand Down Expand Up @@ -538,10 +521,6 @@
(NOT (REMOVE="ALL")) AND (VersionNT64)
</Custom>
<Custom Action='EnsureAllApplicationPackagesPermisssions'
Before='EnsureIMEIsDisabledForServiceAccountAfterInstall' >
(NOT (REMOVE="ALL"))
</Custom>
<Custom Action='EnsureIMEIsDisabledForServiceAccountAfterInstall'
Before='InitialInstallationCommit' >
(NOT (REMOVE="ALL"))
</Custom>
Expand Down
23 changes: 1 addition & 22 deletions src/win32/installer/installer_oss_64bit.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,6 @@
DllEntry='ShutdownServer' Impersonate='yes' Return='ignore' />
<CustomAction Id='RestoreUserIMEEnvironment' BinaryKey='mozc_installer_helper.dll'
DllEntry='RestoreUserIMEEnvironment' Impersonate='yes' Return='ignore'/>
<CustomAction Id='EnsureIMEIsDisabledForServiceAccountBeforeUninstall'
BinaryKey='mozc_installer_helper.dll' Execute='deferred'
DllEntry='EnsureIMEIsDisabledForServiceAccount' Impersonate='no'
Return='ignore'/>
<CustomAction Id='EnsureIMEIsDisabledForServiceAccountAfterInstall'
BinaryKey='mozc_installer_helper.dll' Execute='deferred'
DllEntry='EnsureIMEIsDisabledForServiceAccount' Impersonate='no'
Return='ignore'/>
<CustomAction Id='InitialInstallation' BinaryKey='mozc_installer_helper.dll'
DllEntry='InitialInstallation' Execute='deferred'
Impersonate='no' />
Expand Down Expand Up @@ -397,18 +389,9 @@
<Custom Action='RestoreUserIMEEnvironment' After='SelfUnregModules'>
(REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE)
</Custom>
<!--
EnsureIMEIsDisabledForServiceAccountBeforeUninstall should be invoked
before Mozc's KLID is removed, which means you should call this action
before UnregisterTIPRollback64.
-->
<Custom Action='EnsureIMEIsDisabledForServiceAccountBeforeUninstall'
After='RestoreUserIMEEnvironment' >
(REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE)
</Custom>
<!-- This action invoked only when removal of the old product failed. -->
<Custom Action='UnregisterTIPRollback64'
After='EnsureIMEIsDisabledForServiceAccountBeforeUninstall' >
After='RestoreUserIMEEnvironment' >
(REMOVE="ALL") AND UPGRADINGPRODUCTCODE AND (VersionNT64)
</Custom>
<Custom Action='UnregisterTIP64' After='UnregisterTIPRollback64' >
Expand Down Expand Up @@ -458,10 +441,6 @@
(NOT (REMOVE="ALL")) AND (VersionNT64)
</Custom>
<Custom Action='EnsureAllApplicationPackagesPermisssions'
Before='EnsureIMEIsDisabledForServiceAccountAfterInstall' >
(NOT (REMOVE="ALL"))
</Custom>
<Custom Action='EnsureIMEIsDisabledForServiceAccountAfterInstall'
Before='InitialInstallationCommit' >
(NOT (REMOVE="ALL"))
</Custom>
Expand Down

0 comments on commit 40c6144

Please sign in to comment.