1

I made a patch package with WIX, and the configuration is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Patch
      AllowRemoval="yes"
      Classification="Update"
      Comments="Patch forv.3.5.0.0"
      Description="Updates to v.3.5.1.0"
      DisplayName="Patch v.3.5.0.0-v.3.5.1.0"
      MoreInfoURL=""
      Manufacturer=""
      TargetProductName="DDD">

    <Media Id="5000" Cabinet="MyPatch.cab">
      <PatchBaseline Id="MyPatch" />
    </Media>

    <PatchFamily
        Id="MyPatchFamily"
        Version="0.0.1.0"
        Supersede="yes" >
    </PatchFamily>

    <TargetProductCodes Replace="yes">
        <TargetProductCode Id="{0498A327-4DB6-47FD-91EB-F6B6496F2547}"/>
        <TargetProductCode Id="{6318BD0F-1B46-4AA2-B490-EC33785998B6}"/>
        <TargetProductCode Id="{2FF1A3B7-B781-42EA-9AE7-4A3816621B46}"/>
    </TargetProductCodes>

  </Patch>
</Wix>

After my first installation, the version information was updated, but the files were not.
Then I uninstalled the patch and reinstalled the patch pack, and it worked.
By comparing the two installation records, I captured the following different places.

This is the log for the first installation

MSI (s) (A8:28) [09:05:01:778]: Executing op: FileCopy(SourceName=ihji0quu.con|DVStudio.exe.config,SourceCabKey=fileEE54A590D2CC2AE8647D5A5EB2C37313,DestName=DVStudio.exe.config,Attributes=4608,FileSize=5001,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=2020519154,HashPart2=1152590171,HashPart3=-1283096050,HashPart4=229789553,,)
MSI (s) (A8:28) [09:05:01:779]: File: C:\Program Files (x86)\DIAView\DVStudio.exe.config;   Won't Overwrite;    Won't patch;    Existing file is unversioned but modified

This is the log for the second installation

MSI (s) (A8:D4) [09:06:04:078]: Executing op: FileCopy(SourceName=ihji0quu.con|DVStudio.exe.config,SourceCabKey=fileEE54A590D2CC2AE8647D5A5EB2C37313,DestName=DVStudio.exe.config,Attributes=4608,FileSize=5001,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=2020519154,HashPart2=1152590171,HashPart3=-1283096050,HashPart4=229789553,,)
MSI (s) (A8:D4) [09:06:04:079]: File: C:\Program Files (x86)\DIAView\DVStudio.exe.config;   Overwrite;  Won't patch;    Existing file is unversioned and unmodified - hash doesn't match source file
MSI (s) (A8:D4) [09:06:04:079]: Source for file 'fileEE54A590D2CC2AE8647D5A5EB2C37313' is compressed
InstallFiles: File: DVStudio.exe.config,  Directory: C:\Program Files (x86)\DIAView\,  Size: 5001
MSI (s) (A8:D4) [09:06:04:081]: Re-applying security from existing file.
MSI (s) (A8:D4) [09:06:04:083]: Verifying accessibility of file: DVStudio.exe.config
MSI (s) (A8:D4) [09:06:04:084]: Using source file security for destination.
MSI (s) (A8:D4) [09:06:04:085]: Note: 1: 2318 2: C:\Config.Msi\8ba0779.rbf 

Why is that?

Garry.Gu
  • 51
  • 6
  • Well, I'd say, that DVStudio.exe.config was modified (manually by user or by application it self) before 1st installation. And while the uninstallation of the patch this file was reverted to the initial state. And on the second installation this file could be updated. – Vadim Jun 15 '20 at 07:36
  • Yes, the DVStudio. exe. config file is modified after installation. However, I later modified another 2 dlls, but still failed to replace them. – Garry.Gu Jun 15 '20 at 08:21
  • Patch updates assemby with the specific version x.y.z to the specific version x.y.z1 . While uninstallation, assembly with version x.y.z1 can be rolled back to x.y.z But if you'll modify this assembly to x.y.z2 it won't be able to revert to x.y.z. The reason is - imagine patch as a delta (binary difference between two versions of an assembly x.y.z and x.y.z1) --> assembly x.y.z + delta = assembly x.y.z1, but assembly x.y.z2 - delta != assembly x.y.z . But your config file is a non-versioned file and patching works in a different way. – Vadim Jun 15 '20 at 09:20

0 Answers0