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

New Post: InjectClrDialog throw exception

$
0
0
Hello, Oleg!
I have a similar question.
I created 2 CustomCLRDialogs

public partial class SQLCredentialsPage : WixCLRDialog

public partial class ChunksConfigurationPage : WixCLRDialog

create CustomActions for them:
    [CustomAction]
    public static ActionResult ShowChunksConfigurationDialog(Session session)
    {
        return WixCLRDialog.ShowAsMsiDialog(new ChunksConfigurationPage());
    }

    [CustomAction]
    public static ActionResult ShowSQLCredentialsDialog(Session session)
    {
        return WixCLRDialog.ShowAsMsiDialog(new SQLCredentialsPage(session));
    }

    Then I created custom UI with injection to it of my first custom page
public static void BuildCustomUI(Project project)
    {
        ManagedAction sqlCredentialsManagedActionDialog = new ShowClrDialogAction("ShowSQLCredentialsDialog");        
        ManagedAction chunksFolderSettingsDialog = new ShowClrDialogAction("ShowChunksConfigurationDialog");

        project.Actions = project.Actions.Add(sqlCredentialsManagedActionDialog);          
        project.Actions = project.Actions.Add(chunksFolderSettingsDialog);

        project.UI = WUI.WixUI_Common;

        var customUI = new CommomDialogsUI();

        var prevDialog = NativeDialogs.LicenseAgreementDlg;
        var nextDialog = NativeDialogs.InstallDirDlg;

        customUI.UISequence.RemoveAll(x => (x.Dialog == prevDialog && x.Control == Buttons.Next) ||
                                           (x.Dialog == nextDialog && x.Control == Buttons.Back));

        customUI.On(prevDialog, Buttons.Next, new ExecuteCustomAction(sqlCredentialsManagedActionDialog.Id));
        customUI.On(prevDialog, Buttons.Next, new ShowDialog(nextDialog, Condition.ClrDialog_NextPressed + " AND LicenseAccepted = \"1\""));
        customUI.On(prevDialog, Buttons.Next, new CloseDialog("Exit", Condition.ClrDialog_CancelPressed) { Order = 2 });

        customUI.On(nextDialog, Buttons.Back, new ExecuteCustomAction(sqlCredentialsManagedActionDialog.Id));
        customUI.On(nextDialog, Buttons.Back, new ShowDialog(prevDialog, Condition.ClrDialog_BackPressed));
        project.CustomUI = customUI;
This works great. Then, if I put my second customUI page(chunksFolderSettingsDialog) between NativeDialogs pages(for example, between NativeDialogs.InstallDirDlg and NativeDialogs.VerifyReadyDlg) this work great too. Both custom pages works. But I need run them one after another. Can I do this?

Viewing all articles
Browse latest Browse all 1354

Trending Articles



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