Friday, October 27, 2006

Generate WiX 2.0 Web Folder Fragment

This little utility grew out of need. I'm offering it up for free because it's so rough around the edges - no documentation, brute force approach, hardcoding, assumptions, etc. - you get what you paid for! It consists of a command script, a VBScript and an Xsl file - you can download it here. To use it, you also need another little utility I built which will generate a nested Xml directory listing that you can find here.

It will take an Xml directory file (from this previous utility) and generate a WiX 2.0 compatible fragment with the following features:

  1. DirectoryRef element so it can easily be referenced back to a Directory in a "controlling" WiX file.
  2. Component element for the web virtual directory with WebVirtualDir and WebApplication child elements.
  3. Component element representing the root of the web folder with a child elements for all Files found there, including both long and short names as needed.
  4. Nested Directory elements representing each of the sub folders under the root web folder (recursive) with all files.
  5. Ignores Visual SourceSafe (*.scc) files. ;)
  6. ComponentGroup element to pull together all the pieces of the web site so it can be easily referenced from a Feature (via ComponentGroupRef) in a "controlling" WiX file.

Of course, there's been limited testing (very limited, ok...I've only tested it on one project) so you may find some bugs. There's also some hardcoding and assumptions. Pay special attention near the top of the Xsl file where it's building the web virtual stuff (e.g. AllowSessions, DefaultWebSite, etc.). I didn't bother to get fancy and code for parameters.

Because of lack of time it carries a big assumption about the various artifact names - it uses the root folder name that you're building from. For example, if your web folder source is located at [C:\Inetpub\wwwroot\mywebsite] then it'll pick up "mywebsite" as the internal WiX name for the vdir, webapp, alias, etc. Finally, it picks up the auto generated GUIDs from the directory Xml ("ah, that's why he stuck them in there" ;) ) to use for component IDs and GUIDs. Therefore, this probably only has limited use as a first time tool since changing the GUIDs on each release of an MSI is generally frowned upon.

To use it simply drop the three files into your WiX build directory and invoke it from a command line: bldWebWxs "path_to_root_of_webFolder_source" wxsFilename

Hopefully, this will save you some time and get you most of the way there.


Original post

Build XML Directory Structure

I've hacked together a little VBScript utility that will generate an Xml representation of a directory structure which you can download here. I looked around for something that already did this and came across Pat Coleman's DIR2XML utility. It provided a basis for what I needed but there were a couple of things I had to tweak - it generated a "flat" listing of all files and it produced an XHTML document via an XSL transform. Pat did a lot of the heavy lifting with the recursive directory scanning and getting file version information.

My bldDirXml.vbs does the following:

  1. Generates a nested Xml containing <folder> and <file> tags.
  2. Supports a "flattened" mode [-f] which pulls the information up into attributes of the folder or file tag instead of child elements.
  3. Generates a unique id for each folder and file.

To run it, use the following command: cscript bldDirXml.vbs "folderPath" [outputFilename] [-f]

All the usual disclaimers apply - it's a pretty brute force approach, not heavily tested, your mileage may vary, hold your nose if you look at the code, etc.


Original post

Friday, October 20, 2006

Windows Live Writer Beta

Back in August, Jeff Julian posted a detailed explanation of how to configure Live Writer for posting to GWB. I had to hunt to find it again so I could install it on Vista RC2 so I figured this was worth a "link" here.

Original post

DHTML Editing Control removed in IE7+

This hasn't seen a lot of circulation (ok, I didn't pay much attention to it) and I was just bitten by it so I wanted to capture the links I found. The symptom is that using Exchange and Outlook Web Access from Vista (beta 2+) will not allow you to compose a new mail message. The DHTML ActiveX control for rich text editing doesn't get downloaded or instantiated.

This was warned about here back in June by B. Ashok on the IE blog. In there he also states "In the near future, we will also killbit the Safe for Scripting control in IE7 in Windows XP so that it will not get instantiated from the browser".

There is a critical patch for Exchange mentioned and linked to in his (her?) blog post which will correct this issue.

Also, I found a white paper on MSDN that talks about this control and ways to work around it. The white paper explains how Vista does not get the control automatically any more but that they are making available an MSI installer which will put it on Vista if you choose to manually install it.

Original post

Wednesday, October 18, 2006

WiX3 doesn't yet support COM+ installations

I found out while trying to make a COM+ installation that WiX3 doesn't yet support this. I was working on it originally with the latest WiX2 drop and ran into some difficulties (my own doing it turns out). While troubleshooting, I thought I'd give the latest 3.0 drop a try just in case some bugs had been fixed.

After backing up my *.wxs files and running them through the new wixcop using the -f switch to upgrade the schemas I received compile errors around the pubca extensions. Looking around, I found there wasn't any binaries for this in the drop. My next approach was to browse the CVS repositories thinking maybe they just weren't included in the packaging yet. Nope.

I jumped on the wix-devs mailing list and asked about the missing pubca stuff in Wix3. Kudos to Rob Mensching who responded within 30 mins. with the answer...the pubca custom action stuff has yet to be merged into the WiX3 codebase. So...if you're doing COM+ stuff you'll have to stick with WiX2 for now.

Original post

Friday, October 13, 2006

Fall in NH

Dave Burke (a.k.a "davebu") has Murray and Julie has her dogs, but down here in NH I've got Fritz and a flock of wild turkeys.

Original post