Saturday, October 2, 2010

Gotta keep up

I'm in the process of migrating from NAnt to do my builds to PSake. I'd integrated PowerShell 1.0 into an application in the past and wanted to integrate PS 2.0 into my build application.

I pulled out my old code and started to implement it for PS 2.0, but figured I'd check for any comments on the 'Net. You know, warnings, gotchas etc. Any way, I found out that PS 2.0 is much easier to integrate into a .Net application.

Here and here

I hadn't looked into this type of thing in years. They've made it so much easier. Now if they'd make it easier to add the required reference. (Check out the first link for the "recommended" way to add the reference)

Sunday, September 26, 2010

Wild Six Months

Wow six months between posts! It's been wild. I was on a small team that worked on a project that will allow my company to change the way it does business. (I can't say more than that right now.)

While that was going on, we were also maintaining several other systems and dealing with new legal regulations facing the intermodal industry. Writing during that time, consisted of specifications and management reports. Any blog entries would have been filled with frustration.

Over the next several weeks, I'll be writing about some of the exciting challenges and lessons I learned.

1. Subversion doesn't work well with 5 developers working on the same piece of code.
2. "Complete" requirements aren't.
3. Separating the business layer and presentation layer really is a good idea.
4. Buggy code in the hands of a user is a good thing!

Tuesday, March 16, 2010


Between his blog and the StackOverflow podcast, I've learned so much about having the right attitude!

Skill takes you just so far and then you have to learn to deal with problems. People problems and environmental ones can undo all the coding skills in the world. If you're working in a space that doesn't suit your needs, nothing is going to happen. If you don't know how to get what you need politically, nothing is going to happen.

Joel, you will be missed.

Saturday, January 23, 2010

Mercurial on IIS 5.1 (XP) in 12 easy steps

Yes, I know W7 is out, but some of us are still using XP for some things.

With the upsurge in the use of Mercurial for version control (Even Codeplex is using it), I thought it was time to give it a try. It will take some getting used to, but a distributed VCS should fit my development style well. I carry an external drive between home and work. Right now it holds my latest code. I have to remember to commit the changes occasionally and don't always do so in a timely manner. Also, if I want to go back to an earlier version, I have to do it at work (instead of my home office when I really need it)

There are several pages showing how you can install Mercurial or HG, but my searching found none showing a straightforward "get it done set" of directions. Here's my instruction book. I've done this several times and found no issue. If you find a difference in your install, please let me know.

On with the show:
1. Install Python 2.5 - don't argue. don't resist. Mercurial is built with 2.5. Anything else WILL break it. (

2. Download and install Mercurial ( (Select the Windows installer)

3. Clone the Mercurial repository - you'll need some of the source code
hg clone

Create a folder to hold all the mercurial scripts
mkdir c:\hg_iis

5. Create a folder to hold your repositories (mkdir c:\hg_repos)

6. Create a virtual folder in IIS
  • Name it HG
  • Local path = c:\hg_iis
  • Execute permissions = Scripts and Executables
  • Click the configuration button
  • Click on the mappings tab
  • click the add button
  • In the Executable field enter c:\Python25\python.exe -u "%s"
  • In the Extension field enter .cgi
  • Under Verbs select All Verbs
  • Check Script engine
  • DO NOT Check Check that file exists
  • Click OK
  • Click OK
  • Click OK

7. copy the web page script to your IIS directory
copy c:\hg\hgwebdir.cgi c:\hg_iis

8. Change directories c:\program files\mercurial and unzip the file to c:\hg_iis. If you have problems with the .zip file download and run unzip.exe from ( as pointed to by Selenic's site)

9. Copy the templates
copy C:\Program Files\Mercurial\Templates c:\hg_iis\Templates

10. In a text editor open hgwebdir.cgi and edit the last few lines

application = hgwebdir('hgweb.config')

import os
os.environ["SCRIPT_NAME"] = '/hg/hgwebdir.cgi'
os.environ["REQUEST_URI"] = os.environ["SCRIPT_NAME"]

if os.environ.has_key("PATH_INFO"):
os.environ["REQUEST_URI"] += os.environ["PATH_INFO"]
if os.environ.has_key("QUERY_STRING"):
os.environ["REQUEST_URI"] += "?" + os.environ["QUERY_STRING"]

application = hgwebdir('hgweb.config')

(indentation is important)

11. In a text editor edit or create the file hgweb.config
# Mercurial web interface config file
# To add a repository to be published, add an entry here for it.

/ = /HG_Repos/**

style = coal

12. Now, open a browser and navigate to http://localhost/hg/hgwebdir.cgi

13. (optional) Download and install TortoiseHG