Because it is in a merge module, your directory property will have been
modularised. 
Open your MSI with orca and youll see it has a guid added to it. 
See http://msdn.microsoft.com/en-us/library/aa367787%28VS.85%29.aspx for
an example.

Either use the modularised property in your search or move your search
into the merge module or use wixlibs instead of merge modules.


-----Original Message-----
From: Romanowski Tomasz [mailto:tomasz.romanow...@volvo.com] 
Sent: 27 September 2010 12:46
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] property value is empty when searchdirectory refers
to another property

Hi!

I develop a merge module and have directory structure is like this:


<Directory Id="TARGETDIR" Name="SourceDir">

    <Directory Id="ProgramFilesFolder">

        <Directory Id="CLUPDIR" Name="ClUp">

            <Directory Id="AGENTDIR" Name="Agent">

            ...

I would like to run custom action based on some condition. The condition
comes from verification of file presence. That's why I have a property
filled with verification result.

<Property Id="DBEXISTS">

    <DirectorySearch Id="AGENTDIRSEARCH" Path="[AgentDirToSearch]"
Depth="0">

        <FileSearch Id="DBSEARCH" Name="CLUPAgent.sdf"/>

    </DirectorySearch>

</Property>


As you might noticed, my DirectorySearch element uses AgentDirToSearch
property in its Path attribute.
This property is set  by custom action

<CustomAction Id="SetAgentDirToSearch" Property="AgentDirToSearch"
Value="[CLUPDIR]Agent" Execute="immediate"/>

schedule after InstallInitialize:

<InstallExecuteSequence>

    <Custom Action='SetAgentDirToSearch' After='InstallInitialize' />

    ...


What I observe is, that DBEXISTS property is never set. If I use
explicit path to the directory like, C:\Program Files\ClUp\Agent, then
it works. Why is that?
Does it have something to do when property DBEXISTS is assigned? And
then how to schedule it to happen after referenced property is set?

Thanks in advance for all suggestions.

P.S.
Initially I've used just [AGENTDIR] in the DirectorySearch element but
(most likely due to trailing backslash) it didn't work.


Regards,
Tomek Romanowski

------------------------------------------------------------------------
------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
</pre>
<BR style="font-size:4px;">
<a href = "http://www.sdl.com";><img src="http://www.sdl.com/images/email 
logo_150dpi-01.png" alt="www.sdl.com" border="0"/></a>
<BR>
<font face="arial"  size="2"><a href = "http://www.sdl.com"; 
style="color:005740; font-weight: bold">www.sdl.com</a></font>
<BR>
<BR>
<font face="arial"  size="1" color="#736F6E">
<b>SDL PLC confidential, all rights reserved.</b>
If you are not the intended recipient of this mail SDL requests and requires 
that you delete it without acting upon or copying any of its contents, and we 
further request that you advise us.<BR>
SDL PLC is a public limited company registered in England and Wales.  
Registered number: 02675207.<BR>
Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6 7DY, 
UK.
</font>



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to