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

Stephen Oberholtzer stevie at qrpff.net
Wed Aug 22 18:32:31 PDT 2018

While I can't find any explicit documentation either way, I strongly
suspect that the CostFinalize action is scheduled in a "firstSequence"
style (i.e. it is only run inside InstallExecuteSequence if
InstallUISequence isn't executed, such as in a silent install.)

One other thing that I'm looking into is if it's possible to create a pair
of invisible sub-features with very low priority (say, level=32767)  that
are automatically selected when the 'development mode' option is selected;
however, I need to better understand what sorts of things can
enable/disable a feature for installation, to prevent unintended
installation in production mode.

On Wed, Aug 22, 2018 at 8:20 PM, Edwin Castro <egcastr at gmail.com> wrote:

> 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/

-- Stevie-O
Real programmers use COPY CON PROGRAM.EXE

More information about the wix-users mailing list