How to Create a Patch in WiX with the different product codes

坚强是说给别人听的谎言 提交于 2019-12-08 07:34:34

问题


I use Purely WiX approach to making patches and am trying to make a single MSP work for 2 different MSI's. I have v1.1 MSI and v1.2 MSI, and plan to create an MSP using v1.2 MSI, so that the MSP can be used for both v1.1 and v1.2.

I set Validate/@ProductId='no' as its description says:

Requires that the installed ProductCode match the target ProductCode used to create the transform. The default is 'yes'.

However, it only works for v1.2. So far, the only way I was able to work was to add 2 TargetProductCode/@Id as below. Is this a bug for Validate/@ProductId? Or Is that the right way to do?

<Media Id="5000" Cabinet="RTM.cab" >
    <PatchBaseline Id="RTM" >
        <Validate ProductId='no' ProductLanguage='no' ProductVersion="Update" ProductVersionOperator='LesserOrEqual' UpgradeCode='no' />
    </PatchBaseline>
</Media>

<!-- Why do I need this when Validate/@ProductId='no'? -->
<TargetProductCodes Replace='no'>
    <TargetProductCode Id='{xxx}' />
    <TargetProductCode Id='{xxx}' />
</TargetProductCodes>

<PatchFamilyRef Id="myRollup"/>

There is a same question but both didn't work.


回答1:


I had the same issue, the Validate/@ProductId='no' doesn't seem to do much for me, unless I'm doing something wrong.

What I've found is you need to keep the ProductId the same for each update, and only change it for a major version upgrade (at which point there is no MSP to go from v1.x to v2.0, it's an upgrade install via an MSI).

Then you can build the MSP based on v1.0 and set ProductVersionOperator to GreaterOrEqual, or build it based on v1.1 and set it to LesserOrEqual, and the MSP's will work on any v1.x MSI.



来源:https://stackoverflow.com/questions/47183940/how-to-create-a-patch-in-wix-with-the-different-product-codes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!