WiX Tricks for Screen Savers

Updated on Tuesday, May 26, 2020

I've been migrating my installers over to WiX. My only complaint with the WiX toolkit is that there's no bootstrapper included. This is important for installing any pre-requisites before passing control over to Windows Installer. Hopefully this will come after WiX 3.0 is released. For now, I've rolled my own bootstrapper to install .NET 2.0 if needed.

A couple of tips for screen savers. You can bring up the Windows screen saver settings using the following custom action. This is the same command that is launched when you right-click a screen saver (.scr) file and pick Install:

<CustomAction Id='InstallSS' Directory='SystemFolder' ExeCommand='rundll32.exe desk.cpl,InstallScreenSaver the.scr' Return='asyncNoWait'/>

Sequence this in InstallExecuteSequence after InstallFinalize:

You can also add a shortcut to your Program Files folder to configure the screen saver. This is really helpful for people who aren't sure how to get to the screen saver dialog from Control Panel or right-clicking the Desktop:

Unlike a shortcut to a file that you install you need to specify the Target. The example above assumes that ProgramMenuDir is the Id of your Start Menu folder. The shortcut should be in a Directory but not as a child of a File node.

Updated 2020-05-26 20:22:

It looks like something changed in Windows 10, around build 1903, that stops this from working on 64-bit systems. The screensaver will preview OK but does not start as expected (system screensavers start OK, so it's not some sort of power management problem). I could reproduce this on one box running 1909 but not another so maybe there is something else going on. The snippets above will run rundll32.exe from the SysWOW64 folder and at some point this seems to have stopped working. Changing to [System64Folder]rundll32.exe launches the System32 version which then causes the screensaver to load normally. If your screensaver is 32-bit and installed to SysWOW64 then you need a command that looks like this on a 64-bit system: [System64Folder]rundll32.exe desk.cpl,InstallScreenSaver [SystemFolder]the.scr

code, c#

The Perfect Twitter Client

Updated on Sunday, May 3, 2020

I started using bDule today after reading about it on Techcrunch. It seems to be very nearly the perfect twitter client for me - decent multi-account support, Facebook integration and reasonably snappy. Also, and this is really important for me, it's not oppressively black.

The group feature isn't quite there yet, it doesn't list all my friends and there's no way to edit a group after you create it. There's also no spell checker and getting the right layout is unnecessarily awkward. It's still in alpha so there's good reason to hope that these problems will be addressed soon.

I wonder where the name comes from. It makes me think of a certain casual game where you swap gemstones around until you're ready to chew your eyeballs out. I'm the last person to talk about puzzling software names though.

bDule is WPF/.NET3.5 so only runs on Windows XP or better. It also seems to suffer from the same creeping memory usage that plagues other desktop Twitter clients. I really wish someone would start offloading the stream into a database. I've got nearly frustrated enough with this to write my own Twitter client a couple of times, but it's not exactly an uncrowded market.

If you're a Windows tweeter give bDule a try.

Video timeout on XP and Vista (power management)

Updated on Sunday, May 3, 2020

I'm updating a screensaver so that it stops work once the monitor switches off. This seemed like a really simple requirement but it took some time to find an API that works on both XP and Vista.

My first attempt was ReadPwrScheme(). The documentation suggests using a different method on Vista - it should say so more strongly because on Vista you get back some default information that bears no relationship to reality.

Next I tried CallNtPowerInformation(). This doesn't mention any alternatives but also doesn't work on Vista. I've added comments on both MSDN pages pointing to the answer.

GetCurrentPowerPolicies() is just the ticket - it returns a wealth of information including the video timeout on AC and battery power and works on both XP and Vista.

Pinvoke.net has all the structures required but not the actual function. I've just added the C# interop signature for GetCurrentPowerPolicies().

I can't believe how frustrating finding this information has been. If you've found this post I hope it saves you a couple of hours :).

Point Reyes - Tomales Point

Updated on Sunday, May 3, 2020
Tomales Point in Google Earth

Tomales Point is a ten mile hike in Point Reyes. The trailhead is at the end of Pierce Point Road. It's my least favorite topological combination - the trail is mostly downhill on the way out and at the end you turn around and come back. It's worth it for the views of Tomales Bay and the Pacific, also for the flora and fauna along the way.

We did this hike a few years ago with my parents, thinking that we'd avoid some approaching rain. Of course the heavens opened as soon as we reached Tomales Point and it rained solidly for the five mile return leg. I remember emptying water out of boots and pockets and then steaming up the car for the two hour drive back to San Francisco.

Long-tailed Weasel
A Long-tailed Weasel at the start of the trail. It kept running away and then coming back to take another look at us. Very cute.

Rob & Gill at Tomales Point
Rob and Gill at Tomales Point. It was too windy to find a spot to get the camera to take a photo of both of us at the same time. Tomales Point looks out to Bodega Bay where The Birds was filmed.

Some sort of silver thistle thing
This plant looks like a silver thistle with a bright red flower. If you know what it is please leave a comment and let us know! Lots of people were in garden-center mode for the hike, admiring the incredible variety of spring flowers along the trail.

Turkey Vulture
A Turkey Vulture, hoping that we don't make it all the way back to the car...

Tule Elk
Tule Elk, native to California and slowly recovering from near-extinction in the late 19th century.

(9.77 miles, total elevation gain 241 feet, 3 hours, 39 minutes, average 2.67 mph, view in Google Earth, view in Google Maps.)

Hike starts at: 38.189931, -122.955497.

Lands End

Updated on Friday, February 24, 2017
Lands End

Lands End to Eagle's Point is a stunning section of the Coastal Trail. Park in or near the new lot at Point Lobos Ave and El Camino del Mar. Before or after the walk check out the ruins of Sutro Baths. I'd put some of that American Recovery and Reinvestment Act cash into rebuilding the baths, it looks like they were incredible.

