MSI 卸载问题:错误 1001 ->保存的状态字典包含不一致的数据并且可能已损坏

发布于 2024-11-19 03:58:50 字数 626 浏览 2 评论 0原文

我需要创建一些 Windows 服务,显然我想将它们打包在一个不错的安装程序中。

由于我不熟悉服务创建/安装,我基本上使用以下示例中的代码:

高级服务安装

我没有更改 ProjectInstaller 或 InstallActions,基本上只是插入我自己的服务(文件监视/转换)。

构建和编译代码工作正常:

  1. 安装程序工作,服务已安装(但未按预期启动)
  2. 我的服务本身都工作
  3. 卸载失败,指出标题中的错误

什么是非常奇怪的:

如果在卸载失败后,我运行“修复”并随后从安装文件夹中手动删除 *.Installstate,则卸载程序会神奇地工作。

这让我抓狂。

我想我可以为我的服务的潜在用户记录这个怪癖,但我不喜欢不知道到底发生了什么。

调试这类事情真的很困难(甚至不知道如何进行),而且文档非常稀缺(甚至不存在)。

有人有一些建议吗?

I need to create a few Windows Services and obviously I would like to package them in a nice installer.

Since I was unfamiliar with Service creation/installation I basically used code from the following example:

Advanced Service Installation

I did not change ProjectInstaller or InstallActions and basically just plugged my own services (File monitoring/conversion).

Building and compiling the code works A-OK:

  1. The Installer works, the services are installed (but NOT started as might be expected)
  2. My Services themselves all work
  3. The Uninstall FAILS, stating the error from the title

What is very strange:

If, after the failed uninstall, I run "Repair" and subsequently manually remove *.Installstate from the installation folder, the uninstaller magically works.

This is driving me nuts.

I guess I could just document this quirk for the potential users of my service but I don't like not knowing what is really going on.

Debugging this sort of thing is really hard (wouldn't even know how) and documentation is very scarce (non-existing even).

Anybody with some tips?

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

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

发布评论

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

评论(5

指尖凝香 2024-11-26 03:58:50

我通过这样做解决了这个问题:

  • 转到文件夹安装
  • 使用记事本或 XML 编辑器编辑文件 xxxxxxx.InstallState(其中 xxxxx 是您的服务名称)
  • 转到 ArrayOfKeyValueOfanyTypeanyType 节点,然后到 Keys 节点
  • 删除 anyType 子节点
  • 转到 Values 节点并删除所有 anyType 子节点
  • 保存文件并尝试卸载

<强>这有效 为我。问候

I solved this problem by doing this:

  • Go to the folder installation
  • Edit the file xxxxxxx.InstallState with notepad or an XML editor (where xxxxx is the name of your service)
  • Go to ArrayOfKeyValueOfanyTypeanyType node and then to Keys node
  • Delete anyType child
  • Go to the Values node and delete all anyType child
  • Save the file and try to uninstall

This works for me. regards

小情绪 2024-11-26 03:58:50

我遇到了同样的问题,我已经通过向自定义操作添加适当的条件来解决它。就我而言,我已在安装和卸载阶段将未安装添加到我的Windows 服务安装程序中。之后就没有错误了。
希望这会有所帮助!查找有关此问题的更多信息 这里

I got the same problem and I've managed to fix it by adding proper conditions to Custom Actions. In my case I've added Not Installed to my Windows Service Installer at the Install and Uninstall phase. There were no errors after that.
Hope this will help! Find more information on this issues here.

时光无声 2024-11-26 03:58:50

我知道这是一篇旧文章,但我通过在执行自定义操作之前调用 Installer 类基来解决我的问题,我不小心首先通过基调用添加了我的代码。

I Know this is an old post but I fixed my problem by calling the Installer class base prior to performing my custom actions, I accidentally added my code by the base calls first.

冷月断魂刀 2024-11-26 03:58:50

转到控制面板并首先修复您的设置。修复成功后就可以卸载了。

Go to control panel and first repair your setup. After the successful repair you will be able to uninstall.

清音悠歌 2024-11-26 03:58:50

我遇到了类似的问题,Windows 安装程序包 (.msi) 未按预期卸载。我的解决方法是使用命令行使用 InstallUtil.exe 进行卸载。然后,使用 InstallUtil.exe 重新安装该服务。之后,我终于可以使用旧的msi来卸载了。在我使用旧的 MSI 卸载后,我可以使用新的 MSI 进行安装,一切都按预期工作。

I had a similar issue where a Windows Installer Package (.msi) was not uninstalling as expected. The workaround for me was to use the command line to uninstall using InstallUtil.exe. Then, reinstall the service using InstallUtil.exe. After, I was finally able to use an old msi to uninstall. After I uninstalled using the old MSI, I was able to use a NEW msi to install and everything worked as desired.

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