为什么 MSI 需要原始 .msi 文件才能继续卸载?

编程入门 行业动态 更新时间:2024-10-24 07:31:20
本文介绍了为什么 MSI 需要原始 .msi 文件才能继续卸载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

正如大多数人可能注意到的那样,在卸载 MSI 包时,Windows 会要求提供原始的 .msi 文件.这是为什么?

As most of you probably noticed, when uninstalling an MSI package Windows will ask for the original .msi file. Why is that?

我只能看到它的缺点:

  • 无法适应网络变化.
  • 对本地磁盘更改没有弹性.
  • 用户出乎意料.
  • 通常要求用户离开办公桌并开始讨伐以获取正确的 CD.
  • 在某种程度上证明安装不是独立的.
  • 提倡使用不安全的工具,例如 msizap.
  • 这反过来又促进了下次我只使用 zip 文件"的心态.

有人可以解释一下吗?

推荐答案

修复损坏的卸载:您可以尝试最新的 Microsoft 的 FixIt 卸载工具 如果您在卸载 MSI 时遇到问题.还有一个链接:卸载无需使用 msiexec(卸载 MSI 的多种不同方法)即可从命令行获取 MSI 文件.

Fix Broken Uninstall: You can try the newest FixIt Uninstall tool from Microsoft if you have problems uninstalling an MSI. And one more link: Uninstalling an MSI file from the command line without using msiexec (a plethora of different ways to uninstall an MSI).

更新:

这个新的支持工具(此工具现在也已弃用)如果您有需要卸载的失效 MSI 软件包(而不是过时的、弃用的、不受支持的),可以在最近的 Windows 版本上试用msizap.exe).

This new support tool (this tool is now also deprecated) can be tried on recent Windows versions if you have defunct MSI packages needing uninstall (rather than the outdated, deprecated, unsupported msizap.exe).

有些人建议使用 saschabeaumont 链接到的工具:无需 MSI 文件即可卸载.如果您尝试并有效,请务必告诉我们.该答案中的反馈表明它有效(到目前为止,我没有任何卡住的设置要测试).

