2013-02-28 35 views
1

我想在我的wixprojVisual Studio中添加HeatDirecotry任务,但我需要Directory属性 - 源路径 - 将是变量 - 预处理器变量,因此我可以动态提供它。heatdirectory directory dynamic

任何人都可以告诉我该怎么做?

谢谢!

+1

http://wix.sourceforge.net/manual-wix2/preprocessor.htm阅读这个。就源路径而言。它通常是INSTALLFOLDER – Gilad 2013-02-28 21:52:09

回答

0

请尝试以下 卸载你的项目,然后在.wixproj文件

<Target Name="BeforeBuild"> 
     <HeatDirectory DirectoryRefId="INSTALLFOLDER" 
         OutputFile="Source.wxs" 
         Directory="C:\Users\aaa\Desktop\ComponentsFiles" 
         SuppressRootDirectory="true" 
         ToolPath="$(WixToolPath)" AutogenerateGuids="true" 
        ComponentGroupName="SourceComponentGroup" 
        PreprocessorVariable="var.SourcePath">        
      </HeatDirectory> 
     </Target> 

添加下面的代码,然后重新加载项目。在项目属性的buils标记中添加以下文件作为预处理器变量 SourcePath = C:\ Users \ aaa \ Desktop \ ComponentsFiles