Skip to main content
Email Password   helpLost your password?

Introduction

This is a set of tools with which you can easily distribute automatic software updates to your clients.

Concept
picture #1

As you see in picture1 the ideal workflow to your clients is a direct line.
To get such an theoretical way working in an acceptbale way (in this solution), you will need to take the detour to the webserver. That means:

How does it work?

Concept
picture #2

As you see in picture2 the update-toolset consists of 3 different parts:

This program uses

Explanation of the basic functions

Producer-site:

(see picture3)
  1. Project is compiled
  2. packed
  3. uploaded to the webserver
  4. online-database is updated with the new version

Concept
picture #3

Customer-site:

(see picture4)
  1. UpdateClient is called to check for updates
  2. it request the actual version from the webserver
  3. it recaives the actual version number and compares it to its own hardcoded number
  4. when the online-version is newer, the update is fetched, otherwise the updatecheck is finished at this step.
  5. receive the update-file and saves it to a temporary folder
  6. unpacks to that temporary folder
  7. atm: only copies all content over the old one, without checking something

Concept
picture #4

Using the code

Set up the mysql table at the webserver:
#
# Table structure for table `version`
#

CREATE TABLE version (
  projectid int(11) NOT NULL default '0',
  projectname text NOT NULL,
  actualversion int(11) NOT NULL default '0',
  PRIMARY KEY  (projectid)
) TYPE=MyISAM;

Create a update.php script with following content:

<?php
mysql_connect("mydbserver.com","dbuser","dbpassword") or die(mysql_error());
mysql_select_db("mydb") or die(mysql_error());
switch($_GET["action"]){
 case "check": 
  $res=mysql_query(
"SELECT * FROM version WHERE projectname='".$_GET["project"]."'");
  $arr=mysql_fetch_array($res);
  echo $arr["actualversion"];
  die();
 break;
 case "setnew": 
  $res=mysql_query(
"UPDATE version SET actualversion=".$_GET["version"]." 
WHERE projectname='".$_GET["project"]."'");
  die();
 break;
 default:
  header("location:/");
  die();
  break;
} // switch

?>

Upload the update.php to the location specified in your updateclients. Don't forget to create the directory for the updates! integrate it into your application:

Public Class Form1
...
    Dim WithEvents updater As updateclient.clsClient
    Private Sub Form1_Load(ByVal sender As System.Object,
 ByVal e As System.EventArgs) Handles MyBase.Load
        updater = New updateclient.clsClient
        updater.CheckForNewVersion(ProjectName, VersionNumber, 
ProjectName, Application.ExecutablePath)
    End Sub
...
    Private Sub updater_endall() Handles updater.endall
        end
    End Sub
...
End Class
    
Module Module1
    Public Const ProjectName As String = "yourappname"
    Public Const VersionNumber As Integer = 25
    Public VersionDate As Date = New Date(2004, 10, 25) 'not used yet!

End Module

Points of Interest

Updates become more and more important in this fast-moving buisness. This toolset is just a fast-hacked starting point using the concept mentioned. You'll note that there exists no error handling, and many many more usefull features that are not included yet. Can your improve the concept or the toolset in any way?

History

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralNice idea... too complex. Pin
Destiny777
10:05 14 Apr '08  
GeneralHello Pin
ehrenberg
21:50 25 Feb '08  
GeneralToooooooooo Complicated !!!! Pin
abhi1310
1:31 16 Apr '07  
GeneralHow to get on the FTP? [modified] Pin
unique_24
2:34 21 Jun '06  
GeneralWindows Update. Pin
Bikash Rai
2:33 14 Dec '05  
GeneralRe: Windows Update. Pin
Nikola Knezevic
2:24 6 Mar '07  
GeneralMaybe future version should have this ... Pin
Vertyg0
9:02 7 Dec '05  
GeneralLive Update App @ PSC Pin
igorkrupitsky
11:16 27 May '05  
GeneralRe: Live Update App @ PSC Pin
thomasdev
4:08 29 May '05  
GeneralMicrosoft's Updater Application Block Pin
Anonymous
12:41 25 May '05  
GeneralNice, but how to update the UpdateClient Pin
RSabet
12:40 29 Nov '04  
GeneralRe: Nice, but how to update the UpdateClient Pin
thomasdev
12:56 29 Nov '04  
GeneralNice but.. Pin
Pkef
1:02 8 Nov '04  
GeneralRe: Nice but.. Pin
thomasdev
5:59 8 Nov '04  


Last Updated 26 Oct 2004 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009