singalen: (Default)
[personal profile] singalen

Originally published at Fiberglass flowers. Please leave any comments there.

Update: for a ready solution (library), see official release announcement :)

Windows Installer on itself is a pain. WiX saves you from it, mostly wrapping the complexity into XML constructs understandable to non-gurus.

Well, not completely – you still have to know:

  • why the heck shortcut didn’t appear in start menu;
  • how to create a web site shortcut;
  • why to create RegistryValue for a program directory you create, and that’s the simplest things. Still better then MFC…

But a very good tutorial exists, maillist is very active and it’s easy to get support.
Maybe it’s another reason to love Unix-es, where “install IS just a copy”.
Though, one has to admit that installing Windows application involves somewhat more desktop integration
.

I was looking for an auto-update, so that:

  • application could say “New version available, download? Restart now?“;
  • would use MSI;
  • download should preferably use BITS.

Simple automatic updaters like this on Codeproject won’t do, because you can’t just download necessary files: Windows Installer will revert them back. Or you would have to “disable WI’s Resiliency“, which is also a bad idea.

Solution of my choice

ClickThrough subproject of WiX promises that, but it’s still beta and crashes. Still you can easily compare two MSI files, generate a MSP patch, and a RSS feed that client can check, download and even read by eye, so simple it is – a pretty tasty feature.

There is no .NET client code. For now, there is only a separate update.exe that will find, download and install new version. Still, you cannot ask user whether to download now or not, cannot tell what’s new, when to restart, etc.
But you can painlessly add a Start menu shortcut that will update your application.

Come later, I’m going to create a C# code that will check for updates, and probably publish it.

Other solutions

You can use Updater ApplicationBlock, or more exactly, latest version now lives at CodePlex. But Enterprise Library wasn’t updated for .NET 3.5, and I believe it’s abandoned.

You can use NSIS. Though, it’s not Windows Installer MSI packager, it creates own files and scripts.

For ClickOnce application, you can use Application.Deployment.

Tags: