Reputation: 1426
I've been struggling with the DirectorySearch command. I want to find the Templates folder that is located under the Microsoft Office folder. It can be in either of the following two locations:
I've tried the following
....
<Directory Id="MICROSOFTOFFICE" Name="Microsoft Office">
<Directory Id="TEMPLATES"/>
</Directory>
<Property Id="TEMPLATES">
<DirectorySearch Id='MSDir' Path='[MICROSOFTOFFICE]' >
<DirectorySearch Id='TDir' Depth='3' Path='Templates'/>
</DirectorySearch>
</Property>
What am I doing wrong? When I try to view the contents of Templates it says "1: 0 2:" Does this mean null?
<Condition Message="[TEMPLATES]">TEMPLATES</Condition>
Upvotes: 0
Views: 2134
Reputation: 4798
Directories are not properties. If you want to set a directory to the value of a property you should use SetDirectory
<SetDirectory Action="SetTemplateDir" Id="TEMPLATES" Value="[TEMPLATES]">TEMPLATES</SetDirectory>
If this doesn't work you might need to look at the msi logs for more information on what is happening during the directory searches and trying to set the directory. Just run your msi from the cmd line with "msiexec /i installer.msi /l*v msilog.txt"
Upvotes: 1