ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Auto-Update method for C++ (Requires MFC) (Sdk)
Auto-Update method for C++ (Requires MFC) // Sdkandon13Dec 16, 1999, 8:36pm
This is a multi-part message in MIME format.
------=_NextPart_000_0045_01BF47EA.B526C700 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hehe, forgot to mention that in order for the Banner Message to work, = you must insert an extra linebreak after it . . . With WordPad, you = cannot add an empty linebreak, so you'll have to hit enter and then = space . . . Anyway, sorry I forgot to mention this :) Best regards, Andon M. Coleman Senior Programmer R&D Nothing, Inc. [View Quote] NOTE: This code does require some modification on your part . . . If = you're too lazy to do that, then you shouldn't even be programming :) I ran into a problem early in the design stages when I first came up = with the idea that my BOT (Ultra BOT) should have an Auto-Upgrade = mechanism . . . The problem I was facing was that I didn't have a = dedicated server to run a "Version Server" on. I did however have web = space on a Static Address. So I decided to use this to my advantage, and = develop an Auto-Update method that read from a proprietary script = language. Thus my Auto-Update mechanism was born! I believe the source code is commented enough, so I don't feel I need = to explain sections of the code very much (But if you do have a question = about it, feel free to E-Mail me at : gizmo98 at earthlink.net or Telegram = me, as Andon13 . . .) But I do feel the Script language itself needs a bit of explaining . . = .. =20 =20 =20 Let me try to explain it here . . . The first three things in the script are : %MV (Master Version), %NF (Number of Files), and %ND (Number of = Directories) %MV is the overall version . . . Anything added / updated when you = upload a new Version.dat should reflect this number . . . Notes about %MV : If it is equal to the %MV stored on the Client's = computer, by default the Message of the Day will be displayed. If it's = higher, the Generic "New Version" MessageBox will pop-up, and if it's = lower an error message will be generated . . . Also, it is important to = think of the Master Version and File Versions as Update Numbers rather = than Version Numbers . . . %NF is equal to the number of total files in the Update script . . . %ND is equal to the number of secondary directories used . . . =20 Next we move on to the files . . . The format for the LOCAL File Location is : xL <FILE NAME>, where x is the File Number and <FILE NAME> is the path = to be used. The format for the EXTERNAL (URL) File Location is : xF <URL>, where x is the File Number and <URL> is the URL of the file. The format for the File Version is : xV <VER>, where x is the File Number and <VER> is the Update number = you assign to the file. Lastly, %BM is the "Banner Message" . . . There is support in the Auto-Update = mechanism for a custom message using this . . . A very good example is given in Ultra BOT, which is currently in = Closed BETA (I need more "intelligent" testers though =3D)). Any questions about this should be easily explained by tinkering with = the version.dat and the Sample Auto-Update app, which the FULL source = code is included for. FINAL NOTES on Script : You need to include a file that will download to ReleaseNotes.txt . . = .. This will be displayed as soon as the Updater finishes downloading all = of the files, and after it's been read, will launch your program again. The version.dat script requires you save / modify it using WordPad = (provided with Windows) or any other program that saves Line Breaks as : = "\r\n" instead of "\n" - Save it as a "Text Document" (You may have to = rename it from "version.dat.txt" to "version.dat" . . . Stupid WordPad!) Also, when uploading, you must upload it as a binary file to preserve = the "\r\n" linebreaks . . . If you *DO NOT* do both of these, the = Version Check / Updater won't know what it's reading. Known Bug: Directory creation used to work, but now creates an incorrectly named = directory . . . If you figure out why, I'd love to hear it :) I hope this helps you a lot (even if the documentation isn't the = greatest =3DP) Best regards, Andon M. Coleman Senior Programmer R&D Nothing, Inc. ------=_NextPart_000_0045_01BF47EA.B526C700 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2722.1300" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial>Hehe, forgot to mention that in order for the = Banner=20 Message to work, you must insert an extra linebreak after it . . . With = WordPad,=20 you cannot add an empty linebreak, so you'll have to hit enter and then = space .=20 .. .</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Anyway, sorry I forgot to mention this = :)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Best regards,</FONT></DIV> <DIV><FONT face=3DArial>Andon M. Coleman</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Senior Programmer</FONT></DIV> <DIV><FONT face=3DArial>R&D</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Nothing, Inc.</FONT></DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: = 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV>andon13 <<A=20 href=3D"mailto:gizmo98 at earthlink.net">gizmo98 at earthlink.net</A>> = wrote in=20 message <A=20 = href=3D"news:3859650f at server1.Activeworlds.com">news:3859650f at server1.Act= iveworlds.com</A>...</DIV> <DIV><FONT face=3DArial>Hello everyone . . . It's me again. I haven't = posted=20 anything here in ages (partly due to the fact that I didn't know how = to=20 anymore).</FONT></DIV> <DIV><FONT face=3DArial>Anyway, what I'm posting here is a method to = Check the=20 version of a program, and if it's older then the one stored on the = NET,=20 upgrade . . .</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>NOTE: This code does require some modification = on your=20 part . . . If you're too lazy to do that, then you shouldn't even be=20 programming :)</FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV><FONT face=3DArial>I ran into a problem early in the design = stages when I=20 first came up with the idea that my BOT (Ultra BOT) should have an=20 Auto-Upgrade mechanism . . . The problem I was facing was that I = didn't have a=20 dedicated server to run a "Version Server" on. I did however have web = space on=20 a Static Address. So I decided to use this to my advantage, and = develop an=20 Auto-Update method that read from a proprietary script language. Thus = my=20 Auto-Update mechanism was born!</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>I believe the source code is commented enough, = so I=20 don't feel I need to explain sections of the code very much (But = if you=20 do have a question about it, feel free to E-Mail me at : <A=20 href=3D"mailto:gizmo98 at earthlink.net">gizmo98 at earthlink.net</A> or = Telegram me,=20 as Andon13 . . .)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>But I do feel the Script language itself needs = a bit of=20 explaining . . .</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial></FONT> </DIV> <DIV><FONT face=3DArial></FONT> </DIV> <DIV><FONT face=3DArial></FONT> </DIV> <DIV><FONT face=3DArial>Let me try to explain it here . . = ..</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>The first three things in the script are = :</FONT></DIV> <DIV><FONT face=3DArial>%MV (Master Version), %NF (Number of Files), = and %ND=20 (Number of Directories)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>%MV is the overall version . . . Anything = added /=20 updated when you upload a new Version.dat should reflect this number . = ..=20 .</FONT></DIV> <DIV><FONT face=3DArial>Notes about %MV : If it is equal to the %MV = stored on=20 the Client's computer, by default the Message of the Day will be = displayed. If=20 it's higher, the Generic "New Version" MessageBox will pop-up, and if = it's=20 lower an error message will be generated . . . Also, it is important = to think=20 of the Master Version and File Versions as Update Numbers rather than = Version=20 Numbers . . .</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>%NF is equal to the number of total files in = the Update=20 script . . .</FONT></DIV> <DIV><FONT face=3DArial>%ND is equal to the number of secondary = directories used=20 . . .</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial></FONT> </DIV> <DIV><FONT face=3DArial>Next we move on to the files . . = ..</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>The format for the LOCAL File Location is = :</FONT></DIV> <DIV><FONT face=3DArial>xL <FILE NAME>, where x is the File = Number and=20 <FILE NAME> is the path to be used.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>The format for the EXTERNAL (URL) File = Location is=20 :</FONT></DIV> <DIV><FONT face=3DArial>xF <URL>, where x is the File Number and = <URL> is the URL of the file.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>The format for the File Version is = :</FONT></DIV> <DIV><FONT face=3DArial>xV <VER>, where x is the File Number and = <VER> is the Update number you assign to the = file.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Lastly,</FONT></DIV> <DIV><FONT face=3DArial>%BM is the "Banner Message" . . . There is = support in=20 the Auto-Update mechanism for a custom message using this . . = ..</FONT></DIV> <DIV><FONT face=3DArial>A very good example is given in Ultra BOT, = which is=20 currently in Closed BETA (I need more "intelligent" testers=20 though =3D)).</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Any questions about this should be easily = explained by=20 tinkering with the version.dat and the Sample Auto-Update app, which = the FULL=20 source code is included for.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>FINAL NOTES on Script :</FONT></DIV> <DIV><FONT face=3DArial>You need to include a file that will = download to=20 ReleaseNotes.txt . . . This will be displayed as soon as the Updater = finishes=20 downloading all of the files, and after it's been read, will launch = your=20 program again.</FONT></DIV> <DIV><FONT face=3DArial>The version.dat script requires you save / = modify it=20 using WordPad (provided with Windows) or any other program that saves = Line=20 Breaks as : "\r\n" instead of "\n" - Save it as a "Text Document" (You = may=20 have to rename it from "version.dat.txt" to "version.dat" . . . Stupid = WordPad!)</FONT></DIV> <DIV><FONT face=3DArial>Also, when uploading, you must upload it as a = binary=20 file to preserve the "\r\n" linebreaks . . . If you *DO NOT* do both = of these,=20 the Version Check / Updater won't know what it's reading.</FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Known Bug:</FONT></DIV> <DIV><FONT face=3DArial>Directory creation used to work, but now = creates an=20 incorrectly named directory . . . If you figure out why, I'd love to = hear it=20 :)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>I hope this helps you a lot (even if the = documentation=20 isn't the greatest =3DP)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Best regards,</FONT></DIV> <DIV><FONT face=3DArial>Andon M. Coleman</FONT></DIV> <DIV><BR><FONT face=3DArial>Senior Programmer</FONT></DIV> <DIV><FONT face=3DArial>R&D</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial>Nothing, Inc.</FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV> <DIV> </DIV></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_0045_01BF47EA.B526C700-- |