在Wix的重大升级中,如何让PathwaysMDF和LDF覆盖旧副本? [英] How to have PathwaysMDF and LDF overwrite old copies on a major upgrade of Wix?

查看:92
本文介绍了在Wix的重大升级中,如何让PathwaysMDF和LDF覆盖旧副本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在大型升级中,我都需要PathwaysMDF和PathwaysLDF这两个文件来替换(覆盖)旧副本.

I need both these files, PathwaysMDF and PathwaysLDF to replace (overwrite) the old copies on a major upgrade.

好的,这个WiX令我发疯.设置文件可以正常运行,但是数据库文件仍然无法正常工作!我尝试了几种方法...

Okay, this WiX is driving me crazy. The settings file works perfectly, however the database files are still not working! I have tried several approaches...

下面是使用注册表项尝试执行此操作的代码:

Here is the code attempting this with the registry key:

<Component Id="Database" Guid="1D8756EF-FD6C-49BC-8400-299492E8C65D" >
<RegistryValue Root="HKLM" Key="Software\TDR\Pathways\Database" Name="installed" Type="integer" Value="1" KeyPath="yes" />
<File Id="pathwaysMdf" Name="Pathways.mdf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.mdf" />
<File Id="pathwaysLdf" Name="Pathways_log.ldf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.ldf"/>
</Component>

这将导致保留旧的LDF文件,并在完成后根本没有 MDF文件,而不是旧文件或新文件.

This results in the old LDF file remaining, and no MDF file there at all, when completed, not the old one, nor the new one.