Some have suggested to use the tool linked to here by saschabeaumont: Uninstall without an MSI file. If you try it and it works, please be sure to let us know. Feedback in that answer indicates that it works (I don't have any stuck setups to test with as of now).

为什么要求您提供原始安装介质?:

  • 卸载不需要原始 MSI,除非 MSI 本身设计不当 - 或者缺少缓存的 MSI(请参阅下面的详细信息).
  • 所有已安装的 MSI 文件都使用随机十六进制名称缓存在 %SystemRoot%Installer*.* 中.
  • 缓存的 MSI 文件用于任何维护、修复和卸载操作 - 并且足以在绝大多数情况下卸载案例.
  • 在某些情况下此缓存文件可能会丢失,然后在某些情况下根本无法卸载 (有关为什么会发生这种情况的一些理论 - MSI 设计错误、反病毒隔离、系统还原、修补、开发人员系统在开发工作中处于错误状态、等...).查看下面的更多信息 - 以及强制卸载或取消注册产品的链接.
  • 原始来源仅在需要将文件复制到磁盘(用于维护安装)或 MSI 执行显式请求来解析原始来源时才需要通过标准操作 ResolveSource 或通过自定义操作(不应在正确编写的包中完成 - 我认为 MS Office 包在一天,导致每个人都去寻找他们的安装 CD/DVD).
  • 在以前的 Windows 版本中,这个缓存的 MSI 被剥离了所有的 cab,因此只包含安装程序结构,没有文件.
  • 从 Windows 7(MSI 版本 5)开始,MSI 文件现在缓存为完整大小,以避免破坏文件签名,这会影响安装程序启动时的 UAC 提示(a已知的 Vista 问题).这可能会导致磁盘空间消耗的巨大增加(某些系统为数 GB).查看这篇文章,尤其是底部的讨论以获取更多信息.
  • 为防止缓存巨大的 MSI 文件,您可以在安装前运行该软件包的admin-install.这就是在托管网络中正确部署的公司的工作方式,它将剥离 cab 文件,并使用一个小的 MSI 文件和其他文件创建网络安装点.请注意,在某些情况下,这可能会产生 UAC 提示,因为提取的 MSI 文件不再签名 - 这必须使用您的 SOE/桌面配置进行测试.
  • 阅读我在此线程中的回答以了解管理员安装的完整说明:使用 msiexec/a 启动管理安装的目的是什么? 或类似但可能更易于访问的答案:管理员安装及其使用
  • 在极少数情况下,可能会错误地丢失缓存的 MSI(具有随机名称),然后卸载会要求原始 MSI 以完成卸载.这种情况并不经常发生.过去,人们可以使用 MsiZap.exe 清除此类安装,但此工具已过时,已弃用和不支持.不要使用它 - 与较新的 Windows 版本有太多的不兼容,你会产生新的问题.也许试试这个支持工具 代替(也已弃用).我现在可以建议的唯一选择是来自 saschabeaumont 的这个答案.如果您尝试使用此工具,请告诉我们它是否适合您.如果您想找出可能导致缓存的 MSI 丢失的原因,请尝试在此处阅读第 12 节:不使用 msiexec 从命令行卸载 MSI 文件(简而言之,潜在原因包括干扰系统还原、防病毒和清理脚本, 错误的手动调整、磁盘空间不足、断电、开发人员框调试错误、设计不当的 MSI 文件与重复的包代码、失败的补丁等......许多理论,我担心几乎没有确定性).
  • 作为最后的手段,您可以尝试系统还原a>(除非它已被完全或部分禁用)返回到以前的安装状态,看看这是否解决了您的卸载问题(您可以在 youtube 或类似网站上找到这方面的视频演示).莉>
  • 请注意,系统还原可能会影响必须重新应用的 Windows 更新 - 以及许多其他系统设置.我见过系统还原导致的新的、无法解决的安装问题,但通常它可以正常工作.显然不要为了好玩而使用该功能,这是最后的手段,最适合回滚新驱动程序或刚刚安装并被发现会立即导致问题之类的.你回去的时间越长,你为自己创造的返工就越多.很多不言而喻的东西,但我想有必要提一下.
  • 既然我提到了系统还原,我想我应该提到最后一次正确配置功能.此功能与卸载或系统还原无关,但它是最后运行或导致系统运行的引导配置.如果系统在启动过程中出现蓝屏或停止,它可用于让您的系统再次运行.这通常发生在驱动程序安装后.不过,这不会解决您卸载失败的问题(否则我会非常感到惊讶).
  • The original MSI is not needed for uninstall unless the MSI itself is badly designed - or the cached MSI is missing (see details below).
  • All installed MSI files are cached in %SystemRoot%Installer*.* using a random hex name.
  • The cached MSI file is used for any maintenance, repair and uninstall operations - and it is sufficient for uninstall in the vast majority of cases.
  • In some cases this cached file can be missing, and then uninstall is not possible at all in some cases (some theories as to why this can happen - MSI design errors, anti-virus quarantining, system restore, tinkering, developer system in erroneous state from development work, etc...). See more info below - and links to force uninstall or unregistration of the product.
  • The original source is only needed if files need to be copied to disk (for a maintenance install), or the MSI does an explicit request to resolve the original source via the standard action ResolveSource or via a custom action (which shouldn't be done in a properly authored package - I think the MS Office package contained this ResolveSource error back in the day, causing everyone to go looking for their installation CDs/DVDs).
  • In previous editions of Windows this cached MSI was stripped of all cabs, and hence contained the installer structure only, and no files.
  • Starting with Windows 7 (MSI version 5) the MSI files are now cached full size to avoid breaking the file signature which affects the UAC prompt on setup launch (a known Vista problem). This may cause a tremendous increase in disk space consumption (several gigabytes for some systems). Check this article and especially the discussion at the bottom for more intel.
  • To prevent caching a huge MSI file, you can run an admin-install of the package before installing. This is how a company with proper deployment in a managed network would do things, and it will strip out the cab files and make a network install point with a small MSI file and files besides it. Note that this may yield a UAC prompt is some cases since the extracted MSI file is no longer signed - this must be tested with your SOE / desktop configuration.
  • Read my answer in this thread for the full description of admin installs: What is the purpose of administrative installation initiated using msiexec /a? or this similar but perhaps more accessible answer: admin install and its uses
  • In some rare cases the cached MSI (with the random name) can be erroneously missing, and uninstall will then ask for the original MSI in order to complete the uninstall. This does not happen often. It used to be the case that one could use MsiZap.exe to clean out such an install, but this tool is outdated, deprecated and unsupported. Don't use it - there are too many incompatibilities with newer Windows versions and you create new problems. Perhaps try this support tool instead (also deprecated). The only option I can suggest now is this answer from saschabeaumont. If you try this tool, please let us know if it works for you. If you want to figure out what could have caused the cached MSI to be missing, try to read section 12 here: Uninstalling an MSI file from the command line without using msiexec (in short potential causes range from interference with system restore, anti virus and cleanup scripts, to erronous manual tweaking, low disk space, power outages, developer box debugging errors, badly designed MSI files with duplicate package codes, failed patches, etc... Many theories, few certainties I am afraid).
  • As a last resort you can try system restore (unless it has been disabled entirely or partly) to go back to a previous installation state and see if this solves your uninstall problem (you can find video demos of this on youtube or a similar site).
  • Be aware that system restore might affect Windows Update that must then be re-applied - as well as many other system settings. I have seen new, unsolvable installation problems resulting from a system restore, but normally it works OK. Obviously don't use the feature for fun, it's a last resort and is best used for rollback of new drivers or setups that have just been installed and are found to cause immediate problems and such issues. The longer you go back the more rework you will create for yourself. A lot of self-evident stuff, but I guess it needs to be mentioned.
  • Since I mentioned system restore I suppose I should mention the Last Known Good Configuration feature. This feature has nothing to do with uninstall or system restore, but is the last boot configuration that worked or resulted in a running system. It can be used to get your system running again if it bluescreens or halts during booting. This often happens after driver installs. This will do nothing to fix your failing uninstall though (or I would be very surprised).

相关答案:

  • 无需 MSI 文件即可卸载

除了这个答案,也许这篇关于卸载 MSI 包的各种方法的文章也很有趣.这是一篇相当受欢迎的文章,具有高浏览量:

In addition to this answer, perhaps this article on various ways of uninstalling MSI packages is of interest. It is a rather popular article with a high number of views:

  • 在不使用 msiexec 的情况下从命令行卸载 MSI 文件.

更多推荐

为什么 MSI 需要原始 .msi 文件才能继续卸载?

本文发布于:2023-11-22 06:55:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616402.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:原始   文件   MSI   msi

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!