0

TFSTeamBuildで実行されているビルドがあります。そのプロパティを、TFSBuild.projによってビルドされたプロジェクトごとに実行されるMSBuildに渡したいと思います。

例:

TFSBuild.proj

<PropertyGroup>
   <Version>0.0.0.0</Version>
</PropertyGroup>

<Target Name="BuildNumberOverrideTarget" 
        DependsOnTargets="AfterInitializeWorkspace">

  <!--Code that loads the version from a file (removed).-->

  <PropertyGroup>
    <!--Save off the version.-->
    <Version>$(TxCompleteVersion)</Version>
</PropertyGroup>

MyWIXProjectFile.wixproj

<Target Name="BeforeBuild">
<PropertyGroup>
  <!--If Version is defined then use that.  
   Else just use all zeros to show that this is a developer built version-->
  <CurrentVersion Condition="'$(Version)' == ''" >0.0.0.0</CurrentVersion>
  <CurrentVersion Condition="'$(Version)' != ''" >$(Version)</CurrentVersion>
</PropertyGroup>
<Message Condition="'$(Version)' == ''" 
         Text="Version info is empty (i.e. a developer build).  Version set to $(CurrentVersion)"/>

</Target>

MyWixProjectFile.wixprojがビルドされると、$(Version)が空白であることを示すメッセージが毎回出力されます。

プロジェクトファイルを取得してTFSBuild.projプロパティを表示できる方法はありますか?

ヴァッカノ

4

3 に答える 3

0

オプション1

MSBuild を使用して MyWIXProjectFile.wixproj を直接呼び出し、Version をプロパティとして渡します

オプション 2

wix のビルドを独自の selft に含まれるスクリプトに抽象化し、MSBuild を使用して直接呼び出し、必要なすべてのプロパティを渡します。これを完全に実装したブログがhttp://blog.newagesolution.net/2008/06/how-to-use-msbuild-and-wix-to-msi.htmlにあります。興味があるかもしれません。

于 2009-05-15T20:52:13.513 に答える
0

私は Wix の専門家ではありませんが、これを見つけたので試してみてはいかがでしょうか。

MSBuild で WiX のプロパティを設定する

于 2009-05-08T21:18:00.690 に答える