CuriousGeorge
CuriousGeorge

Reputation: 1175

Wix: one of my executables is still running even after uninstall. How do I fix it?

I have this executable for the system tray icon project and was able to install and trigger it using CustomAction element in WIX:

<CustomAction Id="CustomActionID"
              FileKey="mySystemTrayIconEXE"
              ExeCommand=""
              Execute="deferred"
              Return="asyncNoWait">NOT REMOVE</CustomAction>

However, after I uninstall the application "mySystemTrayIcon.exe" is still running. How do I make it stop? I've searched for the answer but had no luck.

Thank you in advance!

Upvotes: 2

Views: 537

Answers (2)

saschabeaumont
saschabeaumont

Reputation: 22406

You will need to impliment one of the following:

  • A way of telling your background application to exit cleanly
  • A custom action to kill your background application (e.g. using TASKKILL.EXE)
  • Force (or request) a reboot at the end of installation (and let the OS kill the app)

Upvotes: 1

Cosmin
Cosmin

Reputation: 21416

You can use another custom action.

Basically, your tray application should have a trigger for stopping itself (a mutex, an event, a command line option etc.). During uninstall you can use a custom action to execute that trigger.

Another solution would be to create a custom action which kills your application process. But this is not recommended.

Upvotes: 3

Related Questions