Update My Game.

BlitzPlus Forums/BlitzPlus Programming/Update My Game.

EliteKen(Posted 2012) [#1]
Hi,

I am looking to making a way to update my game files...

Does anyone have a code that allows you to download an .EXE file from a webURL?


I have found one that works on other files such as .jpg, .txt, .bmp, etc... but not one for .EXE


or better yet, anyone got a good technique/code for updating game files.


Thanks.


Zethrax(Posted 2012) [#2]
An exe file is just a file. If you can download .jpg, .txt, .bmp, etc files then you can download an exe file too.

(Note that all the code below is for Blitz3D. It will probably work in BlitzPlus, but I haven't tested it.)

The code below will download a file off the Internet and place it into a string global (I originally wrote it for downloading XML data). The comments contain usage information. It requires the 'SplitString()' function found at: http://www.blitzbasic.com/codearcs/codearcs.php?code=2991




The code below can be used to save the resulting string to a file. You may want to change it to save the data in the global string variable directly rather than passing all the data to the function via the function parameter.




The code below can be used to check if a new version of your program is available. The comments contain usage information.



Last edited 2012