Skip to content

Commit

Permalink
[Setup] Better prevent FileInUse errors during install (#12512)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyoyuppe committed Jul 26, 2021
1 parent b2a86db commit 5e4f50f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/actions/spell-check/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,7 @@ MSDN
msedge
mshtmdid
msi
MSIFASTINSTALL
MSIHANDLE
MSIINSTALLER
MSIL
Expand Down
3 changes: 2 additions & 1 deletion installer/PowerToysSetup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@
/>

<!-- Close 'PowerToys.exe' before uninstall-->
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" />
<Property Id="MSIRESTARTMANAGERCONTROL" Value="DisableShutdown" />
<Property Id="MSIFASTINSTALL" Value="DisableShutdown" />
<util:CloseApplication CloseMessage="yes" Target="PowerToys.exe" ElevatedCloseMessage="yes" RebootPrompt="no" TerminateProcess="0" />
</Product>

Expand Down
6 changes: 5 additions & 1 deletion installer/PowerToysSetupCustomActions/CustomAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,14 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
}
processes.resize(bytes / sizeof(processes[0]));

std::array<std::wstring_view, 4> processesToTerminate = {
std::array<std::wstring_view, 8> processesToTerminate = {
L"PowerLauncher.exe",
L"PowerToys.Settings.exe",
L"PowerToys.Awake.exe",
L"PowerToys.FancyZones.exe",
L"Microsoft.PowerToys.Settings.UI.exe",
L"FancyZonesEditor.exe",
L"ColorPickerUI.exe",
L"PowerToys.exe"
};

Expand Down

0 comments on commit 5e4f50f

Please sign in to comment.