Search code examples
wixdependencieswindows-installercustom-action

Wix - During install/upgrade a Custom Action's conditions resolve to False when they shouldn't


The Setup

So I have a Custom Action in my InstallExecuteSequence that looks like this:

    <Custom Action="UpdateConfigFile" After="InstallFinalize">NOT Installed OR Upgrading</Custom>    

Where Upgrading is defined to:

        <SetProperty After="SetFirstInstall" Id="Upgrading" Value="true">
         WIX_UPGRADE_DETECTED AND NOT (REMOVE="ALL")
        </SetProperty>

The Custom Action updates a web.config file with a value that is passed into the installer via a Property. It is a VB.Net function.


The Issue I'm Running Into

This Custom Action has always executed in many of our installers. But for a certain environment that we have in development, the conditions for it resolve to False on a install/upgrade scenario. It says "(condition is false)" in the MSI log.

The environment is used for development purposes such as testing the product after installed/updated.


What I'm Trying to Accomplish

I would like this to be resolved so that this environment can install our product successfully.


What I've Done So Far

I've installed the same installer to different Operating Systems such as Windows 10, 2012 R2, and 2016. The installer works just fine since the Custom Action runs as expected.

The troublesome environment is a Windows Server 2012 R2 machine. Which makes me even more confused.

I did some digging in and was only able to find this link: (https://blogs.msdn.microsoft.com/heaths/2006/07/11/why-a-custom-action-may-not-run/#comments)

From the link's suggestion, I think it is really odd if a dependency was missing because the same installer works on other machines.

So I'm pretty stumped at this point. Any help or direction would be very much appreciated. If I'm not being clear enough, feel free to ask for more clarification. Please and thank you.


Solution

  • After helping the team responsible for the environment, we found out that it was a certain scenario that was causing this issue. Digging deep into the MSI log further, we found that a previous Custom Action running, also after InstallFinalize, was returning a Failure Action Result. Since that happened, the following Custom Actions such as my UpdateConfigFile Custom Action, don't execute. Resulting in the "(condition is false)" entry in the log.

    Once we figured that out, I was able to reproduce it on my local environment.

    Since these Custom Actions are after InstallFinalize, I thought that those Custom Actions would still run if one failed because we're past the point of the installer being able to do a Rollback. But I was wrong and now I know.

    Thanks for everyone helping me out in trying to figure out this issue. I was getting worried that I was going to try to figure this out for days and start pulling my hair out. XD