为了增加罗布的回答是:
#2。 TeamCity可以通过标签检索项目:
http://servername:8080/httpAuth/app/rest/buildTypes/id:bt13/builds?status=SUCCESS&tag=RTM
#3。我在WiX工具集中使用了PatchCreation元素(Rob建议上图),他对此非常灵活。这里是什么,我已经建立了一个大纲,这一切似乎在测试中工作得很好,
的TeamCity的项目有很多构建参数,它们分别是:
新版本号 - 默认作为变化,所以如果它没有被改变,它会破坏构建。
旧版本号 - 如上
新的Build回购 - 这是buildtypeid,看看查询字符串为您的项目,这将有buildTypeId = btXX。 XX是这里应该提供的数字。
旧的生成回购 - 如上
的TeamCity的项目有以下几个步骤:
的MSBuild亚军运行build.msbuild(见下文)
运行蜡烛上的patch.wxs创建一个patch.wixobj文件
运行灯亮patch.wixobj创建patch.pcp
拆开新版本(命令:msiexec/Q/A new.msi) -
拆开旧版本(命令:msiexec/Q/A old.msi) - 选择不同的工作目录
创建补丁(命令:msimsp -s patch.pcp p hotfix-%system.msiOldVersion% - %system.msiNewVersion%的.msp -l patch.log
MSBuild to创建patch.pcp
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--<Import Project="references\MSBuild.Community.Tasks.Targets"/>-->
<UsingTask AssemblyFile="references\MSBuild.Community.Tasks.dll" TaskName="WebDownload"/>
<UsingTask AssemblyFile="references\MSBuild.Community.Tasks.dll" TaskName="TemplateFile"/>
<Target Name="Build">
<!-- preconditions for build -->
<Error Condition="'$(msiOldVersion)' == 'changeme'" Text="Use run custom build, setting the client version of the msi"/>
<Error Condition="'$(msiOldVersion)' == ''" Text="Use run custom build, setting the client version of the msi"/>
<Error Condition="'$(msiNewVersion)' == 'changeme'" Text="Use run custom build, setting the new version of the msi"/>
<Error Condition="'$(msiNewVersion)' == ''" Text="Use run custom build, setting the new version of the msi"/>
<Message Text="Old Version: $(msiOldVersion)"/>
<Message Text="New version: $(msiNewVersion)"/>
<!-- download files from teamcity... -->
<WebDownload FileUri="http://server:8080/httpAuth/repository/download/bt$(msiOldRepo)/trunk/Path/bin/Release/en-us/installer-v-v.$(msiOldVersion).msi" UserName="download" Password="abcdefgh" FileName="downloads/oldversion.msi" />
<WebDownload FileUri="http://server:8080/httpAuth/repository/download/bt$(msiNewRepo)/trunk/Path/bin/Release/en-us/installer-v.$(msiNewVersion).msi" UserName="download" Password="abcdefgh" FileName="downloads/newversion.msi" />
<!-- fill in blanks in patch.wxs -->
<ItemGroup>
<Tokens Include="oldVersion">
<ReplacementValue>$(msiOldVersion)</ReplacementValue>
</Tokens>
<Tokens Include="newVersion">
<ReplacementValue>$(msiNewVersion)</ReplacementValue>
</Tokens>
</ItemGroup>
<TemplateFile Template="template.wxs" OutputFileName="patch.wxs" Tokens="@(Tokens)"/>
</Target>
通过的MSBuild脚本中使用
Template.wxs
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<PatchCreation
Id="deadbeef-dead-beef-dead-beefdeadbeef"
CleanWorkingFolder="no"
OutputPath="patch.pcp"
WholeFilesOnly="no">
<PatchInformation
Description="Small Update Patch"
Comments="Small Update Patch"
Manufacturer="Your Manufacturer"/>
<PatchMetadata
AllowRemoval="yes"
Description="Hotfix"
ManufacturerName="Your Manufacturer"
MoreInfoURL="http://yourwebsite.com"
TargetProductName="Your Product Name"
Classification="Hotfix"
DisplayName="Hotfix - TBC"/>
<Family DiskId="5000"
MediaSrcProp="Sample"
Name="Sample"
SequenceStart="5000">
<UpgradeImage SourceFile="downloads\newunpack\newVersion.msi" Id="SampleUpgrade">
<TargetImage SourceFile="downloads\oldunpack\oldVersion.msi" Order="2"
Id="SampleTarget" IgnoreMissingFiles="no" />
</UpgradeImage>
</Family>
<PatchSequence PatchFamily="SamplePatchFamily"
Supersede="yes" />
</PatchCreation>
</Wix>