[wix-users] Stable (wrt. repair) conditional installation of component based on user selection at install time

Edwin Castro egcastr at gmail.com
Wed Aug 22 17:20:45 PDT 2018

I might be wrong here but if you get the UI data in the InstallUISequence,
then that data in the form of a property will be used during CostFinalize
in the InstallExecuteSequence to determine if the component should be
installed or not. Is this not the behavior you're seeing?

You are correct, to make the selection sticky you'll want to use the
remember property pattern/idiom. I don't think you have another option
there. You can determine if you're doing a major upgrade or not and include
that into your conditions in InstallUISequence and InstallExecuteSequence.

Edwin G. Castro

On Wed, Aug 22, 2018 at 4:57 PM Stephen Oberholtzer via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> I seek advice on how to manage a messy situation.
> I have a component (a file) that is shared by two features.   At
> installation time, the user specifies whether they are doing a
> "development" or "production" installation. (This is done in one of three
> ways: (1) by setting a property when running the installer, (2) placing a
> file with a certain name in [SOURCEDIR], or (3) answering a prompt
> displayed during the UI sequence.)
> - For a "development" installation, this component *must* be installed if
> either of the two features is enabled.
>   If, later, the user opts to repair, this component *should* be
> reinstalled if missing, but I can't get both that *and* the
> never-install-for-production, I can make due.
> - For a "production" installation, this component *must not* be installed.
> Doing so could cause the feature to behave in an unpredictable fashion.
>   If later, the user opts to repair, this component *must not* be
> installed.
> - Note that the features that use this component are not the only two
> features in the product.
> I see one way that the problem could be solved, but there are several
> hitches, so I'm wondering if there's a better way.
> * A component can have a Condition on it, but this Condition is only
> evaluated during CostFinalize, which is well before any UI kicks in;
> therefore, I would have to create a CA that calls MsiSetComponentState.
> * To make the dev/prod selection sticky, I could create a registry key;
> however, I need the dev/prod selection to *not* be sticky across major
> upgrades.  (Also, it's a bit clunky.)
> --
> -- Stevie-O
> Real programmers use COPY CON PROGRAM.EXE
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/

More information about the wix-users mailing list