The patch pack needs to be installed twice to overwrite the file?

62 Views Asked by At

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?

0

There are 0 best solutions below