Creating MSP TeamCity Files

For the background: I have a good TeamCity setup; containing the ci build and release build that uses WiX to build my installers and fix all version numbers. When I make a new release build, I would like to automatically create MSP patches against the previous set of installers. I think that either RTM is tagged in TeamCity, or as a list of version numbers.

The approach I'm leaning towards is to create a separate configuration and get the msi artifacts of all previous collections that match the criteria (tag or version number). The tag looks a lot neater, but I don't see anything in the documentation about how you use it?

I have a script to build the MSP patch, but it relies on a PCP file that needs to be edited in ORCA to describe the patch.

  • Regarding PCP editing, is there anything else I can use other than ORCA for editing? I was looking at switching to the WiX method here: http://wix.sourceforge.net/manual-wix3/patch_building.htm , which looks promising.
  • Does anyone know if you can access artifacts in TeamCity by tag in the same or another assembly?
  • Does anyone have another understanding of automatically creating / linking MSP patch files in TeamCity?
+3
source share
2 answers
  • You can create a .PCP file using the PatchCreation element in the WiX toolbox. This is likely to give you the flexibility you need to create customized .PCP files.

  • Sorry, do not use TeamCity.

  • Sorry, do not use TeamCity. :)

+1

:

# 2. TeamCity :

http://servername:8080/httpAuth/app/rest/buildTypes/id:bt13/builds?status=SUCCESS&tag=RTM

# 3. PatchCreation (Rob, ) WiX, . , , , , ,

teamcity , :

  • - changeme, , , .

  • -

  • - buildtypeid, querystring , buildTypeId = btXX. XX - , .

  • build repo -

teamcity :

  • MSBuild build.msbuild(. )

  • Candle patch.wxs, patch.wixobj.

  • Light 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 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>

Template.wxs, MSBuild script

<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>
+1

All Articles