如何在自定义操作中检查取消按钮而不执行任何其他操作
我知道当我使用 ::MsiProcessMessage(hModule, INSTALLMESSAGE(INSTALLMESSAGE_INFO), ...);
将某些内容放入日志中时,我可以检查返回值是否为 IDCANCEL 并将 ERROR_INSTALL_USEREXIT 返回到 Windows 安装程序。
如何检查该返回值,而无需在日志中添加某些内容或更改进度条?
I know when I put something in the log using ::MsiProcessMessage(hModule, INSTALLMESSAGE(INSTALLMESSAGE_INFO), ...);
that I can check if the return value is IDCANCEL and return ERROR_INSTALL_USEREXIT to Windows installer.
How do I check for that return value without having to put something in the log or alter the progress bar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您描述的调用会将信息消息放入日志中。但除此之外,为什么您必须在日志中添加某些内容或更改进度条?如果您的操作需要很长时间,它应该报告进度。如果它很短并且您从不调用 MsiProcessMesssage,Windows Installer 将随后立即处理取消。唯一的问题情况是,如果您调用 MsiProcessMessage 并吞下取消而不报告它。
I believe the call you describe will place the info message in the log. But other than that, why would you have to put something in the log or alter the progress bar? If your action takes a long time, it should report progress. If it is short and you never call MsiProcessMesssage, Windows Installer will handle cancel immediately afterward. The only problem case is if you call MsiProcessMessage and swallow a cancel without reporting it.