December 2009 Blog Posts

Martin Rothschink from Home Server Blog has released version 1.0 of his Lights-Out Add-in. Lights-Out is a Wake-on-LAN and power management Add-in for Windows Home Server, and has been extremely popular. Martin also performed the German localization of Disk Management for us.

The new Lights-Out 1.0 UI looks slick, and there are a number of new features:

  • Support for non WHS clients like Macs, Xbox, streaming clients
  • Support for process, file, CPU and network load monitoring
  • Scheduled wake-up, backups and a client option to shut down after backup
  • Localized for English, German, French, Spanish and Chinese

The most interesting part, for me, is this section at the bottom of the page:

License
Lights-Out is available in 2 editions:

  • a free community edition
  • a licensed edition

After installation you can evaluate Lights-Out for a period of 30 days. After evaluation you need either a license to get access to all features or be satisfied with the community edition.

A license can be ordered from within Lights-Out.

Personal license €15.00 + VAT (approx. $23.90)

Commercial license €25.00 + VAT (approx. $39.90)

A license includes all updates for the 1.x range (from 1.0.x to 1.9.9).

I’ve put many hours of development into LightsOut. If you’re satisfied and save energy, I ask for a contribution by paying for a license to support the future development of LightsOut. Thanks!

I whole-heartedly support Martin in this – at some point (given that most of us have day jobs), the code needs to start making a contribution to the family grocery budget or it’s not going to get updated very often. I’m very glad to see that Martin decided to keep going with Lights-Out in this way.

The comments I’ve seen about the addition of a paid version have all been positive. The free version has all the features of the previous releases, and the licensed addition has added functionality that I’ve seen a number of requests for.

I look forward to hearing from Martin how successful this model is. The more high-quality Add-ins we have in the community, the better the overall Windows Home Server user experience will become.

Databases aren’t something I’ve written about on the blog – I’ve focused mostly on Windows Home Server specific development techniques, with some WiX goodness thrown in.

Just about every large application in existence is backed by some sort of database, and Microsoft goodies like SQL Compact Edition mean light-weight apps are also likely to have a relational data store of some kind. There are plenty of Windows Home Server-based uses for a database.

Mindscape are a local crew (local to us here in New Zealand, at least) who build tools for developers. They’ve just released version 3.0 of their LightSpeed O/RM tool, and they’ve hammered on a lot of features and polish.

One of the most awesome bullet points is the new visual migrations framework that lets you push schema changes to your database from within Visual Studio, and put those changes them under version control. No more SQL database backups getting checked into Subversion.

I’ve only begun to play around with basic data input and output in LightSpeed, but what I’ve seen so far has been very impressive. We’ve been hunting about for something to replace LINQ to SQL in our internal development framework, and I’m starting to think we have a winner.

The express version is free, and supports up to 8 entities, so you don’t have any excuse. Go play with it.

Yes, we have an app for that!

Home Server Land is proud to announce an upcoming Windows Home Server add-in and service designed to help you discover and track useful add-ins right from within the Windows Home Server Console. Enhance your Windows Home Server experience by browsing for add-ins by category, keyword, or even by community rated popularity.

6646_2

5415.4

Looks like Alexander and the rest of the HomeServerLand crew have been busy. I’m greatly looking forward to seeing how far they go with this.

Blogger Al West has posted a review of Disk Management 1.0.9.8, including a walkthrough of importing and editing a server wireframe.

Overview

The Windows Home Server Disk Management Add-In is a very nice presentation of an important part of any Windows Home Server.  It provides a great way to see what each of your disks is contributing to the storage pool and potentially helps you decide which disk to target in the event of changing your storage configuration. 

Thanks Al!

I’m using some Power Pack 1 functionality in Disk Management v1.0.9.8, and making use of some of the SDK enhancements from Power Pack 2 in the upcoming Disk Management v1.1 release.

I’ve run into a few forum posts from users asking for help with Disk Management crashing, and sometimes it’s just because they have unknowingly installed Disk Management on a vanilla Windows Home Server with no Power Pack updates applied.

We can mitigate these issues in WiX with a very simple check, and then pop up a dialog box informing the user that they need to upgrade (or at least run Windows Update once in awhile).

Here’s the header of my current .wxs definition file:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product
    Name="Disk Management for Windows Home Server"
    Id="*"
    Manufacturer="Sam Wood - Tentacle Software"
    Version="!(bind.FileVersion.ConsoleTab)"
    Language="1033">
    <Package
      Manufacturer="Sam Wood - Tentacle Software"
      InstallerVersion="200"
      Languages="1033"
      Compressed="yes" />

    <Media Id="1" Cabinet="DiskManagementForWHS.cab" EmbedCab="yes" />

    <Property Id="WHSLogo">1</Property>
	<Condition Message="[ProductName] requires Windows Home Server. For more information, please refer to the User Guide.">VersionNT = 502</Condition>

Pretty standard, and I’ve talked about this before. The lines we care about are the Property, defined as “WHSLogo” here (used by the WHS Console to make sure this is an Add-In), and the product version Condition. The condition has to evaluate as true, or we pop that error message and don’t let the install proceed.

We’re going to add a new property, and then evaluate that property in a new condition.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product
    Name="Disk Management for Windows Home Server"
    Id="*"
    Manufacturer="Sam Wood - Tentacle Software"
    Version="!(bind.FileVersion.ConsoleTab)"
    Language="1033">
    <Package
      Manufacturer="Sam Wood - Tentacle Software"
      InstallerVersion="200"
      Languages="1033"
      Compressed="yes" />

    <Media Id="1" Cabinet="DiskManagementForWHS.cab" EmbedCab="yes" />

    <Property Id="WHSLogo">1</Property>

    <Property Id="POWERPACKVERSION">
      <DirectorySearch Id="PowerPack" Path="[ProgramFilesFolder]\Windows Home Server\">
        <FileSearch Name="HomeServer.dll" MinVersion="6.0.2029.0"/>
      </DirectorySearch>
    </Property>

    <Condition Message="[ProductName] requires Windows Home Server. For more information, please refer to the User Guide.">VersionNT = 502</Condition>
    <Condition Message="[ProductName] requires Windows Home Server Power Pack 2 or higher."><![CDATA[Installed OR POWERPACKVERSION]]></Condition>

