> I have a property: > <Property Id='Product' Value='MyProductName'/> > > Then I use this property value in the <Registry> element > <Registry Root='HKCU' Key='Software\[Product]' Name='SomeVal' > Action='write' Type='string'/> > It will create HKCU\Software\MyProductName. So far Ok. > > However if I try doing the same with <directory> element, it > fails to work > <directory Id="SomeId" Name="Prod~1" LongName='[Product]'> > LongName in this case will be [Product], not MyProductName > > Why the property is not substituted with its value in the case of > <directory> element?
The short answer is those 'static' properties don't work in a <Directory> element. You can however use a search property, e.g. a property that is set using a child DirectorySearch element. I think you can also use a property that is set using a Type 51 action, if it's sequenced early enough. (In other words a property that is set using a custom action's default value.) You could also use a type 35 custom action to set the Directory table entry value directly, which is similar to a Type 51 custom action only you use the "Directory" attribute instead of the "Property" attribute. IIRC you can also use a property that is set on the command line. But a regular property set using a <Property> element by itself won't work. - Lorne Laliberte ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users