Question

Je suis en train de fermer un processus avant la désinstallation en utilisant Wix. Je l'ai confirmé que cela fonctionne aussi longtemps que il y a une fenêtre visible, mais s'il n'y a pas une fenêtre visible (ce qui est le cas la plupart du temps avec cette application car il est une application de barre d'état système), le programme de désinstallation juste se bloque, et continue éventuellement avec la désinstallation, laissant le déroulement du processus.

Selon ce post forum , il semble être Wix a eu du mal à fermer des applications minimisées dans le passé, alors je me demande si cela est lié?

Toutes les suggestions quant à ce que je peux faire pour vous assurer que le processus censureront? Est-il possible que je peux essayer de capturer le message dans mon application en utilisant peut-être le api Win32?

Voici la déclaration de CloseApplication:

<util:CloseApplication Id="CloseApp" CloseMessage="yes" Target="App.exe" RebootPrompt="yes" />

Et voici l'action personnalisée:

<Custom Before="InstallInitialize" Action="WixCloseApplications">REMOVE = "ALL"</Custom>
Était-ce utile?

La solution

It looks like you are scheduling the WixCloseApplications custom action before the installation transaction. The way the custom action works, is it scheduled a deferred action that actually closes the applications. It can't do that work unless it happens during the transaction (After="InstallInitialize").

The fix is probably pretty easy. Remove the Custom/@Action="WixCloseApplications" element.

Autres conseils

At first, don't forget to reference WixUtilExtension.dll assembly. Also check if Wix element contains definition of UtilExtension namespace:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

I've noticed that you should change your custom action to be executed before InstallInitialize.

<Custom Before="InstallInitialize" Action="WixCloseApplications">REMOVE = "ALL"</Custom>

If you apply those changes and CloseApplications extension doesn't work, try logging installation process using

msiexec /i MyApplication.msi /l*v MyLogFile.txt

I also faced this problem. Changing the Before attribute to "InstallValidate" worked for me.

<Custom Before="InstallValidate" Action="WixCloseApplications"/>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top