简体   繁体   English

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

[英]MSI Uninstall issue: Error 1001 -> The saved State dictionary contains inconsistent data and might have been corrupted

I need to create a few Windows Services and obviously I would like to package them in a nice installer.我需要创建一些 Windows 服务,显然我想在一个不错的安装程序中使用 package 它们。

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).我没有更改 ProjectInstaller 或 InstallActions,基本上只是插入了我自己的服务(文件监控/转换)。

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

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?任何人有一些提示?

I solved this problem by doing this:我通过这样做解决了这个问题:

  • Go to the folder installation Go到文件夹安装
  • Edit the file xxxxxxx.InstallState with notepad or an XML editor (where xxxxx is the name of your service)使用记事本或 XML 编辑器编辑文件 xxxxxxx.InstallState(其中 xxxxx 是您的服务的名称)
  • Go to ArrayOfKeyValueOfanyTypeanyType node and then to Keys node Go 到ArrayOfKeyValueOfanyTypeanyType节点,然后到Keys节点
  • Delete anyType child删除anyType子项
  • Go to the Values node and delete all anyType child Go 到 Values 节点并删除所有anyType子节点
  • Save the file and try to uninstall保存文件并尝试卸载

This works for me.这对我有用。 regards问候

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.在我的情况下,我在安装和卸载阶段将未安装添加到我的 Windows 服务安装程序中。 There were no errors after that.之后没有错误。 Hope this will help!希望这会有所帮助! Find more information on this issues here .此处查找有关此问题的更多信息。

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.我知道这是一篇旧帖子,但我在执行自定义操作之前通过调用安装程序 class 基础解决了我的问题,我不小心首先通过基础调用添加了我的代码。

Go to control panel and first repair your setup. Go 到控制面板并首先修复您的设置。 After the successful repair you will be able to uninstall.修复成功后就可以卸载了。

I had a similar issue where a Windows Installer Package (.msi) was not uninstalling as expected.我遇到了类似的问题,Windows 安装程序 Package (.msi) 没有按预期卸载。 The workaround for me was to use the command line to uninstall using InstallUtil.exe.我的解决方法是使用命令行使用 InstallUtil.exe 进行卸载。 Then, reinstall the service using InstallUtil.exe.然后,使用 InstallUtil.exe 重新安装该服务。 After, I was finally able to use an old msi to uninstall.之后,我终于能够使用旧的 msi 进行卸载。 After I uninstalled using the old MSI, I was able to use a NEW msi to install and everything worked as desired.使用旧的 MSI 卸载后,我可以使用新的 msi 进行安装,一切都按预期工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows服务错误:SavedState词典不包含预期值,并且可能已损坏 - Windows service error: the savedState dictionary does not contain the expected values and might have been corrupted 错误:此页面的状态信息无效,并且可能已损坏 - Error: The state information is invalid for this page and might be corrupted ObjectContext可能处于不一致状态 - The ObjectContext might be in an inconsistent state 错误:“该页面的状态信息无效,并且可能已损坏。” - Error : “The state information is invalid for this page and might be corrupted.” 错误:意外的流结束。 数据可能已损坏 - Error: Unexpected end of stream. Data might be corrupted MasterPage LinkBut​​ton单击显示错误:此页面的状态信息无效,可能已损坏 - MasterPage LinkButton Click showing error :The state information is invalid for this page and might be corrupted MSI Windows Installer中出现“歧义匹配”错误1001 - “Ambiguous Match Found” Error 1001 in MSI Windows Installer “...更新对象上下文时发生错误。 ObjectContext可能处于不一致状态......“ - “… an error occured while updating the object context. The ObjectContext might be in an inconsistent state…” 使用OpenXML打开Excel工作表时文件包含损坏的数据错误 - File contains corrupted data error when opening Excel sheet with OpenXML 关闭可能尚未初始化的SqlDataReader - Closing An SqlDataReader that might not have been initialized
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM