MSI 未在 .NET 安装项目中运行当前版本的代码
我不确定发生了什么,但我的安装程序处于一种奇怪的状态 - 当我安装 MSI 时,它似乎没有运行当前版本的代码(我正在使用自定义操作)。我通过放置一些 MessageBox.Shows 来验证它,果然,它们没有弹出。
我之前可能有过几次不成功的安装,这可能使安装程序处于不良状态......但是我该如何解决这个问题呢?
谢谢...
I'm not sure what happened, but my installer is in a weird state--when I install my MSI, it doesn't seem to be running the current version of the code (I'm using Custom Actions). I verified it by placing some MessageBox.Shows and sure enough, they are not popping up.
It's possible I may have had a few unsuccessful installs previously which may have put the installer in a bad state...but how do I go about resolving this?
Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您认为您正在运行 .msi 代码的较旧副本,解决此问题的最佳方法是删除 %temp% 目录中的所有文件(在 Windows 资源管理器地址栏中键入“%temp%”,您将看到该目录的内容并删除所有内容,然后重试。)
If you think you are running older copies of your .msi code, the best way to resolve it is to delete all files from your %temp% directory (type "%temp%" in the windows explorer address bar and you'll see the contents of this directory and delete everything, then try again.)
您不应期望 MessageBox.Show 在 .NET 自定义安装程序操作中工作。这些操作在 Windows Installer 服务的上下文中运行,该服务不在交互式桌面上运行。如果要调试自定义操作,请尝试记录到事件日志(或不依赖于当前 Windows 桌面且不需要管理或当前用户安全令牌的任何其他 I/O 操作)。
You shouldn't expect MessageBox.Show to work in a .NET custom installer action. Those actions run in the context of the Windows Installer service, which doesn't run on the interactive desktop. Try logging to the event log (or any other I/O operation that doesn't depend on the current windows desktop and doesn't require an administrative or current-user security token) if you want to debug your custom action.