Wix / MSI:无法卸载

发布于 2024-09-14 23:19:09 字数 381 浏览 1 评论 0原文

我为一个内部项目开发了一个 Wix 安装程序,但是完全偶然,我发现我无法在我的开发计算机上卸载该安装程序,因为我收到以下错误消息:

您尝试使用的功能所在的网络资源不可用

并且有一个对话框指向我从该功能安装的 .msi 路径。 (.msi 在那里,但是它已经被重建,所以自从我安装它以来已经发生了变化)

我对此对话框感到担忧,因为我相信 Windows Installer 跟踪已安装的 .MSI 文件,但是这个对话框似乎表明我可以通过删除、移动或更改安装程序来破坏我的卸载程序。

是这样吗?

我需要做什么才能确保我不会以这种方式破坏我的卸载程序? (我们是否需要保留计算机上安装过的所有版本的安装程序的副本?)

I've developed a Wix installer for an internal project however entirely by accident I've found that I'm unable to uninstall the installer on my development machine as I get the following error message:

The feature you are trying to use is on a network resource that is unavailable

with a dialog pointing to the path of the .msi that I installed from feature from. (The .msi is there, however is has been rebuilt and so has changed since I installed it)

I'm concerned by this dialog as I had believed that Windows Installer kept track of installed .MSI files, however this dialog seems to suggest that I can break my uninstaller by deleting, moving or changing the installer.

Is this the case?

What do I need to do to make sure that I don't break my uninstaller in this way? (Do we need to keep copies of all versions of the installer ever installed on a machine?)

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

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

发布评论

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

