home *** CD-ROM | disk | FTP | other *** search
- ; Installer Patch Script for KingFisher Release 2
- ; Copyright © 1994 Udo Schuermann
- ; All rights reserved
- ; $VER: Install-KFPatch 2.5 (5.11.94)
- ;
- ;
- ; Installer and Installer project icon
- ; (c) Copyright 1991-93 Commodore-Amiga, Inc. All Rights Reserved.
- ; Reproduced and distributed under license from Commodore.
- ;
- ; INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
- ; NO WARRANTIES ARE MADE. ALL USE IS AT YOUR OWN RISK. NO LIABILITY
- ; OR RESPONSIBILITY IS ASSUMED.
-
-
- ; (set VER "blah 2.7 (28.2.94)"
- ; returns with REV set to "2" and VER set to "7" as in "2.7" without the dot
- (procedure extract-version (
- (set i 0 sREV "" sVER "" LOOKING 1)
- (while (AND (= LOOKING 1) (< i 255)) (
- (set t (substr VER i 1))
- (if (<= t '9')
- ((if (>= t '0')
- (set LOOKING 0)
- (set i (+ i 1))))
- (set i (+ i 1)))
- ))
- (if (= LOOKING 0) (
- (set sREV (substr VER i 1))
- (set i (+ i 1) LOOKING 1)
- (while (AND (= LOOKING 1) (< i 255)) (
- (set t (substr VER i 1))
- (if (<= t '9')
- (if (>= t '0')
- (set sREV ("%s%s" sREV t))))
- (if (OR (= t '.') (= t ' '))
- (set LOOKING 0))
- (set i (+ i 1))
- ))
- (set LOOKING 1)
- (while (AND (= LOOKING 1) (< i 255)) (
- (set t (substr VER i 1))
- (if (<= t '9')
- (if (>= t '0')
- (set sVER ("%s%s" sVER t))))
- (if (= t ' ')
- (set LOOKING 0))
- (set i (+ i 1))
- ))
- ))
- ))
-
- ; (set VSTR "blah 2.7 (28.2.94)")
- ; call with VSTR set to "blah 2.7 (d.m.y)..."
- ; presence of EVALUATION or REGISTERED will return TYPEKEY "R" or TYPEKEY "E"
- ; as well as TYPENAME set to the 10 character string EVALUATION or REGISTERED
- ; defaults to registered (if the keystrings are not found)
- (procedure extract-type (
- (set i 0 LOOKING 1 TYPEKEY "R" TYPENAME "REGISTERED")
- (while (AND (= LOOKING 1) (< i 255)) (
- (set t (substr VSTR i 10))
- (set i (+ i 1))
- (if (= t "REGISTERED")
- (set TYPEKEY "R" TYPENAME t LOOKING 0)
- (if (= t "EVALUATION")
- (set TYPEKEY "E" TYPENAME t LOOKING 0)))))
- ))
-
- ;(set REV sREVKFS VER sVERKFS FILE "KFServer" THISONE "25" THISREV "2" THISVER "5" VSTR vKFS)
- ; REV and VER are the original revision and version values of FILE
- ; THISONE is the new version without the dot in the middle; THISREV and THISVER
- ; are the value of THISONE but separated, VSTR is the version string as required
- ; by the (extract-type) function which is called from here.
- (procedure patch-file (
- (if (= ("%s%s" REV VER) THISONE)
- (message ("You already have %s %s.%s installed!\n\nPatch skipped" FILE REV VER))
- ((extract-type)
- (working ("Patching %s %s version from\n\n%s.%s to 2.5" FILE TYPENAME REV VER))
- (set ORIGINAL (tackon DESTIN FILE))
- (set PATCH ("%s_%s-%s%s-%s.pch" TYPEKEY FILE REV VER THISONE))
- (set OUTPUT (tackon DESTIN ("%s.new" FILE)))
- (if (exists PATCH)
- ((set CMD ("spatch \"-o%s\" \"-p%s\" \"%s\"" OUTPUT PATCH ORIGINAL))
- (run CMD)
- (if (exists (tackon DESTIN ("%s.new" FILE)))
- ((set BACKUP (tackon DESTIN ("%s-%s.%s" FILE REV VER)))
- (if (exists BACKUP)
- (delete BACKUP))
- (rename (tackon DESTIN FILE) BACKUP)
- (rename (tackon DESTIN ("%s.new" FILE)) (tackon DESTIN FILE)))
- ((set xUSER @user-level)
- (user 3)
- (message ("ERROR!\n\n%s could not be patched!" FILE))
- (user xUSER)))
- )
- (message ("A patch file to upgrade the %s version of %s from %s.%s to %s.%s is not available"
- TYPENAME FILE REV VER THISREV THISVER)))))
- ))
-
- (complete 0)
-
- (set LOOKING 1 FAIL 0)
- (while (= LOOKING 1)
- (set DESTIN
- (askdir
- (prompt
- "Please indicate the directory where KingFisher is installed. "
- "This is the directory where the files are actually located.")
- (help @askdir-help)
- (default "SYS:KingFisher2")))
- (if (exists (tackon DESTIN "KFServer"))
- (if (exists (tackon DESTIN "KingFisher"))
- (set LOOKING 0)))
- (if (= LOOKING 1)
- (message (
- "The Installer cannot seem to find the KFServer and KingFisher "
- "programs in the '%s' directory. Please try again or cancel the "
- "installation." DESTIN))))
- (complete 1)
-
- (working "Determining which software revisions you have currently installed")
-
- (run ("c:version >ENV:VERKFS full \"%s\"" (tackon DESTIN "KFServer")))
- (set VER (getenv "VERKFS"))
- (set vKFS VER)
- (extract-version)
- (set sREVKFS sREV sVERKFS sVER)
- (complete 3)
-
- (run ("c:version >ENV:VERKF full \"%s\"" (tackon DESTIN "KingFisher")))
- (set VER (getenv "VERKF"))
- (set vKF VER)
- (extract-version)
- (set sREVKF sREV sVERKF sVER)
- (complete 4)
-
- (if (exists (tackon DESTIN "RexxFisher"))
- ((run ("c:version >ENV:VERRXF full \"%s\"" (tackon DESTIN "RexxFisher")))
- (set VER (getenv "VERRXF"))
- (set vRXF VER)
- (extract-version)
- (set sREVRXF sREV sVERRXF sVER))
- (set sREVRXF "" sVERRXF ""))
- (complete 5)
-
- (set REV sREVKFS VER sVERKFS FILE "KFServer" THISONE "25" THISREV "2" THISVER "5" VSTR vKFS)
- (patch-file)
- (complete 25)
-
- (set REV sREVKF VER sVERKF FILE "KingFisher" THISONE "25" THISREV "2" THISVER "5" VSTR vKF)
- (patch-file)
- (complete 70)
-
- ;(if (<> sREVRXF "")
- ; ((set REV sREVRXF VER sVERRXF FILE "RexxFisher" THISONE "17" THISREV "1" THISVER "7" VSTR vRXF)
- ; (patch-file)))
- (complete 90)
-
- (delete "ENV:VERKFS")
- (delete "ENV:VERKF")
- (delete "ENV:VERRXF")
-
- ; update all installed catalogs (if any)
- (if (exists (tackon DESTIN "Catalogs"))
- (foreach (tackon DESTIN "Catalogs") "#?" (
- (if (exists ("Catalogs/%s" @each-name))
- ((working ("Installing %s Language" @each-name))
- (copyfiles
- (source (tackon "Catalogs" @each-name))
- (dest (tackon DESTIN ("Catalogs/%s" @each-name)))
- (all)))
- (message ("No new %s catalog available" @each-name))))))
- (complete 99)
-
- (if (exists "KingFisher2.guide")
- ((if (= @user-level 0) (user 1))
- (if (askbool
- (prompt
- "Would you like to upgrade to a new online English "
- "language documentation file?\n\nIf you have a translated "
- "version of this file installed, you should first make a "
- "backup copy before proceeding!")
- (choices "Yes, proceed" "No, skip it")
- (default "No, skip it")
- (help @askbool-help))
- (copyfiles
- (source "KingFisher2.guide")
- (dest DESTIN))
- (if (<= (/ (getversion "dos.library" (resident)) 65536) 38)
- ((working "\nWord-wrapping KingFisher2.guide\nfor use with AmigaGuide V34")
- (run ("WrapGuide %s 65" (tackon DESTIN "KingFisher2.guide")))))))
- (message "No new KingFisher2.guide available")
- )
-
- (if (exists "RexxFisher")
- ((if (= @user-level 0) (user 1))
- (if (askbool
- (prompt
- "Would you like to install RexxFisher 1.7?")
- (choices "Yes, proceed" "No, skip it")
- (default "No, skip it")
- (help @askbool-help))
- (copyfiles
- (source "RexxFisher")
- (dest DESTIN))))
- (message "No new RexxFisher available")
- )
-
- (complete 100)
- (exit)
-