Removing multiple products with a custom action

I am developing a WIX-based installer for our product, which has a base product and many plugins. Base and plugin will be delivered as separate MSI. Plugins can only be installed when the base is available. The base and plugins share a common folder tree in the ROOT folder, for example, "C: \ Program files \ MyProduct".

I use custom actions to remove all dependent plugins. But plugins do not uninstall properly. This is very random. Several times, three plug-ins were removed, and sometimes only two plug-ins. But I can remove the plugins separately from "Add or Remove Programs."

I use the following user actions ...

<Fragment> <CustomAction Id='UninstallP1Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p1.log" Execute='immediate' Return='asyncNoWait' /> <CustomAction Id='UninstallP2Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p2.log" Execute='immediate' Return='asyncNoWait' /> <CustomAction Id='UninstallP3Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p3.log" Execute='immediate' Return='asyncNoWait' /> <CustomAction Id='UninstallP4Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p4.log" Execute='immediate' Return='asyncNoWait' /> <CustomAction Id='UninstallP4Action' Directory='SystemFolder' ExeCommand="[SystemFolder]MSIExec.exe /X {PRODUCT_CODE_HERE} /qn /l* $(env.windir)\Temp\p4.log" Execute='immediate' Return='asyncNoWait' /> </Fragment> 

I call this CA in my product script as ...

  <!--Uninstall Plug-ins --> <Custom Action='UninstallP1Action' After='InstallFinalize'>(REMOVE="ALL")</Custom> <Custom Action='UninstallP2Action' After='UninstallP1Action'>(REMOVE="ALL")</Custom> <Custom Action='UninstallP3Action' After='UninstallP2Action'>(REMOVE="ALL")</Custom> <Custom Action='UninstallP4Action' After='UninstallP3Action'>(REMOVE="ALL")</Custom> <Custom Action='UninstallP5Action' After='UninstallP4Action'>(REMOVE="ALL")</Custom> 

My questions are here

  • How to clean all plug-ins when deleting the database?

  • Logs are not created when the plugin is missing when uninstalled. But the log is successfully created when the plugin is removed correctly. How to check it?

  • I know about creating functions (for different plugins) within the same MSI. But our plan is to send plugins as separate MSIs. Any other possible way available on WiX?

Any help would be really appreciated!

+4
source share
1 answer

How to make a clean uninstall of all plug-ins when deleting the database?

Your deleted user actions are not waiting for a refund. Therefore, they basically run delete commands one after another, without waiting for each process to complete.

Windows Installer does not support the simultaneous execution of two instances of InstallExecuteSequences. Thus, two removal processes cannot be performed simultaneously. Since you start several uninstall processes at the same time, some of them fail.

The solution uses the BAT file to execute the delete commands. He waits for the completion of each team before launching the next. The disadvantage is that you cannot easily remove this BAT from the target machine when your uninstall is complete.

There are no logs created when the plugin is missing upon removal. But the log is successfully created when the plugin is removed correctly. How to check it?

Windows Installer automatically detects conflicting installation or removal processes. Thus, you will remove your plugin before it starts writing a log.

I know about creating functions (for different plugins) in one MSI. But our plan is to send plugins as separate MSIs. Anyone else available on WiX?

Not really.

+6
source

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


All Articles