MSI 卸载问题:错误 1001 ->保存的状态字典包含不一致的数据并且可能已损坏
我需要创建一些 Windows 服务,显然我想将它们打包在一个不错的安装程序中。
由于我不熟悉服务创建/安装,我基本上使用以下示例中的代码:
我没有更改 ProjectInstaller 或 InstallActions,基本上只是插入我自己的服务(文件监视/转换)。
构建和编译代码工作正常:
- 安装程序工作,服务已安装(但未按预期启动)
- 我的服务本身都工作
- 卸载失败,指出标题中的错误
什么是非常奇怪的:
如果在卸载失败后,我运行“修复”并随后从安装文件夹中手动删除 *.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:
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:
- The Installer works, the services are installed (but NOT started as might be expected)
- My Services themselves all work
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我通过这样做解决了这个问题:
ArrayOfKeyValueOfanyTypeanyType 节点,然后到
Keys
节点anyType
子节点anyType
子节点<强>这有效 为我。问候
I solved this problem by doing this:
ArrayOfKeyValueOfanyTypeanyType
node and then toKeys
nodeanyType
childanyType
childThis works for me. regards
我遇到了同样的问题,我已经通过向自定义操作添加适当的条件来解决它。就我而言,我已在安装和卸载阶段将未安装添加到我的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.
我知道这是一篇旧文章,但我通过在执行自定义操作之前调用 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.
转到控制面板并首先修复您的设置。修复成功后就可以卸载了。
Go to control panel and first repair your setup. After the successful repair you will be able to uninstall.
我遇到了类似的问题,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.