From 0d9f877e36bdeb912e457a11c1d7e52fba7a7eb1 Mon Sep 17 00:00:00 2001 From: "oleg.shilo" Date: Wed, 19 Oct 2022 23:22:45 +1100 Subject: [PATCH] - Added sample for "Issue #1218: Dynamic custom UI sequence" --- .../Managed Setup/CustomUI.Sequence/setup.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.Sequence/setup.cs b/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.Sequence/setup.cs index bc29a3d6..7933da7f 100644 --- a/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.Sequence/setup.cs +++ b/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.Sequence/setup.cs @@ -95,13 +95,25 @@ static void Project_UILoaded(SetupEventArgs e) e.ManagedUI.OnCurrentDialogChanged += ManagedUIShell_OnCurrentDialogChanged; } + static Type LastDialog; + static void ManagedUIShell_OnCurrentDialogChanged(IManagedDialog obj) { + var prevDialog = LastDialog; + LastDialog = obj.GetType(); + if (obj.GetType() == Dialogs.Licence) + { // Simulate analyzing the runtime conditions with the message box. // Make a decision to jump over the dialog in the sequence if (MessageBox.Show("Do you want to skip 'Licence Dialog'?", "Wix#", MessageBoxButtons.YesNo) == DialogResult.Yes) - obj.Shell.GoNext(); + { + if (prevDialog == Dialogs.Welcome) + obj.Shell.GoNext(); + else + obj.Shell.GoPrev(); + } + } } static void CheckCompatibility(SetupEventArgs e)