Search code examples
wixwindows-installerinstallation

There is a problem with this windows installer package. A program required for this install to complete could not be run


I created an installer with WiX and the installation process worked. Then I started working on the uninstall, so I created a bat file that deletes the folders created. However I got this error : "There is a problem with this windows installer package. a program required for this install to complete could not be run", but now even the installation doesn't work. I undid my work and went back to the previous code when it works but I still get the same problem.

I deleted the files created but there must ba something I am missing.


Solution

  • Custom Action Failure: That error message indicates a failing custom action. Logging MSI installations - summary of how to do MSI logging and many links for how to interpret log files.

    Remove Folder: You should not use Custom Actions if you do not need them. Propaganda against them. There are built-in MSI constructs to remove folders and files and also custom constructs in WiX and commercial MSI tools to do so. The crucial question is: do you need to remove the folders? You shouldn't if they are in the user profile - then they are user data.

    WiX: Removing Files and Folders: a write-up on file and folder removal. Top Tip (as Edd China says): search github.com for samples.

    Un-Uninstallable MSI Packages: Failing custom actions on uninstall can cause packages that seem impossible to remove, but there are many options - I would recommend trying Microsoft Fix It first. Here are more options (but fixit should do it):

    Virtual Machine: If you are using a virtual machine for testing, just revert the machine to "undo" the problem instead. Do use virtual machines for testing - particularly if the technology is new for you - of course. Particularly good for testing installation on "clean systems" as well - of course. So you can work out prerequisites.