[wix-users] Dialog before cost initialize
Blair Murri
osito at live.com
Sat Feb 25 07:53:41 PST 2017
Setting feature (and component) conditions to default of “0” leads to all sorts of unintended consequences, including problems removing them later. There should be an ICE for that.
You should instead disable them if the validation does not allow them.
There are also actions that change feature actions in response to UI actions, so sequence needn’t be an issue. However, be warned that child features may not automatically follow their parents in the feature tree, so you may need to be explicit.
Blair Murri
Sent from my Windows 10 phone
From: Tigran Galoyan<mailto:tigran.galoyan at gmail.com>
Sent: Friday, February 24, 2017 2:31 PM
To: WiX Toolset Users Mailing List<mailto:wix-users at lists.wixtoolset.org>
Subject: [wix-users] Dialog before cost initialize
Hi,
I have a task to implement conditional installation. What exactly that
means in my case, to enable/disable some features with conditions. For
instance:
<Feature Id='Components_A' Level='0' ConfigurableDirectory='MY_DIR'>
<Condition Level="1">(COMPONENTS_A_ENABLED = "1")</Condition>
<ComponentGroupRef Id="Components_A" />
</Feature>
<Feature Id='Components_B' Level='0' ConfigurableDirectory='MY_DIR'>
<Condition Level="1">(COMPONENTS_B_ENABLED = "1")</Condition>
<ComponentGroupRef Id="Components_B" />
</Feature>
So as you can see if I have COMPONENTS_A_ENABLED or COMPONENTS_B_ENABLED
defined right in my code where those are declared then during the costing
stage it will be clear to count those or not.
However, those properties are defined with 0 value at the time of the
declaration and I set their values during my Serial Number validation UI
page; the latter comes after the LicenseAgreementDlg. Within the boundaries
of that page I call custom action to validate the entered serial number and
also define which components will be installed, so that's exactly where I
set the values for COMPONENTS_A_ENABLED and/or COMPONENTS_B_ENABLED to "1".
Unfortunately, it's too late to have it done at that stage, since when
later the SetupTypeDlg opens I can see that none of the components are
listed as the initial value for those were set to "0". But if I move my
Serial Number validation page to be displayed right at the beginning before
the CostInitialize then later when the UI starts and after
LicenseAgreementDlg the SetupTypeDlg opens I can see that my changes in the
custom action that run within the boundaries of the serial number page play
roll now :
<InstallUISequence>
<Show Dialog="SerialNumberDlg" Before="CostInitialize" />
</InstallUISequence>
Definitely the costing and filtering of which features will appear on
SetupTypeDlg based on conditions are done before the UI sequence that's why
my initial approach didn't work whereas the workaround to show the serial
number dialog before CostInitialize worked.
So my question is if there is a way to handle this without being forced to
call the serial number dialog before the costinitialize, rather, by letting
it open after LicenseAgreementDlg as it supposed to and upon entry of a
valid serial number and setting the values of the COMPONENTS_A_ENABLED
and/or COMPONENTS_B_ENABLED properties in the custom action based on the
serial number, to redo the costing again and when the SetupTypeDlg opens
later I can see the components listed there based on the property values
mentioned?
Thanks,
Tigran
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list