如何从以前的非 msi 安装复制文件?
我正在将安装程序从 NSIS 更改为 MSI(使用 Wix),并且我需要将配置文件从旧安装复制到新安装,以备升级之需。
在实际安装新版本之前,我需要通过执行其卸载程序来卸载旧版本。
所以我最终得到了一组自定义操作:首先,如果应用程序正在运行,我将其停止;然后我将配置文件复制到[TempFolder]
;然后我启动旧应用程序的卸载程序;之后,我让 MSI 完成其工作,作为最后一步,我将一堆
从 [TempFolder]
复制到安装文件夹。
问题是 Microsoft Installer 5(Windows 7 和 Windows 2008 R2 之一)似乎在开始我的自定义操作之前检查文件是否存在,然后它不会复制它们。它可以与以前的 Windows Installer 版本(最高 4.5)一起正常工作。
有没有办法在我的自定义操作之后强制执行检查?或者有更好的方法来完成我概述的所有步骤?
I'm changing my installer from NSIS to MSI (using Wix) and I need to copy configuration files from the old installation to the new one in case of upgrade.
Before actually installing the new version I need to uninstall the old one by executing its uninstaller.
So I ended up with a set of custom actions: first I stop the application if it's running; then I copy the configuration files to [TempFolder]
; then I start the uninstaller of the old application; after that I let the MSI do its job and as a final step I've put a bunch of <CopyFile>
to copy from the [TempFolder]
to the installation folder.
The problem is that Microsoft Installer 5 (the one of Windows 7 and Windows 2008 R2) seems to check for the file existence before starting my custom actions and then it will not copy them. It is working fine with previous Windows Installer version, up to 4.5.
Is there a way to enforce the check after my custom actions? Or there is a better way to do all the steps I outlined?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MoveFiles 操作发生在 InstallFiles 之前。也许文件已正确复制,但 MSI 会覆盖它们。请生成日志文件以获取更多详细信息。
MoveFiles action comes before InstallFiles. Maybe the files are copied correctly but the MSI overwrites them. Please generate a log file for more details.