有关WiX(Windows Installer XML)制作补丁包的问题

Plert 2015-06-24 11:45:26
求教WiX高手!!最近在学用WiX制作安装包,在学到制作补丁包时遇到了一个不大不小的问题,具体描述如下:

使用的WiX版本为3.8
补丁包在Windows Installer的更新类型中属于只有少量文件改变或增加的种类,本人做了一个很简单的Demo,使用的一些原材料文件都是些简单html、docx等。
先打一个1.0的安装包(这个包里包含了所有原材料文件的第一版本)
主描述文件MyWebInstall6.wxs:
<?xml version='1.0' encoding='utf-8'?>
<!--升级安装包研究-->
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='MyWebsite' Id='1814ED19-D37C-4DAB-8CD7-AFD930292A82' UpgradeCode='6CD8BBF6-F3CB-4AB8-884C-3F4D977D9C62'
Language='2052' Codepage='936' Version='1.0.1' Manufacturer='Okknor li'>

<Package Id='*' Keywords='Installer' Description="LYZ's Website installer"
Comments='MyWebsite provided by Okknor li.' Manufacturer='Okknor li'
InstallerVersion='100' Languages='2052' Compressed='yes' SummaryCodepage='936' />

<Media Id='1' Cabinet='TestWiX.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="MyWebsite Installation [1]" />

<UI Id='MyInstall_UI'>
<UIRef Id='WixUI_Mondo'/>
<UIRef Id='WixUI_ErrorProgressText' />

<DialogRef Id='DBTestDlg' />

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="DBTestDlg">1</Publish>
<Publish Dialog="DBTestDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="2"><![CDATA[IsSuccess <> "1"]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="DBTestDlg">1</Publish>
</UI>

<Feature Id='Complete' Title='MyWebsite 1.0' Description='For WiX test only' Level='1' ConfigurableDirectory='INSTALLDIR'>
<ComponentGroupRef Id='RootItems' />
</Feature>
<Feature Id='Modules' Title='Modules' Description='Module Pages' Level='999' ConfigurableDirectory='INSTALLDIR'>
<ComponentGroupRef Id='ModulePages' />
</Feature>
<Feature Id='Docs' Title='Docs' Description='User help docs' Level='999' ConfigurableDirectory='INSTALLDIR'>
<ComponentRef Id='HelpDocs' />
</Feature>
</Product>

<Fragment>
<ComponentGroup Id="RootItems">
<Component Id='EntrancePage' Guid='712CE6DE-46C8-4C64-9725-E3E0B03F9846' Directory='INSTALLDIR'>
<File Id='IndexPage' Name='Index.html' Source='Index.html' KeyPath='yes' />
</Component>
<Component Id='ConfigFile' Guid='CEF0A517-8DF1-487C-87E7-B8BBC5C03207' Directory='INSTALLDIR'>
<File Id='ConfigFile' Name='config.xml' DiskId='1' Source='config.xml' />
</Component>
</ComponentGroup>

<ComponentGroup Id='ModulePages'>
<Component Id='WC' Guid='807CF614-04B3-413E-ADE6-37E69C249A76' Directory='Welcome'>
<File Id='Welcome' Name='Welcome.html' Source='Modules/Welcome/Welcome.html' KeyPath='yes' />
</Component>
<Component Id='US' Guid='9B7AF20B-52EB-46FF-A478-F72DAE8581E4' Directory='Users'>
<File Id='User' Name='User.html' Source='Modules/Users/User.html' />
</Component>
<Component Id='CA' Guid='8DAF1985-214F-426F-934E-296944499D76' Directory='Categories'>
<File Id='Category' Name='Category.html' Source='Modules/Categories/Category.html' />
</Component>
</ComponentGroup>

<Component Id='HelpDocs' Guid='4FF8D5F3-1ADD-42B8-929B-1C8CE9D073B5' Directory='Docs'>
<File Id='UserManual' Name='UserManual.docx' Source='Docs/UserManual.docx' KeyPath='yes' />
</Component>
</Fragment>

<Fragment>
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='INSTALLDIR' Name='MyWebsite'>

<Directory Id='Modules' Name='Modules'>
<Directory Id='Welcome' Name='Welcome' />
<Directory Id='Users' Name='Users' />
<Directory Id='Categories' Name='Categories' />
</Directory>

<Directory Id='Docs' Name='Docs' />

</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>

其中引用了一个自定义UI和Action,定义在一个单独的wxs中(DBTestUI.wxs),与问题无关,请看官们忽略
然后我对其中一两个html做了一些简单的修改,就权当是更新,然后参照WiX官方教程 http://wixtoolset.org/documentation/manual/v3/patching/wix_patching.html,使用torch + pyro + Patch.wxs来制作基于1.0的1.1版本升级包,Patch.wxs源码如下:
<?xml version='1.0' encoding='utf-8'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Patch AllowRemoval='yes' Manufacturer='Okknor li' MoreInfoURL='www.lyz.com'
DisplayName='MyWebsite 1.0.1 Patch' Description='Minor Update Patch' Classification='Update'>
<Media Id='5000' Cabinet='RTM.cab'>
<PatchBaseline Id='RTM' />
</Media>
<PatchFamily Id='TestWixPatchFamily' Version='1.0' Supersede='yes'>
<ComponentRef Id='US' />
<ComponentRef Id='CA' />
</PatchFamily>
</Patch>
</Wix>


就简单改动了一下User.html和Category.html,代表局部更新。
依照教程,首先得制作1.1的完整安装包,使用如下命令:
candle MyWebInstall6.wxs DBTestUI.wxs
light -ext WixUIExtension -cultures:zh-CN MyWebInstall6.wixobj DBTestUI.wixobj -out 1.1/MyWeb.msi
然后是建立transform文件:
torch -p -xi 1.0/MyWeb.wixpdb 1.1/MyWeb.wixpdb -out diff.wixmst
编译Patch.wxs:
candle Patch.wxs
light Patch.wixobj
最后使用pryo指令,生成升级安装包msp:
pryo Patch.wixmsp -out 1.1/Patch.msp -t RTM diff.wixmst

错误就在最后这一步发生了:

主要错误就是后面的那个PYRO0227,大致意思就是说并没有检测到任何文件改变,不会建立安装包。

奇了怪了,如果我是往里面添加文件的话,上述步骤可以生成升级包;但如果只是一些原有文件改变,就会出错。
求教各位WiX高手如何解决这个问题,谢谢!
...全文
390 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Plert 2015-06-27
  • 打赏
  • 举报
回复
......为什么没人呢?用WiX的人这么少?

1,978

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