Search code examples
wixburn

WiX Burn custom bootstrapper: how to preserve a value stored in e.Result?


When a user click Cancel button in my bootstrapper UI, I store Result.Cancel to e.Result in Progress event handler. But when ApplyComplete is fired, the value of e.Result in its handler is not Result.Cancel, but Result.None.

How can I preserve the value of e.Result?


Solution

  • e.Result is different for every callback, you can't preserve it. The error from ApplyComplete should be 0x80070642 (which is the HRESULT form of the Win32 error code ERROR_INSTALL_USEREXIT) if you returned Result.Cancel from a callback. You should check for that error code.