I Thought He Came With You is Robert Ellison’s blog about software, marketing, politics, photography, time lapse and the occasional well deserved rant. Follow along with a monthly email, RSS or on Facebook. About 7,250,102,762 people have not visited yet so it might be your first time here. Suggested reading: Got It, or roll the dice.

WiX Tricks for Screen Savers

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:

<Custom Action="InstallSS" After="InstallFinalize"><![CDATA[NOT Installed]]></Custom>

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:

<Shortcut Id='SettingsLink' Directory='ProgramMenuDir' Name='Settings' LongName='Screen Saver Settings' WorkingDirectory='SystemFolder'   Target='[SystemFolder]rundll32.exe'        Arguments='desk.cpl,InstallScreenSaver the.scr'/>

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.

WiX, c#


Rob Mensching

Yeah, the lack of a bootstrapper has been a problem for a while. I've had a design ready for a long time, just haven't had the resources to devote to it. We're changing that in WiX v3.5. Burn (our bootstrapper) will be delivered then.

Add Comment

All comments are moderated to weed out spam. Email address is optional and is only used to display your Gravatar.