Both produ...@value and directo...@name fields are literal. If you want them
formatted you need to use custom action types 35 or 51. Those are formatted
like this:

<CustomAction Directory="CmdManRoot" Value="FormattedPath"
Id="SetCmdManRoot"/><!--type 35-->
<CustomAction Property="CompanyRoot" Value="FormattedValue"
Id="SetCompanyRoot"/><!--type 51-->

They then have to be scheduled, according to the sequencing restrictions of
each type (if you are using then for directory paths, type 51s have to be
scheduled before CostFinalize. Type 35s must always come after
CostFinalize).

AFAIK (but I haven't ever tested it) the above values, when used for
directory paths, must always be FULL paths, but I may be wrong.

If you know what values you want and simply don't want to repeat yourself,
why not use preprocessor variables?

  <?define CompanyName="49thLatitude"?>
  <?define ProductRoot="CmdMan"?>

  <Property Id="MYCOMPANYNAME" Value="$(var.CompanyName)" />

  <Property Id="MYPRODUCTROOT" Value="$(var.ProductRoot)" />

        <Directory Id="CompanyRoot" Name="$(var.CompanyName)">

          <Directory Id="CmdManRoot" Name="$(var.ProductRoot)">

The only disadvantage of the preprocessor variables is you can't use a
change in the property value to alter your folder names directly. However,
you could use a custom action to update the directory table if that is what
you need. See Bob's blog entry on Semi-Custom Actions as he called them:
http://www.joyofsetup.com/2007/07/01/semi-custom-actions/


-----Original Message-----
From: Dave Kolb [mailto:d...@dotnetcodeslingers.com] 
Sent: Friday, October 23, 2009 10:41 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: [WiX-users] Can I set the Directory name attribute with a custom
property value?

Should this work? I am getting the literal strings as the directory name. Is
the directory name attribute not "formattable"? Where is it documented what
is formatted or not as I have not been able to find that information.
Thanks, Dave

 

  <Property Id="MYCOMPANYNAME" Value="49thLatitude" />

  <Property Id="MYPRODUCTROOT" Value="CmdMan" />

 

        <Directory Id="CompanyRoot" Name="[MYCOMPANYNAME]">

          <Directory Id="CmdManRoot" Name="[MYPRODUCTROOT]">

 

----------------------------------------------------------------------------
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to