评论(4

萌吟 2024-09-21 23:19:09

摆脱这种情况的最简单方法是重新缓存/重新安装。构建一个未“损坏”的 MSI 新版本(无论以何种方式损坏,在这种情况下,它可能根本就没有损坏,您只需要一个新的源)。然后您使用如下命令行:

msiexec /fv path\to\your.msi /l*v i.txt

这会将您的.msi 复制到缓存的 MSI 上并进行修复。那么你就会在一个更好的地方。

The easiest way to get out of this situation is to do a recache/reinstall. Build a new version of your MSI that isn't "broken" (in whatever way it is broken, in this case, it might not really be broken at all, you just need a new source). Then you use a command line like:

msiexec /fv path\to\your.msi /l*v i.txt

That will copy your.msi over the MSI that is cached and do a repair. Then you'll be in a better place.

老旧海报 2024-09-21 23:19:09

编写安装程序的第一个痛苦教训是永远不要在自己的机器上运行安装程序。当然,直到它达到成熟点并经历了几个质量保证周期。这就是我们拥有集成实验室和虚拟机的目的。 (有一种说法是关于你不应该在自己的后院做的事情。)

也就是说,通常 MSI 卸载不需要 MSI,但在某些情况下可能需要它。例如,如果要在卸载期间调用 ResolveSource 操作,MSI 将查找 .MSI。

现在有几种方法可以摆脱这个困境:

  1. 获取您拥有的 MSI,并使用 ORCA 对其进行编辑,以匹配您安装的 MSI 的文件名、UpgradeCode、ProductCode 和 PackageCode。您应该能够通过查看 %WINDIR%\Installer 中存在的已剥离缓存 MSI 来获取所有这些信息。 CD 到该目录并执行 findstr -i -m SOMESTRING *.msi 其中 SOMESTRING 是唯一的内容,例如您的 ProductName 属性。一旦您知道缓存的 MSI 的名称,请在 Orca 中打开它以获取所需的属性。然后将这些属性放入可用的 MSI 副本中并尝试卸载。不,这不是您安装的确切 MSI,但通常足够接近。

  1. 使用前端 Windows 安装程序清理实用程序(如果您仍然有)和/或后端 MSIZAP 实用程序从 MSI 和添加/删除程序中擦除应用程序的所有信息。请注意,这实际上并不会卸载程序,因此您还必须编写脚本或以其他方式手动卸载程序的所有痕迹。

  1. 重新映像您的工作站

One of the first painful lessons of writing installs is to never run your install on your own box. Certainly not until it reaches a point of maturity and has gone through several QA cycles. This is what we have integration labs and virtual machines for. (There is a saying about things you shouldn't do in your own back yard.)

That said, normally an MSI uninstall doesn't require the MSI but there are situations where it could be required. For example if one was to call the ResolveSource action during an uninstall, MSI would then look for the .MSI.

Now there are several ways out of this pickle:

  1. Take an MSI you do have and edit it with ORCA to match to file name, UpgradeCode, ProductCode and PackageCode of the MSI that you installed. You should be able to get all of this information from looking at the stripped cached MSI that exists in %WINDIR%\Installer. CD to that directory and do a findstr -i -m SOMESTRING *.msi where SOMESTRING is something unique like your ProductName property. Once you know the name of the cached MSI, open it in Orca to get the required attributes. Then put these attributes in a copy of the MSI you have available and try to do an uninstall. No, it's not the exact MSI that you installed but usually it's close enough.

or

  1. Use the front end windows installer cleanup utility (if you still have it) and/or the backend MSIZAP utility to wipe all knowledge of the application from MSI and Add/RemovePrograms. Note, this doesn't actually uninstall the program so you'll have to also write a script or otherwise manually uninstall all traces of the program.

or

  1. Reimage your workstation
往昔成烟 2024-09-21 23:19:09

如果您确切地知道出了什么问题(开发过程中经常出现这种情况),我更喜欢打开 Windows 将用于卸载的 MSI 文件,并直接使用 Orca 等工具对其进行编辑,以修复或删除导致失败的部分。

例如:

  • 在 %WINDIR%\Installer 中找到 MSI 文件。 MSI 应是卸载失败后该文件夹中最后编辑的 MSI 文件。
  • 使用 Orca 打开 msi 文件。
  • 删除失败的部分 - 例如失败的 InstallExecuteSequence 操作,这是非典型场景。
  • 保存 msi 并关闭 Orca 以释放 msi 文件上的锁定。

If you know exactly what is wrong (which is often the case during development), I prefer to open the MSI file that Windows will use for uninstallation and edit it directly with a tool like Orca to fix or remove the part that causes the failure.

For example:

  • Locate the MSI file in %WINDIR%\Installer. The MSI should be the last edited MSI file in that folder right after you did the failed uninstallation.
  • Open the msi file with Orca.
  • Remove the failing part - for example the InstallExecuteSequence action that fails which is atypical scenario.
  • Save the msi and close Orca to release the lock on the msi file.
惯饮孤独 2024-09-21 23:19:09

1 - 您在安装过程中是否尝试过“从源代码运行”?

这是功能树中的一个选项,允许您从安装源运行某些文件。这通常与网络上的管理映像结合使用。见下图。我还没有尝试过,但我认为这可能会导致:“您尝试使用的功能位于不可用的网络资源上”(如果网络已关闭并且您正尝试卸载)。这只是一个理论,还有其他方式可能发生这种情况。

在此处输入图像描述

2 - 您是否正在运行脚本自定义操作 ?如果是这样,您是否提取到 tmp 文件夹或从安装的文件或二进制表运行?如果是这样,自定义操作是否限制为仅在安装时运行?

3 - 您是否正在运行指向已安装文件的 EXE 自定义操作?如果是这样,该文件可能无法在网络上访问。

4 - 您的任何用户配置文件文件夹是否已重定向到网络共享?

5 - 您是否将任何内容直接安装到网络上的文件夹

还有很多其他的可能性。

1 - Have you experimented with "run from source" during installation?

This is an option in the feature tree which allows you to run some files from their installation source. This is generally combined with an admin image on the network. See image below. I haven't tried it, but I assume this could cause: "The feature you are trying to use is on a network resource that is unavailable" if the network is down and you are trying to uninstall. Just a theory, there are other ways this could happen.

enter image description here

2 - Are you running script custom actions? If so, do you extract to the tmp folder or run from installed files or the binary table? If so, is the custom action conditioned to run only on install?

3 - Are you perhaps running an EXE custom action that is pointing to an installed file? If so this file may be unreachable on the network.

4 - Are any of your userprofile folders redirected to a network share?

5 - Are you installing anything directly to a folder on the network?

There are plenty of other possibilities.

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