以下是日志中有关该尝试的内容: (完整日志位于 http://pastebin.com/a8a7uKfL )

Here is what the log says about that attempt: (complete log at http://pastebin.com/a8a7uKfL)

MSI (s) (C8:80) [09:01:51:845]: Executing op: SetTargetFolder(Folder=C:\Documents and Settings\All Users\Application Data\Pathways) MSI (s) (C8:80) [09:01:51:845]: Executing op: SetSourceFolder(Folder=1\ykpqggg9\Pathways\|CommonAppData\Pathways) MSI (s) (C8:80) [09:01:51:845]: Executing op: FileCopy(SourceName=x_gekdq7.ldf|Pathways_log.ldf,SourceCabKey=pathwaysLdf,DestName=Pathways_log.ldf,Attributes=512,FileSize=40239104,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=-403787921,HashPart2=771061375,HashPart3=-1732951415,HashPart4=-1390528611,,) MSI (s) (C8:80) [09:01:51:845]: File: C:\Documents and Settings\All Users\Application Data\Pathways\Pathways_log.ldf; Won't Overwrite; Won't patch; Existing file is unversioned but modified MSI (s) (C8:80) [09:01:51:845]: Executing op: FileCopy(SourceName=Pathways.mdf,SourceCabKey=pathwaysMdf,DestName=Pathways.mdf,Attributes=512,FileSize=156368896,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=570808063,HashPart2=-1571218748,HashPart3=-867678845,HashPart4=601212343,,) MSI (s) (C8:80) [09:01:51:845]: File: C:\Documents and Settings\All Users\Application Data\Pathways\Pathways.mdf; Won't Overwrite; Won't patch; Existing file is unversioned but modified

MSI (s) (C8:80) [09:01:51:845]: Executing op: SetTargetFolder(Folder=C:\Documents and Settings\All Users\Application Data\Pathways) MSI (s) (C8:80) [09:01:51:845]: Executing op: SetSourceFolder(Folder=1\ykpqggg9\Pathways\|CommonAppData\Pathways) MSI (s) (C8:80) [09:01:51:845]: Executing op: FileCopy(SourceName=x_gekdq7.ldf|Pathways_log.ldf,SourceCabKey=pathwaysLdf,DestName=Pathways_log.ldf,Attributes=512,FileSize=40239104,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=-403787921,HashPart2=771061375,HashPart3=-1732951415,HashPart4=-1390528611,,) MSI (s) (C8:80) [09:01:51:845]: File: C:\Documents and Settings\All Users\Application Data\Pathways\Pathways_log.ldf; Won't Overwrite; Won't patch; Existing file is unversioned but modified MSI (s) (C8:80) [09:01:51:845]: Executing op: FileCopy(SourceName=Pathways.mdf,SourceCabKey=pathwaysMdf,DestName=Pathways.mdf,Attributes=512,FileSize=156368896,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=570808063,HashPart2=-1571218748,HashPart3=-867678845,HashPart4=601212343,,) MSI (s) (C8:80) [09:01:51:845]: File: C:\Documents and Settings\All Users\Application Data\Pathways\Pathways.mdf; Won't Overwrite; Won't patch; Existing file is unversioned but modified

以下是使用伴随文件(主程序可执行文件,已版本化)尝试执行此操作的代码:

Here is the code attempting this using a companion file (the main program executable, which is versioned):

<Component Id="Database" Guid="1D8756EF-FD6C-49BC-8400-299492E8C65D" >
<File Id="pathwaysMdf" Name="Pathways.mdf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.mdf" CompanionFile="pathwaysExe" />
<File Id="pathwaysLdf" Name="Pathways_log.ldf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.ldf" CompanionFile="pathwaysExe" />
</Component>

这样做的结果是LDF文件表现良好,用新的替换了旧的文件,但是MDF文件消失了.旧的和新的都一样,不见了.

The result of this is that the LDF file behaves perfectly, replacing the old with the new, however, the MDF file is GONE. Old one and new one alike, missing.

以下是日志中有关该尝试的内容: (完整的日志位于 http://pastebin.com/gijLN5QY ):

Here is what the log says about that attempt: (complete log at http://pastebin.com/gijLN5QY):

MSI (s) (C8:F8) [09:21:55:206]: Executing op: SetCompanionParent(ParentPath=C:\Program Files\Pathways\,ParentName=Pathways.exe,ParentVersion=1.1.5.0,ParentLanguage=0) MSI (s) (C8:F8) [09:21:55:206]: Executing op: FileCopy(SourceName=Pathways.mdf,SourceCabKey=pathwaysMdf,DestName=Pathways.mdf,Attributes=512,FileSize=156368896,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,Version=pathwaysExe,,InstallMode=58982400,,,,,,,) MSI (s) (C8:F8) [09:21:55:236]: File: C:\Documents and Settings\All Users\Application Data\Pathways\Pathways.mdf; Overwrite; Won't patch; Existing file is of an equal version (Checked using version of companion: C:\Program Files\Pathways\Pathways.exe) MSI (s) (C8:F8) [09:21:55:236]: Source for file 'pathwaysMdf' is compressed InstallFiles: File: Pathways.mdf, Directory: C:\Documents and Settings\All Users\Application Data\Pathways\, Size: 156368896 MSI (s) (C8:F8) [09:21:55:246]: Re-applying security from existing file. MSI (s) (C8:F8) [09:21:55:246]: Verifying accessibility of file: Pathways.mdf MSI (s) (C8:F8) [09:21:55:266]: Note: 1: 2318 2: C:\Documents and Settings\All Users\Application Data\Pathways\Pathways.mdf MSI (s) (C8:F8) [09:21:55:266]: Note: 1: 2360 MSI (s) (C8:F8) [09:21:55:266]: Note: 1: 2360

MSI (s) (C8:F8) [09:21:55:206]: Executing op: SetCompanionParent(ParentPath=C:\Program Files\Pathways\,ParentName=Pathways.exe,ParentVersion=1.1.5.0,ParentLanguage=0) MSI (s) (C8:F8) [09:21:55:206]: Executing op: FileCopy(SourceName=Pathways.mdf,SourceCabKey=pathwaysMdf,DestName=Pathways.mdf,Attributes=512,FileSize=156368896,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,Version=pathwaysExe,,InstallMode=58982400,,,,,,,) MSI (s) (C8:F8) [09:21:55:236]: File: C:\Documents and Settings\All Users\Application Data\Pathways\Pathways.mdf; Overwrite; Won't patch; Existing file is of an equal version (Checked using version of companion: C:\Program Files\Pathways\Pathways.exe) MSI (s) (C8:F8) [09:21:55:236]: Source for file 'pathwaysMdf' is compressed InstallFiles: File: Pathways.mdf, Directory: C:\Documents and Settings\All Users\Application Data\Pathways\, Size: 156368896 MSI (s) (C8:F8) [09:21:55:246]: Re-applying security from existing file. MSI (s) (C8:F8) [09:21:55:246]: Verifying accessibility of file: Pathways.mdf MSI (s) (C8:F8) [09:21:55:266]: Note: 1: 2318 2: C:\Documents and Settings\All Users\Application Data\Pathways\Pathways.mdf MSI (s) (C8:F8) [09:21:55:266]: Note: 1: 2360 MSI (s) (C8:F8) [09:21:55:266]: Note: 1: 2360

我也尝试过仅将MDF文件设置为KeyPath ="yes",而没有CompanionFile标签.这也不起作用.

I have also tried setting just the MDF file to KeyPath="yes" without the CompanionFile tag. This also isn't working.

推荐答案

在我看来,WiX升级设计存在很大缺陷.应该发生的是,每个文件在默认情况下都应该始终替换"任何内容.出于版本控制和其他考虑,仅应考虑标记有适当属性的文件.

It sure seems to me that the upgrade design is highly flawed with WiX. What should be happening, is that each File should, by default "always replace" anything. Only files marked with an appropriate attribute should be considered for versioning and other considerations.

WiX似乎仅用于安装.exe和.dll或其他明确已知具有版本文件的文件.不幸的是,如果它实际上被设计为通用安装机制,它可以提高效率并阻止很多人浪费时间.

WiX seems to be designed for only installing .exe and .dll or other explicitly known to have a version files. That's unfortunate, because it could much more effective and stop so many people wasting their time, if it was actually designed to be a general purpose install mechanism.

这篇关于在Wix的重大升级中,如何让PathwaysMDF和LDF覆盖旧副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