condition - WIX Directory Search Always Fails -
it seems no matter do, condition put in product in wix blocks install running. below i've put simple code should check if program file directory exists , if does, run installer. message saying "program files folder not found." indicating condition returns false. missing here?
<?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <product id="*" name="setupproject1" language="1033" version="1.0.0.0" manufacturer="toshiba" upgradecode="bb557911-769b-4a30-8461-3ad860ddc10e"> <package installerversion="200" compressed="yes" installscope="permachine" /> <majorupgrade downgradeerrormessage="a newer version of [productname] installed." /> <mediatemplate /> <property id="pffolder" > <directorysearch id="systemfolderdriverversion" path="[programfilesfolder]"> </directorysearch> </property> <condition message="program files folder not found."> <![cdata[pffolder]]> </condition> <feature id="productfeature" title="setupproject1" level="1"> <componentgroupref id="productcomponents" /> </feature> </product> <fragment> <directory id="targetdir" name="sourcedir"> <directory id="programfilesfolder"> <directory id="installfolder" name="setupproject1" /> </directory> </directory> </fragment> <fragment> <componentgroup id="productcomponents" directory="installfolder"> <!-- todo: remove comments around component element , componentref below in order add resources installer. --> <!-- <component id="productcomponent"> --> <!-- todo: insert files, registry keys, , other resources here. --> <!-- </component> --> </componentgroup> </fragment>
add assigntoproperty="yes" directorysearch element. don't think need wrap property name in cdata block.