Our new POWERPACKVERSION property performs a directory and file search, and locates HomeServer.dll. We have a minimum version of 6.0.2029.0 defined, which means our property will only be populated if both HomeServer.dll exists and is greater than our minimum version number.

Due to some potential localization issues, you should set your minimum version number to one less than the number you actually need. In Power Pack 2, HomeServer.dll is 6.0.2030.0, so I’ve set my MinVersion property to 6.0.2029.0.

You can see that I’ve also added another Condition, below the product version check. We’re actually checking two properties here, Installed and our POWERPACKVERSION. If either of these properties are true, we allow the installation (or uninstallation) to proceed.

That Installed check is key – our conditions are evaluated during install, but also during uninstall of the add-in. If the conditions don’t evaluate to true, the install or uninstall will be blocked. We want to avoid blocking the uninstallation if the user has rolled back a Power Pack update, so we let the operation continue even though the file version may be incorrect.

What does this look like in practice? Here’s a screenshot of the error message popping up and blocking the Add-In installation from completing:

image

The version numbers are easy to find. Just right-click your target assembly, in this case HomeServer.dll, and choose Properties – the version number you want will be on the Details tab in Windows 7, or the Version tab in Windows Server 2003.

You can add other checks, as well. There have been a few poorly-built Add-In installers that unintentionally remove key WHS system files when the Add-In is uninstalled. To save support headaches later, we can check that the key assemblies we depend on exist prior to install.

A couple of examples:

    <Property Id="HOMESERVERCONTROLS">
      <DirectorySearch Id="HomeServerControls" Path="[ProgramFilesFolder]\Windows Home Server\">
        <FileSearch Name="HomeServerControls.dll"/>
      </DirectorySearch>
    </Property>

    <Property Id="INTEROP">
      <DirectorySearch Id="Interop" Path="[ProgramFilesFolder]\Windows Home Server\">
        <FileSearch Name="Microsoft.HomeServer.SDK.Interop.v1.dll"/>
      </DirectorySearch>
    </Property>

    <Condition Message="[ProductName] requires one or more Windows Home Server files that are missing (HomeServerControls.dll)."><![CDATA[Installed OR HOMESERVERCONTROLS]]></Condition>
    <Condition Message="[ProductName] requires one or more Windows Home Server files that are missing (Microsoft.HomeServer.SDK.Interop.v1.dll)."><![CDATA[Installed OR INTEROP]]></Condition>

Adding these checks to your WiX installer takes only a few seconds, and adds just that extra bit of polish to your Add-In.

Hot on the heels of my health.xml post, Nigel from MediaSmartServer.net has released an Add-In that provides a browser-based view of your server’s health status.

A few weeks ago, Sam Wood highlighted a new feature that Microsoft has included in Power Pack 3 to expose the state of various components of your server. Microsoft are using the this feature to generate the content to Windows Media Center’s new Home Server Console View, and I thought it would be useful to expose these to my iPhone so I can follow up on any messages that are generated from Alex Kuretz Remote Notification Add-In.

If you’ve got a mobile device with a web browser, check out WHS Health. Nice work, Nigel.

Nick from ASoft has released his combined Newbie WHS Developer Kit, collecting a whole range of different development resources together in one place.

What I tried to do is create 1 package with all kinds of tutorials by combining them and walking you through the different steps of setting up a development environment up until the release, but also by including on how to create help files, localize an add-in, test it, [and] release it.

Lots of work went into this, I encourage any budding developers to get over to Nick’s site and check out the kit.

I’ve been playing around with .chm files today (that’s Compiled HTML Help to you and me), and I ran across a few annoying issues when launching the help file using Process.Start().

One of the members of IConsoleTab you have to implement for an Add-In is GetHelp(). The WHS Console runs whatever is in this method when the user clicks the Help button in the top right of the console window.

image

I was doing this:

public bool GetHelp()
{
	Process.Start(Path.Combine(Application.StartupPath, "DiskManagement.chm"););
	return true;
}

The problem here is two-fold.

  1. The user can click on the Help button multiple times, and launch multiple instances of my help file.
  2. If the WHS Console instance gets closed while there are still help processes lying around (if the Console is opened on the server, for example), those help processes don’t get cleaned up and the next launch of the console can show some odd behaviour.

After digging around Microsoft’s WHS code (thanks, Reflector!), I’ve found that there’s a better way to do things:

public bool GetHelp()
{
	Help.ShowHelp(consoleTabControl, Path.Combine(Application.StartupPath, "DiskManagement.chm"));
	return true;
}

The consoleTabControl is my Add-In’s main tab.

The Help class is in System.Windows.Forms, so you’ve most likely got a reference to it already. You’re passing the same .chm file path, but now the help instance is tied to a specific control. This means:

  1. The user can’t accidentally click on the Console and have the help form disappear behind everything.
  2. If the user clicks the Help button multiple times, the same instance of the help file is returned – no duplication.
  3. When the HomeServerConsole.exe process closes, so too does your help instance (if it’s still open).

Overall, much cleaner.

Search

Site Sections

Recent Posts

Archives

Post Categories

WHS Add-In Tutorial

WHS Blogs

WHS Development