I have a burn bundle with the following variable
<Variable Name="INSTALLFOLDER" Type="string "Value="[ProgramFilesFolder]" />
With the following property in my main bootstrapper UI design model
public string InstallDirectory { get { if (_Engine.StringVariables.Contains("INSTALLFOLDER")) return _Engine.StringVariables["INSTALLFOLDER"]; return string.Empty; } set { if (_Engine.StringVariables.Contains("INSTALLFOLDER")) { _Engine.StringVariables["INSTALLFOLDER"] = value; OnPropertyChanged("InstallDirectory"); } } }
In my WPF view, which has a text field associated with the InstallDirectory property, I see only "[ProgramFilesfolder]", but I was hoping to see something like "C: \ Program Files"
I would like to get something like the following, which will fill the text field of the installation directory with the default installation folder and give the user the opportunity to change it there.
<Variable Name='INSTALLFOLDER' Type='string' Value='[ProgramFilesFolder]$(var.AppName)' />
I could use the Net Framework to get the program files folder for my WPF interface, but it looks like I should get it from the Wix package. Also, the Wix log shows that I am setting the INSTALLFOLDER property from my user interface.
My bootstrapper Run looks like this:
protected override void Run() { this.Engine.Log(LogLevel.Verbose, "Run has been called on the UI application."); CurrentDispatcher = Dispatcher.CurrentDispatcher; _MainWindow = new MainWindow(new MainWindowViewModel(this)); Engine.Detect(); _MainWindow.Show(); Dispatcher.Run(); Engine.Quit(0); }
I thought that I might need to listen to some event in BootstrapperApplication, after which I can run the property changed for the InstallDirectory property, but have not found anything interesting yet.
I went through the book "Developer's Guide" for version 3.6 and did not seem to address this exact problem, although the last two chapters deal with recording projects and WPF.