Issue with CloseApplications using WiX 5.0.2 #8869
Replies: 2 comments 5 replies
-
I can at least answer this part. MSI installation is divided up into two parts:
Due to the above a lot of custom actions will come in pairs: one to collect data, etc, and one to actually execute the desired actions. |
Beta Was this translation helpful? Give feedback.
-
|
use taskkill.exe You wont be able to kill a process that is not owned by current user, unless the installer is launched as administrator. <SetProperty Id="WixQuietExecCmdLine" Value=""[System64Folder]\taskkill.exe" /F /IM myapp.exe" Before="Kill_Process" Sequence="execute" />
<CustomAction Id="Kill_Process" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixQuietExec" Execute="immediate" Return="ignore" />
<InstallExecuteSequence>
<Custom Action="Kill_Process" Before="InstallValidate" />
</InstallExecuteSequence>OR <CustomAction Id="Kill_Process" Impersonate="no" Directory="TARGETDIR" Execute="immediate" ExeCommand=""[System64Folder]\taskkill.exe" /F /IM myapp.exe" /> |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have an installer for our app that consists of a service and a TrayIcon. During Upgrades, we always get the error that the TrayIcon has files in use and needs to be killed, which fails.
I read that CloseApplications is intended for this kind of usage, closing TrayIcons and other apps, and tried to implement it.
The problem I am facing is I need this to run before RestarManger fires and prompts for it but no matter what I try it always errors out with
Error 2762: Unable to schedule operation. The action must be scheduled between InstallInitialize and InstallFinalize.I read that setting RebootPrompt=no should fix this but no luck. No matter what values I set its always the same error.
If I move it after InstallInitialize it will be too late as the RM had already prompted for the kill so it defeats the point.
The code that I tried
<util:CloseApplication Id="CloseTrayIcon" Target="$(var.TrayIconFileId)" TerminateProcess="1" RebootPrompt="no" /><Custom Action="override Wix4CloseApplications_$(sys.BUILDARCHSHORT)" After="InstallValidate"/>What is see in the logs and confuses me is that it starts as Wix4CloseApplications_X64 and than part way through it switches to Wix4CloseApplicationsDeferred_X64 and that is when it fails
Is there any way to achieve this without getting the file in use prompt, and if yes, how? Or am I out of luck? And why does it switch to Wix4CloseApplicationsDeferred_X64 ?
Beta Was this translation helpful? Give feedback.
All reactions