ClickOnce has its own security limitations (understandbly so). If you want the full power and control of a Windows application then go with the .NET application updater component. It works like a charm and has even been used by Microsoft internally for their .NET based game (I don't remember the game name though).
Let me start by saying we offer a complete updating solution which includes:
wyUpdate handles all of the Vista/Windows 7 UAC problems and all the file permission problems that inevitably pop up when you're trying to update complex software.
That being said, if you want to build your own updater here are some tips:
A good place to start is the wyUpdate C# source code I mentioned above. You can cannibalize it and use it for your own purposes. Some of the algorithms it contains:
We also have the file specifications here.
Since being automatic is a requirement let me tell you how we do it with our AutomaticUpdater control.
We use named pipes to communicate between the standalone updater (wyUpdate) and the Automatic Updater control sitting on your program's form. wyUpdate reports progress to the Automatic Updater, and the Automatic Updater can tell wyUpdate to cancel progress, to start downloading, start extracting, etc.
This keeps the updater separate from your application.
In fact, the exact named pipes C# code we use is included in an article I wrote a little while back: Multi-process C# app like Google Chrome.
ClickOnce is my preferred method. It has some warts, but it comes with Visual Studio and works reasonably well.
ClickOnce is heavily used, but you can do what I did for a large application and try these:
Application Auto Update in VB.NET
Application Auto Update Revisited
I tinkered with the logic a bit and built what I thought was a better XML update file. Now, when I need to update the clients, I just post the new EXE files or DLL files and set the correct versions in the public XML file. My application detects the newer versions if it is older and updates itself. If you are doing this on Windows Vista, you need to prompt for administrator permissions so that Program Files can be written to (if you install there).
You can also easily convert this to C# using C#/VB.NET Converter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With