I am creating a WPF setup application with a custom user interface. I started with the tutorial of Bryan P. Johnston: http://bryanpjohnston.com/2012/09/28/custom-wix-managed
I also use this legendary tutorial. I wanted to use veriable for something else. Namely, the variable says whether the program should be installed. The problem is that the variable does not overwrite when invoke it in InstallExecute(). For my problem it work in this way:
protected override void Run()
{
this.Engine.Log(LogLevel.Verbose, "Launching custom TestBA UX");
BootstrapperDispatcher = Dispatcher.CurrentDispatcher;
MainViewModel viewModel = new MainViewModel(this);
viewModel.Bootstrapper.Engine.Detect();
MainView view = new MainView();
this.Engine.StringVariables["SqlStatus"] = view.CheckInstalledSQL() == true ? "true" : "false";
this.Engine.StringVariables["SsmsStatus"] = view.CheckInstalledSSMS() == true ? "true" : "false";
view.DataContext = viewModel;
view.Closed += (sender, e) => BootstrapperDispatcher.InvokeShutdown();
view.Show();
Dispatcher.Run();
this.Engine.Quit(0);
}
Bootstrapper:
...