diff options
Diffstat (limited to '')
| -rw-r--r-- | src/test/dtf/EmbeddedUI/SampleEmbeddedUI.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/test/dtf/EmbeddedUI/SampleEmbeddedUI.cs b/src/test/dtf/EmbeddedUI/SampleEmbeddedUI.cs index b9cd213a..ae86dc97 100644 --- a/src/test/dtf/EmbeddedUI/SampleEmbeddedUI.cs +++ b/src/test/dtf/EmbeddedUI/SampleEmbeddedUI.cs | |||
| @@ -11,6 +11,7 @@ namespace WixToolset.Samples.EmbeddedUI | |||
| 11 | 11 | ||
| 12 | public class SampleEmbeddedUI : IEmbeddedUI | 12 | public class SampleEmbeddedUI : IEmbeddedUI |
| 13 | { | 13 | { |
| 14 | private bool isMaintenance; | ||
| 14 | private Thread appThread; | 15 | private Thread appThread; |
| 15 | private Application app; | 16 | private Application app; |
| 16 | private SetupWizard setupWizard; | 17 | private SetupWizard setupWizard; |
| @@ -46,11 +47,11 @@ namespace WixToolset.Samples.EmbeddedUI | |||
| 46 | 47 | ||
| 47 | if (String.Equals(session["REMOVE"], "All", StringComparison.OrdinalIgnoreCase)) | 48 | if (String.Equals(session["REMOVE"], "All", StringComparison.OrdinalIgnoreCase)) |
| 48 | { | 49 | { |
| 49 | // Don't show custom UI when uninstalling. | 50 | // Don't show custom UI when uninstall was specified on the command line. |
| 50 | return false; | 51 | return false; |
| 51 | |||
| 52 | // An embedded UI could display an uninstall wizard, it's just not imlemented here. | ||
| 53 | } | 52 | } |
| 53 | |||
| 54 | this.isMaintenance = session.EvaluateCondition("Installed"); | ||
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | // Start the setup wizard on a separate thread. | 57 | // Start the setup wizard on a separate thread. |
| @@ -69,6 +70,16 @@ namespace WixToolset.Samples.EmbeddedUI | |||
| 69 | } | 70 | } |
| 70 | else | 71 | else |
| 71 | { | 72 | { |
| 73 | switch (this.setupWizard.Operation) | ||
| 74 | { | ||
| 75 | case SetupOperationType.Repair: | ||
| 76 | session["REINSTALL"] = "ALL"; | ||
| 77 | break; | ||
| 78 | case SetupOperationType.Uninstall: | ||
| 79 | session["REMOVE"] = "ALL"; | ||
| 80 | break; | ||
| 81 | } | ||
| 82 | |||
| 72 | // Start the installation with a silenced internal UI. | 83 | // Start the installation with a silenced internal UI. |
| 73 | // This "embedded external UI" will handle message types except for source resolution. | 84 | // This "embedded external UI" will handle message types except for source resolution. |
| 74 | internalUILevel = InstallUIOptions.NoChange | InstallUIOptions.SourceResolutionOnly; | 85 | internalUILevel = InstallUIOptions.NoChange | InstallUIOptions.SourceResolutionOnly; |
| @@ -121,7 +132,7 @@ namespace WixToolset.Samples.EmbeddedUI | |||
| 121 | private void Run() | 132 | private void Run() |
| 122 | { | 133 | { |
| 123 | this.app = new Application(); | 134 | this.app = new Application(); |
| 124 | this.setupWizard = new SetupWizard(this.installStartEvent); | 135 | this.setupWizard = new SetupWizard(this.installStartEvent, this.isMaintenance); |
| 125 | this.setupWizard.InitializeComponent(); | 136 | this.setupWizard.InitializeComponent(); |
| 126 | this.app.Run(this.setupWizard); | 137 | this.app.Run(this.setupWizard); |
| 127 | this.installExitEvent.Set(); | 138 | this.installExitEvent.Set(); |
