installer: force close application on uninstall (#1854)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke 2025-01-23 16:43:36 +01:00 committed by GitHub
parent 25e04fc947
commit 73186cde48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,12 +54,12 @@
<CustomAction Id="set_reinstallmode_property"
Property="REINSTALLMODE"
Value="amus" />
<!-- START CUSTOM ACTION FOR CONFIG FILE CREATION -->
<SetProperty
Id="CreateConfigFile"
Value="&quot;[%ComSpec]&quot; /c TYPE NUL >>&quot;[ConfigFile_NonDefault][ConfigFile_Default]&quot;"
Before="CreateConfigFile"
Sequence="execute"
Condition="ConfigFile_NonDefault OR ConfigFile_Default"
/>
<CustomAction
Id="CreateConfigFile"
@ -69,6 +69,24 @@
Return="check"
Impersonate="no"
/>
<!-- END CUSTOM ACTION FOR CONFIG FILE CREATION -->
<!-- START CUSTOM ACTION FOR KILLING THE PROCESS -->
<SetProperty
Id="KillProcess"
Value="&quot;[WindowsFolder]\System32\taskkill.exe&quot; /T /F /IM windows_exporter.exe"
Before="KillProcess"
Sequence="execute"
/>
<CustomAction
Id="KillProcess"
BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
DllEntry="WixQuietExec"
Execute="deferred"
Return="ignore"
Impersonate="no"
/>
<!-- END CUSTOM ACTION FOR KILLING THE PROCESS -->
<InstallExecuteSequence>
<!-- Set REINSTALL=all and REINSTALLMODE=amus if the user reruns the
@ -78,6 +96,7 @@
<Custom Action="set_reinstall_all_property" Before="set_reinstallmode_property" Condition="MAINTENANCE"/>
<Custom Action="set_reinstallmode_property" Before="LaunchConditions" Condition="MAINTENANCE"/>
<Custom Action="CreateConfigFile" Before="InstallServices" Condition="ConfigFile_NonDefault OR ConfigFile_Default" />
<Custom Action="KillProcess" Before="RemoveFiles" />
</InstallExecuteSequence>
<Media Id="1" Cabinet="windows_exporter.cab" EmbedCab="yes" />