我用WIX做了一个补丁包,配置如下:
<?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>
我第一次安装后,版本信息更新了,但文件没有。
然后我卸载了补丁并重新安装了补丁包,它工作。
通过比较两个安装记录,我捕捉到了以下不同的地方。
这是第一次安装的日志
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
这是第二次安装的日志
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
这是为什么?