Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1354

New Post: Custom action rollback on Cancel button click

$
0
0
Thank you for reporting this.

You have just discovered the problem - canceling from Progress dialog doesn't work reliably. It does for native UI but not for managed one.

I assume you are using ManagedUI. At least it is what my testing shows that this problem happens with ManagedUI but not with native one.

ManagedUI is based on the "EmbeddedUI" hosting model implemented by MSI for the cases of completely custom UI. During the actual installation phase (when progress is displayed) the only interface UI has to the MSI runtime is the ProcessMessage method of Microsoft.Deployment.WindowsInstaller.IEmbeddedUI:
publicinterface IEmbeddedUI
{
    bool Initialize(Session session, string resourcePath, ref InstallUIOptions internalUILevel);
    MessageResult ProcessMessage(InstallMessage messageType, Record messageRecord...);
    void Shutdown(); 
}
The interface is very limited and it has no dedicated Cancel/Abort method thus Wix# simply returns MessageResult.Abort from the first ProcessMessage method after user clicks 'Cancel' button. Apparently this doesn't lead to the desired result.

What is even worse is that when ProgressDialog is displayed the session handle is no longer valid so it's not possible to call session.DoAction(<action that throws the error>) to trigger rollback indirectly.

Saying that I have came up with the work around and it seems to work reasonably well. I will make it available very soon. Just as I finish the testing.

Viewing all articles
Browse latest Browse all 1354

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>