Everyone,

        I have the following directory structure in an MSI I am trying to build:


<Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
                <Directory Id="HELPDIR" Name="HELP">
                <!-- components here -->
                </Directory>
                <Directory Id="HELPDIR" Name="HELP">
                <!-- components here -->
                </Directory>

                <Directory Id="APPDATADIR" Name=".">
                        <Directory Id="PARMDIR" Name="PARM">
                        <!-- components here -->
                        </Directory>
                        <Directory Id="XMLDIR" Name="XML">
                        <!-- components here -->
                        </Directory>
                </Directory>
        </Directory>
</Fragment>


        Basically, I have a directory APPDATADIR whose parent is TARGETDIR; 
underneath are two directories whose parent is APPDATADIR.  I also have two 
child directories under TARGETDIR as well.  All of these directories have 
components or merge modules below them.  I am trying to use a custom action to 
change the value of APPDATADIR based on a second property called SPLITBUILD.  
This property can be changed via a dialog such that the child directories for 
APPDATADIR are modified accordingly via propagation.  I am doing this to give 
the user a choice about the components under APPDATADIR, i.e., whether or not 
to have the files/components under APPDATADIR installed under a different 
directory than the TARGETDIR.  The property SPLITBUILD is used in a radio 
button group with two choices with values of "Yes" as default and "No" (too 
lazy to write the code here but it does work).  Based on the value of 
SPLITBUILD, I am attempting to modify the APPDATADIR as follows:


<Fragment>
    <CustomAction Id="DIRCA_APPDATADIR_NOSPLITBUILD" Property="APPDATADIR" 
Value="[TARGETDIR]" Execute="immediate"/>
    <CustomAction Id="DIRCA_APPDATADIR_SPLITBUILD" Property="APPDATADIR" 
Value="[CommonAppDataFolder][FOLDERNAME]" Execute="immediate"/>

        <InstallUISequence>
        <Custom Action="DIRCA_APPDATADIR_NOSPLITBUILD" After="CostInitialize" 
Overridable="yes">SPLITBUILD &lt;&gt; "Yes"</Custom>
        <Custom Action="DIRCA_APPDATADIR_SPLITBUILD" 
After="DIRCA_APPDATADIR_NOSPLITBUILD" Overridable="yes">SPLITBUILD = 
"Yes"</Custom>
        </InstallUISequence>

        <InstallExecuteSequence>
        <Custom Action="DIRCA_APPDATADIR_NOSPLITBUILD" After="CostInitialize" 
Overridable="yes">SPLITBUILD &lt;&gt; "Yes"</Custom>
        <Custom Action="DIRCA_APPDATADIR_SPLITBUILD" 
After="DIRCA_APPDATADIR_NOSPLITBUILD" Overridable="yes">SPLITBUILD = 
"Yes"</Custom>
        </InstallExecuteSequence>
</Fragment>


        What happens is the following from looking at my installer logs: Before 
the user is given the SPLITBUILD option, APPDATADIR is set to 
"[CommonAppDataFolder][FOLDERNAME]", i.e., C:\ProgramData\FOLDERNAME\ , because 
SPLITBUILD is "Yes" by default .  The directories PARMDIR and XMLDIR are 
correctly set based on that value of APPDATADIR.  The user is then shown the 
radio button group to then modify SPLITBUILD.  The user modifies the value of 
SPLITBUILD to "No" and clicks Next and then eventually begins installing the 
product.  The value of APPDATADIR seems to be set to TARGETDIR from reading the 
logs.  However, the subdirectories under APPDATADIR are not recalculated based 
on that change, i.e., the change does not propagate.  I am trying to figure out 
how to configure the custom action above to properly pass the value of 
APPDATADIR such that PARMDIR and XMLDIR are modified based on the change.

        I have also tried setting APPDATADIR directly though the ControlEvent 
table instead of the custom actions above (clicking Next after changing 
SPLITBUILD would modify APPDATADIR).  However, the subdirectories were not 
modified based on the parent directory change.  I thought that moving the 
custom action to after the CostInitialize action would help.  Should I move it 
after FileCost but before CostFinalize?  I believe the standard event structure 
would normally be CostInitialize -> FileCost -> CostFinalize.  I moved the 
custom action into that block as the installer logs shows the MSI  doing 
recalculations of all the directories.  I have also tried changing the Execute= 
attribute for the custom action as well, but the results have been mixed.  I 
feel that I am so close yet so far.  Any feedback or assistance would be 
appreciated.  Thank you for your time.


David J. Antoine
Quality Assurance
ConvergEx Group | RealTick
danto...@realtick.com
This electronic mail message and any attached files contain information 
intended for the exclusive use of the individual or entity to whom it is 
addressed and may contain information that is proprietary, privileged, 
confidential and/or exempt from disclosure under applicable law. If you are not 
the intended recipient, you are hereby notified that any viewing, copying, 
disclosure or distribution of this information may be subject to legal 
restriction or sanction. Please notify the sender, by electronic mail or 
telephone, of any unintended recipients and delete the original message without 
making any copies.

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to