[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 16:57:20 PDT 2018


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


More information about the wix-users mailing list