/// <summary> /// Entry point for WiX. /// </summary> protected override void Run() { this.Engine.Log(LogLevel.Verbose, "Running the custom WPF UI."); // Uncomment the following line to debug bootstrapper // Debugger.Launch(); using (var container = this.SetupCompositionContainer()) { // Get metadata from BootstrapperApplicationData.xml and add it to the log // for demonstration purposes this.bootstrapperApplicationData = new BootstrapperApplicationData(); this.Engine.Log(LogLevel.Verbose, JsonConvert.SerializeObject(this.bootstrapperApplicationData)); // Create main window with associated view model this.Engine.Log(LogLevel.Verbose, "Creating a UI."); this.installerMainWindow = container.GetExportedValue <Window>("InstallerMainWindow"); this.installerMainWindowHandle = new WindowInteropHelper(this.installerMainWindow).EnsureHandle(); // Kick off detect which will populate the view models. this.Engine.Detect(); // Show UI. if (this.Command.Display == Display.Passive || this.Command.Display == Display.Full) { this.installerMainWindow.Show(); } System.Windows.Threading.Dispatcher.Run(); this.Engine.Quit(0); this.Engine.Log(LogLevel.Verbose, "Exiting custom WPF UI."); } }
/// <summary> /// Entry point for WiX. /// </summary> protected override void Run() { this.Engine.Log(LogLevel.Verbose, "Running the custom WPF UI."); // Uncomment the following line to debug bootstrapper // Debugger.Launch(); using (var container = this.SetupCompositionContainer()) { // Get metadata from BootstrapperApplicationData.xml and add it to the log // for demonstration purposes this.bootstrapperApplicationData = new BootstrapperApplicationData(); this.Engine.Log(LogLevel.Verbose, JsonConvert.SerializeObject(this.bootstrapperApplicationData)); // Create main window with associated view model this.Engine.Log(LogLevel.Verbose, "Creating a UI."); this.installerMainWindow = container.GetExportedValue<Window>("InstallerMainWindow"); this.installerMainWindowHandle = new WindowInteropHelper(this.installerMainWindow).EnsureHandle(); // Kick off detect which will populate the view models. this.Engine.Detect(); // Show UI. if (this.Command.Display == Display.Passive || this.Command.Display == Display.Full) { this.installerMainWindow.Show(); } System.Windows.Threading.Dispatcher.Run(); this.Engine.Quit(0); this.Engine.Log(LogLevel.Verbose, "Exiting custom WPF UI."); } }