2

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.

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
chawky
  • 81
  • 7

1 Answers1

2

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.

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
  • but now im back to the original problem , the unistall process does not delete the created files , the problem is that RemoveFolder only deletes empty folders – chawky Aug 26 '19 at 17:30
  • Check the RemoveFolderEx construct linked to above. **Be careful!** It is a dangerous construct. Test on a virtual. And what folder is this? Is it generated? Is it installed? What is in there? – Stein Åsmul Aug 26 '19 at 17:33
  • the software that i am working on extracts data so when i install it two folders are created one "PFiles" contains the Dll files required for the software to work ,this folder is in the D: drive and the second folder is the C: drive by default in the programmes (x86) folder its called exctactedData ,the user can put it wherever he wants too, it has the data extracted after the software works , so yeah these are the two fodlers and they both have other folders inside and other files inside – chawky Aug 27 '19 at 08:49
  • So PFiles is installed meaning it has the installation files and the extractedData is genereated – chawky Aug 27 '19 at 14:44