REBOL [ Title: "REBOL 3.0 Version Upgrade" Author: "Carl Sassenrath" Version: 1.0.1 Needs: 2.100.44 Date: 7-April-2009 ] upgrade: funct [ "Check for newer versions (update REBOL)." ][ ver-dir: %updates/ print "Checking for updates..." request: mold compose [date: (now) vers: (system/version) prod: (system/product)] result: write http://www.rebol.com/cgi-bin/r3-news.r to-binary request unless block? result: load result [print ["Upgrade error:" result] halt] vers: construct result ms-os?: system/version/4 = 3 print [ lf "R3 current version:" vers/r3-vers lf "It was released on:" vers/r3-date lf ] if in vers 'alert [ print [ "*************************^/" vers/alert ] unless confirm "Continue? (y/n) " [exit] ] either system/version >= vers/r3-vers [ print "Your version is current." ] [ print "You need to update R3." either confirm "Download new release? " [ print ["Downloading" vers/r3-vers "..."] data: read join http://www.rebol.com/r3/alpha/v [vers/r3-vers %.bin] print ["Decompressing" length? data "bytes"] data: decompress data make-dir ver-dir file: join ver-dir ["r3-a" vers/r3-vers/3] if ms-os? [append file %.exe] print ["Saving new version to:" file] write file data print "Copy and rename the file as needed." if all [ ms-os? confirm "Open the updates folder? (y/n) " ][ call "explorer updates" ] ] [ print "Ok, but only the new version is supported." ] ] exit ] upgrade