July 26, 2009

Maybe I Should Roll My Own Part II

Just over a year ago I played around with .NET object serialization for a day and came up with a simple little program that could build a WiX element tree, set the attributes and write the XML out. I blogged about it here.

Since then I've taken a .NET 3.5 / WCF / WPF / LINQ class and I now realize that LINQ to XML is perfect for this task. For example, consider the simple example of a tool that can switch between designer view and xml view. It can all be done in 10 simple steps:

1) Create a couple of tab pages. Put your designers on one and a richtext box on another.
2) Use XElement.Load() to load the WiX document into an in memory object model.
3) Use XElement.ToString() and pass it off to the RichTextBox.
4) Create an event handler and wire it up to the XElement changd event so that any time something changes in the object model you can refresh the XML view.
5) Use LINQ to query the object model and feed the data into your UI components.
6) Use your UI components to manipulate the objects using LINQ.
7) Wire up the RichTextBox TextChanged event to refresh your UI if the XML changes.
8) Use XElement.Save() to save your changes.
9) Use visual studio integration to wire the tool up to Votive. The concept is to not reinvent the wheel. Just edit the WXS/WXI files out of process and let votive reload the documents after you save your changes.
10) Profit! ( Sorry, Slashdot joke )

Sure, there's a lot of work to do it all correctly but the basic pattern is actually quite simple. So here's a couple screenshots of a (mostly working) program I was able to write in one day.



July 10, 2009

Austin meets Heat


Whew it's been hot in Texas lately. AFAIK it's been 100f+ for the last several weeks with no end in sight. Accordign to weather data, the max temp for last month was 106f with an average of 99f and a min of 90f. This month we are tracking for 106f, 102f and 93f. Whew.

So what does this have to do with setup? Well, I've been playing with WiX's Heat a lot lately. I got tired of running heat from a command prompt and then repeating my same cleanup tasks over and over so I decided to automate it a little with a C# winforms application. While I was at it, I added an interesting feature that I thought was a bit gimmicky at first until I started getting feedback on how cool it was.

What did I add? Simple: a FileSystemWatcher that monitors a directory for updates and then dynamically regenerates the wix document, cleans it up and then refreshes the display to show the new WiX code. With multiple monitors you just stage the dirctory on one screen while watching the program write the code for you on the other screen.

It's really a simple concept but everyone finds it quite informative. Once you have what you want you just cut and paste it into your Votive project.

So I was going to call this new tool "Blow Torch" but when I asked a coworker who is also named Chris how he liked the name he just said that he'd call it Austin.

Austin? Hmmm.... Sure, Why not? I like the sound of it.

So the hear finally destroyed our HVAC plant at work and everyone was sent home for the weekend early. This gave me a few hours to work and now I have Austin built and packaged. For now I'm just going to tease everyone with a screenshot but hopefully in a week or so I'll pass all of quality checks and release this tool for others to play with. That process might go faster if people actually bug me for a copy. ( Hint Hint! )

BTW, in case your wondering why the screenshot has a refresh button, I'm working on making it a feature to scan automatically or manually.

July 04, 2009

WiX 3.0 Ships

Wix 3.0.5419 has been promoted to Production Stable quality on SourceForge.net and can be downloaded here.

I've been fairly critical of WiX over the years but today marks a turning point in that believe. With the release of 3.0, many features are now in place that begin to make a really strong case for seriously considering the use of WiX over legacy tools. While WiX still lacks a 1st class bootstrapper/chainer and proper IDE GUI design tools that other tools have, I believe that the core foundation of WiX is much better positioned for the future.

Hopefully we'll see WiX 3.5 ( featuring Burn )in 6-12 months to address these concerns. I also hope to see Votive explode into a fully featured visual studio add-in. Finally, I expect a market of WiX based designer tools to appear. Hopefully WiXAware 3.0 will be released ( and even more hopefully that it actually work! ) and I also anticipate InstallShield will eventually bring tools to market based on WiX. IMO it is inevitable and the InstallShield brand as a packaging tool will not survive if they do not.

So there it is: WiX 3.0 is shipped and I now see the road that I will travel towards over the coming months. With dozens of installers composed from hundreds of merge modules and tens of thousands of files, it'll take us awhile to get there from sure. But I am no convinced that the effort will be worthwhile.