使用 Wix 执行回滚

发布于 2024-11-08 18:16:36 字数 216 浏览 5 评论 0原文

我目前正在使用 Wix 生成两个 msis,我们将它们称为 A 和 B。我将 A 安装到目录 C:\test,然后将 B 安装到同一目录。第二次安装时,某些文件将被覆盖。

那么,我该如何将 A 恢复到原来的安装状态,同时删除 B 的所有痕迹呢?我知道msis可以在msi B安装失败时进行回滚,但我读到如果安装成功,回滚脚本等将被删除。

任何帮助将不胜感激。

提前致谢。

I'm currently generating two msis using Wix let's call them A and B. I install A to a directory C:\test and then I install B to the same directory. Some of the files will be overwritten when the second installation happens.

So, how would I go about restoring A to its original installed state while removing every trace of B? I know msis can do rollbacks if for example, the installation of msi B fails, but I read that if the installation is successful, the rollback script etc is deleted.

Any help would be appreciated.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁许谁一生繁华 2024-11-15 18:16:36

我不认为你的做法是正确的。为什么您的软件包将文件安装在同一位置?它们是共享文件吗?如果是,您可以使用 Windows Installer 组件共享机制:

  • 确保这些文件在两个安装程序中使用相同的组件,
  • 当程序包 B 通过程序包 A 安装时,这些组件在两个安装程序中应具有相同的名称和 GUID
  • ,Windows Installer 将使用共享组件的引用计数
  • 原始文件不会被覆盖
  • 仅当卸载两个产品时才会删除共享组件

如果它们不是共享文件,为什么不同的文件版本使用相同的位置?

I don't think that your approach is correct. Why are your packages installing files in the same location? Are they shared files? If they are, you can use the Windows Installer component sharing mechanism:

  • make sure that these files use the same components in both installers
  • these components should have the same names and GUIDs in both installers
  • when package B installs over package A, Windows Installer will use a reference count for the shared components
  • the original files are not overwritten
  • the shared components are removed only when both products are uninstalled

If they are not shared files, why are you using the same location for different file versions?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文