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

Edwin Castro egcastr at gmail.com
Fri Dec 17 13:49:34 PST 2021


I use the approach described here

https://code.dblock.org/2010/05/11/msi-property-patterns-upgrading-firstinstall-and-maintenance.html

using appropriate property names for my version of wix toolset. The post is
pretty old.

Once you have these properties available you can just use FirstInstall in
the condition which is easy to read and understand.

--
Edwin G. Castro


On Fri, Dec 17, 2021, 13:41 Bryan Dam via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> 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
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list