[wix-users] Creating patches with WiX

Vladimir Kolobkov vkolobkov at gmail.com
Wed Aug 19 05:36:23 PDT 2020


Hi Wim,

Patch can be created only between two msi packages. The original one, which
you want to upgrade. And the msi with changes which you want to provide.
The product code should be the same for both msi. Files should be in the
same components with the same id and "KeyPath="yes"" also you have to
increase the assembly version for .net assemblies.
Next you have to create patch.wxs something like this:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <PatchCreation
      Id="<%Guid of patch%>"
      CleanWorkingFolder="yes"
      OutputPath="patch.pcp"
      WholeFilesOnly="yes"
        >

    <PatchInformation
      Description="<%%>"
      Comments="<%%>"
      ShortNames="no"
      Languages="1033"
      Compressed="yes"
      Manufacturer="<%%>"/>

    <PatchMetadata
        AllowRemoval="yes"
        Description="<%%>"
        ManufacturerName="<%%>"
        TargetProductName="<%%>"
        MoreInfoURL="<%%>"
        Classification="Update"
        DisplayName="<%%>"/>

    <Family DiskId="5000"
        MediaSrcProp="Sample"
        Name="Sample"
        SequenceStart="5000">
      <UpgradeImage SourceFile="<%path to extracted msi(new one) in admin
folder%>" Id="SampleUpgrade">
        <TargetImage SourceFile="<%path to extracted msi(the old one) in
admin folder%>" Order="2"
            Id="SampleTarget" IgnoreMissingFiles="no" />
      </UpgradeImage>
    </Family>

    <PatchSequence PatchFamily="<%patch family name%>"
        Sequence="<%sequence%>"
        Supersede="yes" />

  </PatchCreation>
</Wix>

To create patch execute next commands:
msiexec /a "<%path to msi(old one)%>" /qb targetdir="<%path to extracted
msi(old one) in my case admin subfolder%>"
msiexec /a "<%path to msi(new one)%>" /qb targetdir="<%path to extracted
msi(new one) in my case admin subfolder%>"

"C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe" "<%path to
Patch.wxs%>" -out "<%path to Patch.wixobj%>"

"C:\Program Files (x86)\WiX Toolset v3.11\bin\light.exe" "<%path to
Patch.wixobj%>" -out "<%path to Patch.pcp%>"

"C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\MsiMsp.exe" -s
"<%path to Patch.pcp%>" -p "<%path to Patch.msp%>" -l "<%path to
Patch.log%>"

MsiMsp.exe can be found in the Windows SDK.

Best regards,
Vladimir Kolobkov


On Wed, 19 Aug 2020 at 10:51, Wim Brosens via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> We have a .Net application with thousands of dlls, files, ...
> We created a large WiX solution to create an msi for the installation of
> this product.
>
> Can I create a WiX patch (msp) project for one 1 (or 2) of the files in the
> msi, without creating a whole new msi for the application ? And how should
> I do this ?
>
> In the WiX documentation I found only a patch solution with pyro, needing
> to build a new MSI and creating a patch based upon the diff of the two
> msi's, which is not suitable for us because of the long build time of the
> WiX project  ...
>
> Kind regards,
> Wim Brosens
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list