Hi,

I have a dialog with checkboxes to allow user choose the features they want to 
install, and I have several custom actions to prepare data if user want to 
install some feature.
The INSTALL_AGENT public property allows user to choose features by command 
line, and the install_agent private property is bind to the checkbox.

In the code:
<!-Pre set the install_agent property according to cmdline input-->
<SetProperty Id="install_agent" Value="1" Before="AppSearch" 
Sequence="both"><![CDATA[INSTALL_AGENT ~= "YES"]]></SetProperty>
<!-In the feature select dialog-->
<Control Id="CheckBoxAgent" Type="CheckBox" X="25" Y="103" Width="280" 
Height="15" CheckBoxValue="1" Property="install_agent"
                 Text="!(loc.FeatureSelection_AgentTitle)">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" 
Default="yes" Text="!(loc.WixUINext)">
          <Publish Event="Remove" Value="ALL">1</Publish>
          <Publish Event="AddLocal" Value="FeatureAgent">install_agent</Publish>
</Control>
<!-In InstallExecuteSequence, the CustomeAction for preparing registry values, 
happens before writeRegistryValues-->
<Custom Action="CAPrepareAgentRegistryValues" Sequence="4960"><![CDATA[(NOT 
Installed) AND install_agent]]></Custom>
<WriteRegistryValues Sequence="5000" />


I tought the custom action should be executed, if:

(1)    user use INSTALL_AGENT=YES in cmdline.
Or (2) user check the CheckBoxAgent by UI.

However, I found actually it only works on first case. In second case, the 
action is skipped.

Here is the log by execute: msiexec /I setup.msi INSTALL_AGENT=NO


(1)    MSI (c) (B8:70) [09:36:50:953]: Skipping action: Setinstall_agent 
(condition is false)

(2)    Action 9:36:56: FeatureSelectionDlg. Dialog created

(3)    MSI (c) (B8:CC) [09:36:58:628]: PROPERTY CHANGE: Adding install_agent 
property. Its value is '1'.

(4)    MSI (s) (98:08) [09:37:11:623]: Skipping action: Setinstall_agent 
(condition is false)

(5)    MSI (s) (98:08) [09:37:17:636]: Skipping action: 
CAPrepareAgentRegistryValues (condition is false)

Action (1) (2) (3) are in UI sequence, and (4) (5) are in execute sequence.
Action (5) is skipped, but shouldn't the condition be true since install_agent 
is 1 after action (3)?
Seems the action in UI has no effect to condition in execute sequence?

If I run msiexec /I setup.msi INSTALL_AGENT=YES, then it works fine.

I know that change the condition to
><![CDATA[(NOT Installed) AND &FeatureAgent >= 3]]>
would solve my problem, but I would like to understand why use install_agent 
here would fail.

The properties used in UI and Execute sequence are separated and do not 
influence the other? It is quite different from what I had expected.

Thanks,
-Elfe
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to