MSI卸载问题:错误1001->保存的状态字典包含不一致的数据,并且可能已损坏 [英] MSI Uninstall issue: Error 1001 -> The saved State dictionary contains inconsistent data and might have been corrupted
问题描述
我需要创建一些Windows服务,并且显然我想将它们打包在一个不错的安装程序中.
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:
我没有更改ProjectInstaller或InstallActions,基本上只是插入了自己的服务(文件监视/转换).
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:
- 安装程序正常运行,服务已安装(但未按预期启动)
- 我的服务本身都可以正常工作
- 卸载失败,说明标题中的错误
非常奇怪的是:
如果在卸载失败后运行修复"并随后手动从安装文件夹中删除* .Installstate,则卸载程序可以正常运行.
If, after the failed uninstall, I run "Repair" and subsequently manually remove *.Installstate from the installation folder, the uninstaller magically works.
这真让我发疯.
我想我可以为服务的潜在用户记录一下这个怪癖,但是我不希望不知道发生了什么.
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).
有人提示吗?
推荐答案
我通过以下方法解决了此问题:
- 转到文件夹安装
- 使用记事本或XML编辑器(其中xxxxx是您的服务的名称)编辑文件xxxxxxx.InstallState.
- 转到
ArrayOfKeyValueOfanyTypeanyType
节点,然后转到Keys
节点 - 删除
anyType
子 - 转到值"节点,然后删除所有
anyType
子级 - 保存文件并尝试卸载
- 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 toKeys
node - Delete
anyType
child - Go to the Values node and delete all
anyType
child - Save the file and try to uninstall
这对我有用.问候
这篇关于MSI卸载问题:错误1001->保存的状态字典包含不一致的数据,并且可能已损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!