tags:

views:

136

answers:

3

I have build an C# Winforms application which will need regular updates and patches in the future. To ease the update process for the users of my app I'd like to build an web-update class that looks for an update on my site.

What would be the most secure and reliable way to implement such a class, considering:

  • The site is build in PHP / Joomla
  • I haven't the foggiest idea how to program in PHP
  • All webserver directories are read-only by default (and only writeable by an FTP account I own)

The first and so far only idea that comes up to me is to create a file on my webserver that'll never be renamed, and in it I'll define the location of the latest version and number of it. The app will then be able to download the update from that path using the WebClient class.

However, if there's anyone with a better update-class idea that doesn't require an asp.net webserver nor webservices (already tried and failed on that one), I'll be grateful.

Edit:

I've tried the ClickOnce solution suggested by Gabriel McAdams, but on application startup I experience a "ClickOnce launch utility has stopped working" crash. So I'm again looking for a solution to update an application. For the moment, the answer of Kristian Damian is the most suitable.

+3  A: 

I would look into ClickOnce Deployment.

Here is some of the text from that page:

ClickOnce deployment allows you to publish Windows-based applications to a Web server or network file share for simplified installation. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce.

Gabriel McAdams
+1 - that's exactly what I was going to say.
ChrisF
Will that work without ClickOnce security, and on a webserver without any Microsoft (.Net) support?
Webleeuw
@Webleeuw - yes it does. As far as I know the server where I have my installers doesn't have .NET support, and ClickOnce works for me. The web server is just a location to store the data. All the work is done at the client side - which will have .NET installed.
ChrisF
Check this site for an example where they use apache: http://software.clempaul.me.uk/articles/clickonce/
Gabriel McAdams
Ok, great :-). One last question though: is it a problem that I'd like to provide the original installer of my application (a VS Installer project - .msi file) via an Joomla download module instead of a direct reachable file?
Webleeuw
This might help: http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/9ed4f13a-fea4-4a5c-b388-801cabdd339b/
Gabriel McAdams
Remember to accept this answer if you found it to he helpful.
Gabriel McAdams
Of course I'll accept your answer, but I'd like to try it out first to see if ClickOnce is the solution I'm looking for. Besides, I needed some sleep first, it's 7 AM at this moment where I live :P.
Webleeuw
+2  A: 

Maybe this cant help you:

http://themech.net/2008/05/adding-check-for-update-option-in-csharp/

Kristian Damian
A: 

I developed a Windows application in C# that does updates automatically over the Internet. After much grief, mainly because at that time I had very little experinece with Web development, I purchased a product that made it easy to update the application. If it is OK with StackOverFlow and you are interested, I can give you the URL.

CiaoRoma