2014-02-25 52 views
0

大家好:我的第一篇文章!msbuild + wix:如何讓熱指令使用defineconstants的變量?

我想要使用heatdirectory採用它的源目錄使用visualstudio的「定義常數」功能,其中我定義了一個常量SourceBinaries = C:\ someproject \ bin \ release的wixproj。

目的是使用相同的wixproj /設置爲多個項目和整個與TFS-構建自動化...

但是,目錄標記從未得到SourceBinaries的價值。

這裏的XML代碼:

<?xml version="1.0" encoding="utf-8"?> 
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
blah.. 
    <OutputName>ProjectSetup</OutputName> 
blah.. 
    </PropertyGroup> 
    <PropertyGroup> 
    <OutputPath>bin\$(Configuration)\</OutputPath> 
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> 
    <DefineConstants>SourceBinaries=c:\someproject\bin\release\</DefineConstants> 
    </PropertyGroup> 
    <ItemGroup> 
blah.. 
    </ItemGroup> 
    <Import Project="$(WixTargetsPath)" /> 
    <Target Name="BeforeBuild"> 
    <HeatDirectory NoLogo="$(HarvestDirectoryNoLogo)" 
     Directory="$(SourceBinaries)" 
     PreprocessorVariable="var.SourceBinaries" 
     SuppressAllWarnings="$(HarvestDirectorySuppressAllWarnings)" 
     SuppressSpecificWarnings="$(HarvestDirectorySuppressSpecificWarnings)" 
     ToolPath="$(WixToolPath)" 
     TreatWarningsAsErrors="$(HarvestDirectoryTreatWarningsAsErrors)" 
     TreatSpecificWarningsAsErrors="$(HarvestDirectoryTreatSpecificWarningsAsErrors)" 
     VerboseOutput="$(HarvestDirectoryVerboseOutput)" 
     AutogenerateGuids="$(HarvestDirectoryAutogenerateGuids)" 
     GenerateGuidsNow="$(HarvestDirectoryGenerateGuidsNow)" 
     OutputFile="ProductFiles.wxs" 
     SuppressFragments="$(HarvestDirectorySuppressFragments)" 
     SuppressUniqueIds="$(HarvestDirectorySuppressUniqueIds)" 
     Transforms="Transforms.xsl" 
     ComponentGroupName="ProductFiles" 
     DirectoryRefId="INSTALLLOCATION" 
     KeepEmptyDirectories="false" 
     SuppressCom="%(HarvestDirectory.SuppressCom)" 
     SuppressRootDirectory="true" 
     SuppressRegistry="%(HarvestDirectory.SuppressRegistry)"> 
    </HeatDirectory> 
blah.. 
</Target> 
    <Target Name="AfterBuild"> 
blah.. 
    </Target> 
</Project> 

不管我試圖使我「錯誤的‘HeatDirectory’任務沒有給出所需的參數值‘目錄’
有人可以幫我解決這個? 在此先感謝...

迪迪埃

回答