Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX close application before uninstall - close open applications message

I'm in a kind of misery. I got an installer installing and starting a tray icon app (common .exe)

This is working properly, but now i want to stop that app before this UI telling the user to close the app manually comes up, because during the deinstall routine, my tray icon is removed but the process is still running.

I applied this custom action to close the app before uninstall (or even during)

<CustomAction Id="CloseTrayApp" ExeCommand="-exit" FileKey="TrayApp" Execute="immediate" Return="asyncNoWait" />

<InstallExecuteSequence>
    <Custom Action="CloseTrayApp" Before="InstallValidate" />
</InstallExecuteSequence>

But the "close all running apps" dialog still pops up, but i thought that this will solve my issue.

I already tried to use the CloseAction but i got into a hurry using it because of error while compiling the stuff. It says that the WixUtils namespace may be missing but i double checked that it is there:

xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"

How can I avoid the dialog window poping up and trigger this custom action to be executed?

like image 743
inva Avatar asked Mar 22 '12 12:03

inva


1 Answers

You also have to add a reference to WixUtilExtension.dll. If you are using Visual Studio / Votive you just right click add reference and select the DLL from [ProgramFilesFolder]Windows Installer XML v3.5\bin. Otherwise you have to make the extension available to the compiler and linker:

candle.exe yourfile.wxs -ext %full path to WixUtilExtension.dll%'
light.exe yourfile.wixobj -ext %full path to WixUtilExtension.dll% –out yourfile.msi yourfile.wixout'

More information can be found at:

Using Standard Custom Actions

Please note that the CloseApp custom action has a limitation that it won't "terminate" your application. It will only politely send your app a WM_CLOSE message and it's up to your trayapp to receive and process that message with a shutdown.

like image 101
Christopher Painter Avatar answered Jan 01 '23 22:01

Christopher Painter