title: How to stop a running process during an MSI based un-install?
body: <p>I'm using Wise Package Studio 7.0 SP2 on Windows XP.</p>
  
  <p>I've got an MSI Wrapped EXE installation that goes about happily installing some files and then running one of the files from the installation which we can refer to as app.exe.</p>
  
  <p>So on the "Execute Deferred" tab of the MSI Editor, I had to add the lines:</p>
  
  <pre><code>If Not Installed then
    Execute Installed Program app.exe (Action)
  End
  </code></pre>
  
  <p>This ensured that my app.exe would be run <em>only</em> on an installation and not during a modify/repair/removal. When app.exe runs, it conveniently adds itself to the system tray.</p>
  
  <p>I'm looking for something that will do the reverse during a removal. I want to stop the app.exe process thus removing it from the system tray.</p>
  
  <p>Currently my removal gets rid of all the files however the app.exe remains running and still shows up in the systems tray. I've looked at adding the conditional statement:</p>
  
  <pre><code>If REMOVE~="ALL" then
    *remove the app from the systray!*
  End
  </code></pre>
  
  <p>The conditional statement will let me do something only on a removal, however I'm not sure of the best approach to go about actually terminating the process. Is there an MSI command I can run that will let me do that? Should I write my own .exe that will do that?</p>