How to check for cancel button in custom action without doing anything else
I kn开发者_运维百科ow 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?
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.
精彩评论