[wix-users] Run custom action only during modify

Satya gsnreddy1234 at gmail.com
Thu Feb 27 03:51:21 PST 2020


Hi Edwin and Vladimir,

I haven't tried the suggestions shared by you yet. Before that I would like
to know whether it is possible to use "WixUI_InstallMode" property. I
observed that this private property holds the correct value based on the
installation type.

Example:
MSI (c) (1C:5C) [16:58:07:499]: PROPERTY CHANGE: Adding WixUI_InstallMode
property. Its value is 'Change'.

Can we use this property? I tried to read it like other public properties
but it's not working.

Regards,
Satya

On Thu, Feb 27, 2020 at 12:43 AM Edwin Castro via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Satya,
>
> This might be a helpful resource too!
>
>
> https://code.dblock.org/2010/05/11/msi-property-patterns-upgrading-firstinstall-and-maintenance.html
>
>
> --
> Edwin G. Castro
>
> On Wed, Feb 26, 2020 at 12:14 AM Vladimir Kolobkov via wix-users <
> wix-users at lists.wixtoolset.org> wrote:
>
> > 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/
> > >
> >
> > ____________________________________________________________________
> > WiX Toolset Users Mailing List provided by FireGiant
> > http://www.firegiant.com/
> >
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list