Sutro Baths

If you follow the trial down the the baths then there's a short but very cool cave to explore which ends in another unique view of the pacific and the mouth of the Golden Gate.

Golden Gate Bridge

From Sutro Baths follow signs to Eagle's point. There are some very steep cliffs along the trail, so a leash is a really good idea for dogs.

Rudy & Gill on the coast trail

One worthwhile detour is to wonder down to Mile Rock Beach. It's a stony and impressively violent beach with a couple of lookouts on the way down with impressive views.

Rob & Rudy at Mile Rock Beach

(3.16 miles, total elevation gain 457 feet, 1 hours, 24 minutes, average 2.24 mph, view in Google Earth, view in Google Maps)

Hike starts at: 37.783491, -122.510793.

Buena Vista Park

Updated on Friday, February 24, 2017
Buena Vista Park in Google Earth

Buena Vista Park is a small but dramatic park above Haight-Ashbury.

Buena Vista Park

I usually start at Buena Vista Ave and Upper Terrace. Walk up the large path which meanders to a small lawn at the top of the park.

View from Buena Vista Park

From the lawn walk down through the maze of paths. It's a densely wooded park but every time you walk round a corner you're treated to a different city view peeking through the trees.

View from Buena Vista Park

(0.96 miles, total elevation gain 576 feet, 24 minutes, average 2.40 mph, view in Google Earth, view in Google Maps)

Hike starts at: 37.766248, -122.442906.

About Hikes

Updated on Sunday, May 3, 2020

Hikes indulges my passions for walking and being uncontrollably geeky. I love recording a walk and then looking at it in Google Earth. It's a great way to get context for a walk that isn't always obvious while you're wandering around.

I started the blog with a pretty complex setup. For a hike I'd take my Magellan eXplorist 500 GPS and a point and shoot digital camera (currently the excellent Canon PowerShot SD700 IS). After the hike I'd use a program I knocked up to compile stats from the GPS track log, and GPSBabel to convert the track log to Google Earth KML. Then I'd resize images and write a blog post.

This works well for longer hikes but it's a bit painful for shorter ones. I've got an AT&T Tilt phone which has a pretty decent camera and GPS built in, so over the Christmas holiday this year I wrote a tracking application for the phone. This app is now available as freeware (Catfood Tracker). As well as tracking your location it also generates a KML file and hike statistics at the end of a walk. Perfect. See Golden Gate Park Loop for a hike recorded entirely on the Tilt.

With an easier tracking option available I aim to blog about more hikes in 2009. I've also added an interactive map to the blog, which shows all the posts in Google Maps. This page is generated from the blog RSS feed, with a marker placed on the map at the first track point of each hike.

(Updated September 26, 2010: I've upgraded from the Tilt to an Android phone and so I've started using My Tracks from Google to record shorter hikes. This blog has also moved from Blogger to BlogEngine.NET. I've just written an extension to geotag posts so you'll see a Google Maps link to start of each hike at the bottom of every post (as well as some additional metadata to help locate posts in geo-aware searches).

Golden Gate Park Loop

Updated on Friday, February 24, 2017
Golden Gate Park loop in Google Earth

This gentle three mile loop is our favorite walk in the Golden Gate Park. Start at JFK and Transverse and walk down JFK to 30th Avenue. Turn right at 30th and then left onto a metaled path before you exit the path. The path takes you to Spreckels Lake.

Turtles
At Spreckels Lake it's turtles all the way down...

Walk halfway round the Lake and then head off behind the bison paddock (over 36th Avenue and then to the right of the restrooms). You'll pass one of two enclosed off-leash dog areas in the park.

Buffalo

Follow the path right round the paddock and then cross JFK at Chain of Lakes Drive. Immediately turn left on a small path that runs behind Middle Lake. This is a quiet area of the path where we've seen skunks and a lone coyote (although fortunately not at the same time). When you hit a T junction turn left and follow the path behind the angling pond and up to the Polo Fields. Keep going and you'll reach Speedway Meadow.

Rudy at Speedway Meadow

Follow the path beside Speedway Meadow back up to JFK and then on to the starting point at Transverse.

(2.80 miles, 1 hour, 6 minutes, average 2.53 mph, view in
Google Earth, view in Google Maps)

Hike starts at: 37.770814, -122.48021.

Crissy Field

Updated on Friday, February 24, 2017
Chrisy Field in Google Earth

Crissy Field, part of the Golden Gate National Parks, is a recently restored stretch of beach and parkland next to the bay. It's a very popular place to take dogs for a good swim. Currently there is a big debate about dogs in the national parks - see Dog Management at the GGNRA site and SF Dog.

If the weather is vaguely nice then the beaches at Chrissy Field get pretty packed. We go to Fort Funston most weekends, and save Chrissy Field for when the sea is too rough or (like today) when we just can't face climbing back up the sand ladder.

Alcatraz from Chrissy Field
Alcatraz

Golden Gate Bridge from Crissy Field
Golden Gate Bridge

(0.55 miles, total elevation gain 3 feet, 45 minutes, average 0.72 mph, view in Google Earth, view in Google Maps.)

Hike starts at: 37.806083, -122.450172.

Fort Funston in the rain

Updated on Sunday, May 3, 2020

(view in Google Earth).

This is the short version of our Fort Funston walk (the long version is here). Depending on the tide and the height of the sand it's sometimes not easy to get past a couple of sewage outlet pipes. Today's walk was wet with a high tide so we turned left at the bottom of the sand ladder and just walked along the beach and back. The longer version is to turn right and complete a three mile loop.



Hike starts at: 37.714211, -122.502257383333.