WiX is "programming" declaratively not procedurally.

When I first tripped across this blog entry about using Windows Work Flow to generate .wxs files, I thought it was written by Clemens Vasters.  That surprised me because I imagined (having never actually met him) Clemens as being a guy that would grasp data models really well and that blog entry missed a very important distinction in the data model differences between work flow and the WiX toolset.  Well, as you can see from the two links that the blog entry was written by a different Clemens.

So, then I thought about what it was about the blog entry that bugged me.  I knew it came down to something in this statement:

WiX uses XML to define the installer packages and that’s not the way to go. XML isn’t a programming language! That’s why people are making windows applications (like InstallShield or Wise) for WiX to define the packages...

It turns out there are two things that I disagree with here.

First, XML is definitely not the way I would define a procedural language.  However, the WiX toolset is not producing a procedural executable.  The WiX toolset is building a declarative installation package.  Because the output is declarative, XML becomes a very reasonable way of representing the data.  XML is actually well suited to Windows Installer installation packages because so much of the Windows Installer data is hierarchal.

Now, I know that I often draw analogies between procedural languages' (like .cpp or .cs or .vb) compilers and linkers to the WiX toolset's compiler and linker.  However, those are really just analogies and while the metaphors work out really well the outputs from the tools are different.  The WiX toolset is more about integrating the creation of the installation packages into the typical build process than creating a procedural language to create installation packages.

You are not going to understand the Windows Installer if you do not switch from thinking procedurally to declaratively.  I think this is where the blog entry went awry.  The original goal was to create a procedural work flow to write a declarative language specification.  That would essentially serialize a procedural work flow into a declarative format with the hope that another engine (the Windows Installer) would later execute the declared data in a similar way as the original work flow.  I think Clemens realizes this half way through the blog entry and, unfortunately, ends up looking at a way to shove the whole work flow into a CustomAction.  All I can think is "Why bother?  Just run the freakin' work flow if that's what you want."  A CustomAction like that would really just create a Trojan Horse MSI package anyway.

The second issue I have with the statement is that the fact that WiX uses XML as the foundation for its language is why people are looking for GUI tools to create the .wxs files.  That's a simply logical fallacy.  There are plenty of people out there that want a GUI to do all sorts of things for them, including abstracting away the the details of the language.  However, there are other people out there that are very happy that the language is directly accessible.  Many of those "other people" are happy the language is XML (all kinds of text editors that natively support XML) while a few others have asked for a language that was a bit less verbose.

Besides, we're a bit beyond changing the native language of the WiX toolset.  The "X" in WiX stands for "XML" after all.  <smile/>

 

posted @ Friday, May 04, 2007 3:09 AM

Print

Comments on this entry:

# re: WiX is "programming" declaratively not procedurally.

Left by Christopher Painter at 5/4/2007 6:17 AM

Before MSI, setup was procedural. I remember the IS3 days when there was so little declarative capability that your Setup.Rul file(s) literally had to do all of the logic of figuring out what got installed, what disk it’s on, prompt for the disk, extract, copy, upgrade progress bar and repeat. Later versions like IS5 began to eliminate this type of work by creating concepts like File Groups and Components ( what we today call a feature ) and allowing a simple function call to do the work.

MSI was a big change from this and it’s been a good change. Still after the script generation phase, the script execution phase really is still procedural. When you talk to a developer that is not versed in MSI, they will express all requirements to you in terms of procedural concepts because this is how they deploy the application manually. They don’t think in terms of relationships that describe a COM server, they think in terms of 1) create directory 2) copy file 3) regsvr32 file. This is very evident in the VDPROJ/Installer Class world where setup becomes a `fake MSI` to just go call a bunch of procedural code to do something that could have been done declaratively.

I think XML is a fine language for WiX. I do want to be able to see it and understand it in it’s raw form, but I also want to be abstracted from it through work flow wizards for the sake of productivity. I want to be able to right click new feature and set the attributes that need to be set. Snippets and Intellisense are great, especially for those times you need to look at the XML, but generally I want to spend money on tools that automate a lot of this so I can crank out more installs and generate more revenue and/or value depending on the situation.

Going back tn the subject of declarative programming…. Several years ago I was exposed to the terms SDM and DSI. These days I’m doing allot with TFS. At the time I hoped that these concepts would eliminate the need for setup developers. Rob, you would know more about the bleeding edge here so I have a question for you:

Will there ever come a day when a tool like Visual Studio will know enough about the design of a particular software system that it can automatically generate completely functional setup packages meant to support operational requirements?

Today I write the installs for a SaaS SOA .Net based system. It’s n-Tier with a database layer, business logic layer, WinUI and WebUI layers. I’ve created pretty cool installs that fully automate the installation and configuration of these tiers. However what I really wish I could do is fully automate the creation of the actual installs. It would be nice if Visual Studio could just `auto magically` author the deployment package to deploy a web service just because a developer did something as simple as added the project to the solution and generated a deployment/operational diagram for it.

# re: WiX is "programming" declaratively not procedurally.

Left by Dmitry Pavlov at 5/4/2007 9:26 AM

I am happy with WiX and Votive which allows me to DEVELOP (not select options but write the code) the installer for my product in my native environment - Visual Studio.

I think WiX toolset is really cool tool because I can do the installer in parallel with development the product. That is great to keep both activities under one IDE. I have not seen before better tools for that...

Thanks for WiX! I like it!

# re: WiX is "programming" declaratively not procedurally.

Left by michael stuart at 5/21/2007 10:09 AM

The MSFT MSI team's reasons for not supporting managed code in MSIEXEC make sense, but not for the customer--just for Microsoft.

The lead dev cites two reasons--technical and strategic--but in truth they are the same argument. The argument is, "Installation on Windows is extremely difficult, and becoming more so and certainly not less so. Therefore only we are truly equipped to write installation software. You will have to wait until we've developed the CustomAction you require."

The RIGHT answer is "Yes, customer--you like .net so much and you've adopted it so thoroughly you'd like to write your installs in it too? We'll support that."

It's the wrong mindset at Microsoft to see CustomActions as a burden to be brought in-house. Rather, make installation on Windows easier and less fraught with nightmare exigencies; and LET people develop their own installations.

Your comment:



 (will not be displayed)


 
 
 
Please add 5 and 1 and type the answer here:
 

Live Comment Preview: