Get rid of some recursion

May 10, 2008 · Comment 

I just had a doh! moment.

In .Net the System.IO.Directory object has a GetFiles method that returns all files from a directory.
I used to pair that up with some recursion to get all files from all sub directories.
BUT, heres the doh!: GetFiles has an overload that takes a SearchOptions parameter so that it can return the sub files directly.
So go back to your old unnecessary recursive code and do it the .Net way instead.

Application launcher

December 5, 2007 · Comment 

I’m inventing a wheel today.

My current project needs to update itself over the Internet but I don’t want to have a Click Once install. The launcher will incorporate the licensing scheme I created for jsiPodFetch and most of the updating functionality from jsiPodFetch and logview4net.

The launcher might be installed via Click Once, but I think it will need a little to much privileges to run in the sandbox.

I run the launcher from the standard Program Files location where it ends up after installation. Then I create a folder under LocalApplicationData and copy the ‘real’ binaries to it. This way I can download updated files and update the application before I actually execute it. I can’t update the launcher though so I haven’t really decided how much functionality I should put in it.

Now that I think about it I could have a pluggable launcher pipeline. Just after the launcher has downloaded and extracted the package it could look for pipeline components in the assemblies it just downloaded. That way I can keep the launcher to a minimum and yet have it manage licensing and things like that.

Previously I have downloaded a new install package when I wanted to update my applications, but these users will probably not know what to do with an installer so I’d really like to keep it transparent to the user.