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
Hello

I have a custom deferred action and a rollback custom action which is in the execute sequence before that deferred one. When there is a fail returned in the deferred action the rollback custom action is executed as expected. However when I press 'Cancel' button in the Progress dialog during executing the deferred action the rollback action is not executed.

Here is the code where custom actions are added to project:
var onInstallCustomAction = new Id("OnInstallCustomActions");
project.Actions = new Action[]
{
    new ElevatedManagedAction(onInstallCustomAction, OnInstall.OnInstallCustomActions, Return.check, When.After, Step.InstallFiles, Condition.NOT_Installed)
    {
        Execute = Execute.deferred
    },
    new ElevatedManagedAction(OnUninstall.OnUninstallCustomActions, Return.check, When.Before, Step.RemoveFiles, Condition.BeingRemoved)
    {
        Execute = Execute.deferred
    },
    new ElevatedManagedAction(OnUninstall.OnRollbackCustomActions, Return.ignore, When.Before, new Step(onInstallCustomAction), Condition.Always)
    {
        Execute = Execute.rollback
    }
};
Am I doing something wrong or is something missing?

Viewing all articles
Browse latest Browse all 1354

Trending Articles