[wix-users] Condition to only Run Custom Actions on Initial Install

Bryan Dam bryand at recastsoftware.com
Fri Dec 17 13:41:15 PST 2021


I'm kinda dumbfounded to even ask this since:
A) It's been asked and answered many times (here<https://stackoverflow.com/questions/17411913/how-can-i-perform-a-custom-action-in-wix-that-only-executes-on-install-or-uninst/17425109#17425109>)
B) I've done my level-headed best to memorize this property value table (here<https://stackoverflow.com/questions/320921/how-to-add-a-wix-custom-action-that-happens-only-on-uninstall-via-msi/17608049#17608049>)
C) I've done exactly this several times in other installers

And yet, here I am. I'm creating a new installer and verifying the major upgrade process before initial release.  There's some configuration steps that gets info from the user and then saves it to a configuration file via custom action.  We only want to run that action upon initial install and skip those actions upon upgrades (including RemoveExistingProducts) and full uninstall.  Otherwise the installer properties are empty (because that bit of the UI didn't run) and the config gets wiped.

In the past I have used both of these successfully:
(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE)
(NOT Installed) AND (NOT REMOVE)

I've tried every possible permutation of parenthesis there without success.  Each time the initial install works fine but upon upgrade it always runs them anyways.  I can post the full log if someone wants to see it but during the major upgrade it's skipping the actions upon install but running them during the uninstall triggered by RemoveExistingProducts.  I've tried changing the schedule from the default to afterInistallInitialize but that doesn't change the behavior.

Here's the segment as it sits now:
<Custom Action="ApplyAppConfigurationParameters" After="GenerateSelfSignedCertificate">(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE)</Custom>
<Custom Action="ApplyAppConfiguration" After="ApplyAppConfigurationParameters">(NOT Installed) AND (NOT UPGRADINGPRODUCTCODE)</Custom>

Anyone got any ideas? This makes no sense to me after 8 hours of plugging away at it.

  Thanks,
     Bryan


More information about the wix-users mailing list