[wix-users] Run custom action only during modify

Vladimir Kolobkov vkolobkov at gmail.com
Wed Feb 26 00:14:11 PST 2020


Hello Satya,

Not sure that i know how to do it the right way.
But you can test features of your msi for current state, and if at least
one is already installed then you are probably in the change/modify or
uninstall.
Not sure about repear or upgrade or patch but it can be tested :).

For example:
<Custom Action="*%Action you need to run%*" Before="*%any action%*
"><![CDATA[(&*%FTR_Name%* = 3 AND !*%FTR_Name%* <> 3) AND UILevel < 4 AND
NOT (REMOVE ~= "ALL")]]></Custom>
As i remember:
- this action runs on silent mode( UILevel < 4 )
- not for uninstall( NOT (REMOVE ~= "ALL") )
- if feature "FTR_Name" action is INSTALLSTATE_LOCAL(&*%FTR_Name%* = 3)
- and if feature "FTR_Name" current state is not INSTALLSTATE_LOCAL(!
*%FTR_Name%* <> 3)

probably you need to check current state only and not the action.

Here are additional links for help with conditions:
https://docs.microsoft.com/en-us/windows/win32/msi/conditional-statement-syntax?redirectedfrom=MSDN#feature-and-component-state-values

https://docs.microsoft.com/en-us/windows/win32/msi/examples-of-conditional-statement-syntax


Best regards,
Vladimir Kolobkov


On Wed, 26 Feb 2020 at 06:18, Satya via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Can anyone help me with this?
>
> On Wed, 19 Feb, 2020, 9:10 PM SNR Gopu, <gsnreddy1234 at gmail.com> wrote:
>
> > Hi,
> >
> > I have a custom action which needs to be executed only during modify. The
> > below condition is working fine when user selects "Change" option by
> > launching the MSI.
> >
> > *Installed AND NOT REINSTALL AND NOT REMOVE~="ALL"*
> >
> > But, if the user selects the "Change" option from add/remove programs,
> the
> > custom action is not being executed. Could you please let me know the
> > condition that I need to use in this scenario?
> >
> > Regards,
> > Satya
> >
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list