Over the last week I've been working on some core components to the WixStudio project. I thought I'd give a status update to whomever is interested.
WixDom
As I dug around the wix namespace trying to understand what was going on I stumbled across the wix.cs file in the Serialize namespace within the Wix assembly. This file contains numerous class declarations that map to the Wix schema. It was an easy undertaking to get the file to open and save using XmlSerializer. I would run a Wix file using these classes and produce a model that I could use in my program. Problem was since everything was object arrays getting the classes in and out of the arrays was becoming a royal pain.
After asking around a little to make sure I wasn't missing anything, it dawned on me that I would have to create a Code DOM to make the manipulation of the Wix file easier. The Wix structure in the Serialize namespace is perfect for the Wix compiler and linker because the model contained within the file will be static for the duration of the compile/linking stages of Wix but trying to use the model in a GUI program where the model is not yet finalized was going to be a nightmare.
So what I've been doing this past week is refactoring the Wix model from Serialize/Wix.cs into a Code DOM to make the manipulation of the model easier. When the model is finished, or whenever the developer saves the model, the model will be saved to a proper Wix formatted file that can be read by an XmlSerializer or by the Wix tools.
The major undertaking was to create collections for almost every classes used in the Wix namespace and for each class to change all the array properties to collections. This allows me to use standard notation to add new objects to a given node within the model. The additional benefit is that by having it as a Collection, I can now use this as a DataSource to any of the WinForms controls that I'll use in the WixStudio application.
Take for example the UI class. It has children that are UIText classes. In the Serialize namespace these are stored in the UI Items object array but in the Code DOM they are stored in the UI's UITexts property which stores it's values in a simple StringCollection. Now because it's stored in a StringCollection I can now load the collection in a DataGrid for easy editing.
Another major problem with the Wix Serialize namespace is that all objects only have fields and not properties. By not having the objects use properties, we loose the ability to have automatic data binding support. I've solved this in the Wix Dom by having every class have properties for everything that was a field within the Serialize namespace.
GUI
The other aspect of the WixStudio project that I've been working on is getting the GUI framework fleshed out to make it easier to edit Wix files. Along this line I have a Designer surface that I'm creating that will allow you to open/create Dialog objects, drop some supported MSI controls on the Dialog surface and have this Dialogs show during the installation process.
I will also create some template Dialogs and allow for others to create their own Dialog templates that you can add to your own setup programs. If you think they are important enough or have a widespread need then let me know and we can discuss getting them into the WixStudio project.
Final Thoughts
I know you all are wanting to see what the tool will look like but there is a lot of code to write just to get the project to a runnable state. I'm not going to wait until the program supports all options, that will be too long of a wait, but I do want the ability to at least make adding files, directories and Dialogs easier to perform. Keep in mind that it won't support every option that Wix supports but over time I hope that I or other contributors can add more and more supported features to the program.