Search code examples
installationwindows-installerwix3wix3.11

How can I suppress "this action is only valid for products that are currently installed" upon running msiexec /x to non-existing item?


I am attempting to make sure certain software does not exist before installing the newer version. Long story short, vendor requires me to do so, and although they recommend me to repair after install, that causes other issues such as undesirable restart (trust me I tried /norestart and I have even tried to modify the stored msi package to make sure it does not restart) but over all it just gives us soo much headache without the result we want.

So I tried to simply uninstall this software ahead of installing their newer one since that seem to have higher success rate without unnecessary issues.

Now I am accomplishing this by running batch file via ExePackage (with WiX toolset) with Vital="no". I have to do Vital="no" because when the older installer does not exist and if I call msiexec /x, it returns the error stating

this action is only valid for products that are currently installed

When the older installation exists, it works fine, but when it does not it errors out.

Now Vital="no" works fine, but I would prefer to suppress the error with msiexec /x if I can.

Is there any known way to solve this?


Solution

  • In order to solve this problem, I checked the uninstall keys and only called msiexec /x on products that were listed. Though in my own case, we were switching installer tech (too many MSI bugs...) and were uninstalling older versions of our own.