Posted: 26th Jul 2003 21:08
For those interested, here is the source code for the TestDownload programs.

TestProgram (original) is :

+ Code Snippet
#constant UPDATEDIR  "UPDATE"

cls 0
print "Version 1.0.0.0 - Test of the Updater plug-in.  (C) Nicholas Kingsley"
print "Press RETURN to download the latest update":sync:wait key

clear entry buffer
x=downloadfromURL("http://www.nickk.nildram.co.uk/TestDownload",_
                  "!UPDATE.exe,001,001,001,001",_
                  UPDATEDIR)
clear entry buffer
if x=1
   print "Download successful."
   print "Do you want to install the latest update ? (Y/N)"
   print "The program will automatically end if you do."
   print "If not, you can run the update program manually at a later date."
   sync
   repeat
      a$=upper$(inkey$())
   until a$="Y" or a$="N"
   if a$="Y"
      x=installUpdate(UPDATEDIR,"")
      if x0
         set window ON
         end
      else
         print "Installation was cancelled"
      endif
   else
      end
   endif
else
   print "Download was not successful."
   print "There is no update availiable or updating was cancelled."
   print "Press RETURN to end the program"
   sync
   wait key
   end
endif


TestProgram (Update V9,9,9,9) is :

+ Code Snippet
#constant UPDATEDIR  "UPDATE"

cls 0
print "Version 9.9.9.9 - Test of Updater plug-in.  (C)  Nicholas Kingsley"
print "Press RETURN to download the latest update":sync:wait key

clear entry buffer
x=downloadfromURL("http://www.nickk.nildram.co.uk/TestDownload",_
                  "!UPDATE.exe,009,009,009,009",_
                  UPDATEDIR)
clear entry buffer
if x=1
   print "Download successful."
   print "Do you want to install the latest update ? (Y/N)"
   print "The program will automatically end if you do."
   print "If not, you can run the update program manually at a later date."
   sync
   repeat
      a$=upper$(inkey$())
   until a$="Y" or a$="N"
   if a$="Y"
      x=installUpdate(UPDATEDIR,"","")
      if x0
         set window ON
         end
      else
         print "Installation was cancelled"
      endif
   else
      end
   endif
else
   print "Download was not successful."
   print "There is no update availiable or update was cancelled."
   print "Press RETURN to end the program"
   wait key
   end
endif