pyro (WiX) 增量补丁太大(与 bdiff 相比)
pyro (WiX) delta patches are too big (when compared to bdiff)
我最近在使用 pyro (WiX) 构建补丁时添加了 -delta
开关,这似乎稍微改善了大小。然而,当将差异大小与我们基于 bdiff
的旧修补程序的差异大小进行比较时,一些文件仍然比预期大得多。我深入研究了源代码,它似乎正在使用 mspatchc.dll
似乎是一个文件引起了问题:该文件的原始版本和新版本都在 100MB 左右。使用 bdiff
会产生 15KB 的差异,但 pyro -delta
使用 18MB!!
这是为什么?它是 WiX 中的错误吗?有什么方法可以改进(减小)pyro
产生的差异?
candle patch.wxs
light patch.wixobj
melt ..\old\project.msi -out old.wixpdb -pdb old\project.wixpdb -x old_bin
melt ..\new\project.msi -out new.wixpdb -pdb new\project.wixpdb -x new_bin
torch -p -xi old.wixpdb new.wixpdb -out diff.wixmst
pyro -delta patch.wixmsp -out patch.msp -t proj1 diff.wixmst
我不知道这是否真的应该是一个答案,这只是一个有根据的猜测。
我猜 bdiff 创建 仅 文件差异的差异文件,并且具有将这些差异应用到已安装文件的特殊逻辑。或者,pyro -delta 包括整个文件(如果它们不同)。
你可以通过包含一个巨大的文本文件来测试这个,然后在更改一个单词后使用 bdiff 来获得一个微小的差异,然后使用 pyro -delta 可能会让你得到一个基本上与文本文件大小相同的差异。
这更像是一种解决方法,但通过使用更多片段可以缓解此问题(至少在您需要修补相关文件之前)。例如:
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="MyApp.exe" Guid="*">
<File Id="MyApp.exe" KeyPath="yes" Source="$(var.OutputDir)\MyApp.exe" />
</Component>
<Component Id="Library.dll" Guid="*">
<File Id="Library.dll" KeyPath="yes" Source="$(var.OutputDir)\Library.dll"/>
</Component>
<Component Id="HugeLibrary.dll" Guid="*">
<File Id="HugeLibrary.dll" KeyPath="yes" Source="$(var.OutputDir)\HugeLibrary.dll" />
</Component>
</DirectoryRef>
</Fragment>
如果 HugeLibrary.dll
总是创建大增量,我们可以将它移动到 它自己的片段 这意味着它只有在明确编码时才会出现在补丁中:
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="MyApp.exe" Guid="*">
<File Id="MyApp.exe" KeyPath="yes" Source="$(var.OutputDir)\MyApp.exe" />
</Component>
<Component Id="Library.dll" Guid="*">
<File Id="Library.dll" KeyPath="yes" Source="$(var.OutputDir)\Library.dll"/>
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="HugeLibrary.dll" Guid="*">
<File Id="HugeLibrary.dll" KeyPath="yes" Source="$(var.OutputDir)\HugeLibrary.dll" />
</Component>
</DirectoryRef>
</Fragment>
所有文件仍将在安装程序中,组件组将保持不变。
<Fragment>
<ComponentGroup Id ="myapp">
<ComponentRef Id="MyApp.exe"/>
<ComponentRef Id="Library.dll"/>
<ComponentRef Id="HugeLibrary.dll"/>
</ComponentGroup>
</Fragment>
我最近在使用 pyro (WiX) 构建补丁时添加了 -delta
开关,这似乎稍微改善了大小。然而,当将差异大小与我们基于 bdiff
的旧修补程序的差异大小进行比较时,一些文件仍然比预期大得多。我深入研究了源代码,它似乎正在使用 mspatchc.dll
似乎是一个文件引起了问题:该文件的原始版本和新版本都在 100MB 左右。使用 bdiff
会产生 15KB 的差异,但 pyro -delta
使用 18MB!!
这是为什么?它是 WiX 中的错误吗?有什么方法可以改进(减小)pyro
产生的差异?
candle patch.wxs
light patch.wixobj
melt ..\old\project.msi -out old.wixpdb -pdb old\project.wixpdb -x old_bin
melt ..\new\project.msi -out new.wixpdb -pdb new\project.wixpdb -x new_bin
torch -p -xi old.wixpdb new.wixpdb -out diff.wixmst
pyro -delta patch.wixmsp -out patch.msp -t proj1 diff.wixmst
我不知道这是否真的应该是一个答案,这只是一个有根据的猜测。
我猜 bdiff 创建 仅 文件差异的差异文件,并且具有将这些差异应用到已安装文件的特殊逻辑。或者,pyro -delta 包括整个文件(如果它们不同)。
你可以通过包含一个巨大的文本文件来测试这个,然后在更改一个单词后使用 bdiff 来获得一个微小的差异,然后使用 pyro -delta 可能会让你得到一个基本上与文本文件大小相同的差异。
这更像是一种解决方法,但通过使用更多片段可以缓解此问题(至少在您需要修补相关文件之前)。例如:
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="MyApp.exe" Guid="*">
<File Id="MyApp.exe" KeyPath="yes" Source="$(var.OutputDir)\MyApp.exe" />
</Component>
<Component Id="Library.dll" Guid="*">
<File Id="Library.dll" KeyPath="yes" Source="$(var.OutputDir)\Library.dll"/>
</Component>
<Component Id="HugeLibrary.dll" Guid="*">
<File Id="HugeLibrary.dll" KeyPath="yes" Source="$(var.OutputDir)\HugeLibrary.dll" />
</Component>
</DirectoryRef>
</Fragment>
如果 HugeLibrary.dll
总是创建大增量,我们可以将它移动到 它自己的片段 这意味着它只有在明确编码时才会出现在补丁中:
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="MyApp.exe" Guid="*">
<File Id="MyApp.exe" KeyPath="yes" Source="$(var.OutputDir)\MyApp.exe" />
</Component>
<Component Id="Library.dll" Guid="*">
<File Id="Library.dll" KeyPath="yes" Source="$(var.OutputDir)\Library.dll"/>
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="HugeLibrary.dll" Guid="*">
<File Id="HugeLibrary.dll" KeyPath="yes" Source="$(var.OutputDir)\HugeLibrary.dll" />
</Component>
</DirectoryRef>
</Fragment>
所有文件仍将在安装程序中,组件组将保持不变。
<Fragment>
<ComponentGroup Id ="myapp">
<ComponentRef Id="MyApp.exe"/>
<ComponentRef Id="Library.dll"/>
<ComponentRef Id="HugeLibrary.dll"/>
</ComponentGroup>
</Fragment>