WiX uninstall - close the application before restarting Manager

I have an installer with WiX. When it completes the installation, it launches an application that injects some code into the explorer process.

Currently, when I delete, the manager reboots and offers to close the application and explorer. Instead, I want to close the application manually (this is done by re-launching it with -exit on the command line). I have a custom action that does this.

Here is what I have tried so far:

<CustomAction ExeCommand="-exit" FileKey="MyApp.exe" Id="CloseMyApp" Impersonate="yes" Return="ignore" />

<InstallExecuteSequence>
    <RemoveExistingProducts After="InstallInitialize" />
    <Custom Action="CloseMyApp" Before="RemoveFiles" />
</InstallExecuteSequence>

This does not work. The action is performed after the Restart Manager session. Thus, the Restart Manager program appears and asks to close my application and Explorer. The action is performed later, but by then the application has already disappeared.

So, I tried this:

<InstallExecuteSequence>
    <RemoveExistingProducts After="InstallInitialize" />
    <Custom Action="CloseMyApp" Before="RemoveExistingProducts" />
</InstallExecuteSequence>

. . " LGHT1076: ICE63: InstallInitialize RemoveExistingProducts".

, Restart Manager?

, Impersonate = "no", , . , , , , . , .

?

+3
1

CloseMyApp InstallValidate, (doc). , MSIDISABLERMRESTART MSIRESTARTMANAGERCONTROL.

+5

Source: https://habr.com/ru/post/1751623/


All Articles