home *** CD-ROM | disk | FTP | other *** search
Wrap
;****************************************************************************** ; Installation script for ZedREXX ; Copyright (c) 1993-1994 Reality Check, Inc. ; Written by David N. Junod ;****************************************************************************** ; Make sure they are running 2.04 or greater (if (< (/ (getversion) 65536) 37) (abort "You must be using Kickstart 2.04 or higher to install and use ZedREXX.") ) ; Figure out what device to install to (we don't want CD's to show up, etc...) (run "setenv zeddir SYS:" (safe)) (run "zguessdev >env:zeddir" (safe)) (set @default-dest (getenv "zeddir")) (delete "env:zeddir") ;****************************************************************************** (set mode 0) (set tempdir (getassign "ZEDREXX")) (if (> (strlen tempdir) 0) ( ; Ask the user if we are installing or removing (set mode (askchoice (prompt "ZedREXX") (help @askchoice-help) (choices "Install" "Remove") ) ) ) ) ; Set the prompt string (if mode (set pmode "Remove") (set pmode "Install") ) ;****************************************************************************** ; Prompt for components and their directories (set cbits (askoptions (prompt "Components to " pmode) (help @askoptions-help) (choices "ZedREXX" "Support" "Examples") (default 7) ) ) ; Libraries (if (bitand cbits 1) ( ; Where should the ZedREXX directory itself be made (set appdir (askdir (prompt "In which disk (or drawer) should the ZedREXX " "directory be installed or updated?" ) (help @askdir-help) (default @default-dest) ) ) (set @default-dest (tackon appdir "ZedREXX")) ; we have to create a directory for when we prompt... (makedir @default-dest (prompt "Creating ZedREXX application directory") ) ; Do everything relative to our own directory (set libdir (tackon @default-dest "Libs")) ; ; Ask where the main libraries should be installed ; (set libdir ; (askdir ; (prompt "Where do the Libraries belong") ; (help @askdir-help) ; (default "LIBS:") ; ) ; ) ) ) ; Support (if (bitand cbits 2) ( ; Do everything relative to our own directory (set classdir (tackon @default-dest "Classes")) ; ; Do they already have a CLASSES: assignment? ; (set classdir (getassign "CLASSES")) ; (if (= (strlen classdir) 0) ; ; No CLASSES: assignment ; ( ; ; See if they already have a directory called Classes ; (set classdir "SYS:") ; (if (= (exists "SYS:Classes") 2) ; (set classdir "SYS:Classes") ; (if (= (exists (tackon @default-dest "Classes")) 2) ; (set classdir (tackon @default-dest "Classes")) ; ( ; ; we have to create a directory it seems ; (if (= @user-level 0) ; ( ; (makedir "SYS:Classes" ; (prompt "Creating Classes support library directory") ; ) ; (set classdir "SYS:Classes") ; ) ; ) ; ) ; ) ; ) ; ; ; Now see if they want to use this directory ; (set classdir ; (askdir ; (prompt "An assignment called CLASSES: must be made to a directory that will contain the gadget & image class libraries. Where will that directory be?") ; (help @askdir-help) ; (default classdir) ; ) ; ) ; ) ; ; There is a CLASSES: assignment already ; ( ; (set classdir ; (askdir ; (prompt "Where do the Classes Support Libraries belong") ; (help @askdir-help) ; (default "CLASSES:") ; ) ; ) ; ) ; ) ; (makeassign "CLASSES" classdir) ; Do everything relative to our own directory (set rexxlibdir (tackon @default-dest "RexxLibs")) ; ; Do they already have a REXXLIBS: assignment? ; (set rexxlibdir (getassign "REXXLIBS")) ; (if (= (strlen rexxlibdir) 0) ; ; No REXXLIBS: assignment ; ( ; ; See if they already have a directory called RexxLibs ; (set rexxlibdir "SYS:") ; (if (= (exists "SYS:RexxLibs") 2) ; (set rexxlibdir "SYS:RexxLibs") ; (if (= (exists (tackon @default-dest "RexxLibs")) 2) ; (set rexxlibdir (tackon @default-dest "RexxLibs")) ; ( ; ; we have to create a directory it seems ; (if (= @user-level 0) ; ( ; (makedir "SYS:RexxLibs" ; (prompt "Creating REXX support library directory") ; ) ; (set rexxlibdir "SYS:RexxLibs") ; ) ; ) ; ) ; ) ; ) ; ; ; Now see if they want to use this directory ; (set rexxlibdir ; (askdir ; (prompt "An assignment called REXXLIBS: must be made to a directory that will only contain REXX function libraries. Where will that directory be?") ; (help @askdir-help) ; (default rexxlibdir) ; ) ; ) ; ) ; ; There is a REXXLIBS: assignment already ; ( ; (set rexxlibdir ; (askdir ; (prompt "Where do the REXX Support Libraries belong") ; (help @askdir-help) ; (default "REXXLIBS:") ; ) ; ) ; ) ; ) ; (makeassign "REXXLIBS" rexxlibdir) ) ) ; Examples (if (bitand cbits 4) ; Do everything relative to our own directory (set rexxdir (tackon @default-dest "REXX")) ; (set rexxdir ; (askdir ; (prompt "Where do the Examples belong") ; (help @askdir-help) ; (default (tackon @default-dest "REXX")) ; ) ; ) ) ;****************************************************************************** ;****************************************************************************** ;****************************************************************************** (if mode ;********************************************************************** ; Remove ;********************************************************************** ( ; Are we supposed to remove the examples (if (bitand cbits 4) ( (working "Removing examples") (run "c:delete ZEDREXX:REXX/#? all") (delete "ZEDREXX:REXX" (infos)) ) ) ; Are we supposed to remove the support libraries (if (bitand cbits 2) ( (working "Removing support libraries") (delete (tackon rexxlibdir "rexxdos.library")) (delete (tackon rexxlibdir "rexxutil.library")) ) ) ; Are we supposed to remove the application (if (bitand cbits 1) ( (working "Removing ZedREXX") ; Delete the key library (delete (tackon libdir "rciface.library")) (delete "c:zrx") ; Delete the application directory (run "c:delete ZEDREXX:#? all") (makeassign "ZEDREXX") (delete @default-dest (infos)) ) ) ; Make changes to the startup sequence (working "Modifying the user-startup") (set rexxlibdir (getassign "REXXLIBS")) (startup "ZedREXX" (prompt "Removing REXXLIBS: assignment from user-startup") (help @startup-help) (command "; ZedREXX 1.0 - Copyright (c) 1993-1994 Reality Check, Inc.\n") (command "; All Rights Reserved Worldwide\n") (command ";\n;removed...\n") ) ; Don't want to use the confusing "Installation Complete" message ; when what we really did was remove things... (message "The \"ZedREXX\" components " "that you specified have been successfully removed") (exit (quiet)) ; Flush the old libraries (run "c/flushlibs") ) ;********************************************************************** ; Install ;********************************************************************** ( ; Are we supposed to install application (if (bitand cbits 1) ( (working "Installing ZedREXX") ; Create the directory (makedir @default-dest (prompt "Creating ZedREXX directory") (infos) ) (makeassign "ZEDREXX" @default-dest) ; Install the libraries (copylib (prompt "Copying rciface.library") (help @copylib-help) (source "libs/rciface.library") (dest libdir) (confirm) ) (copyfiles (prompt "Copying shell commands") (help @copyfiles-help) (source "c") (dest (tackon @default-dest "c")) (all) (confirm) ) ; (copylib ; (prompt "Copying zrx") ; (help @copylib-help) ; (source "c/zrx") ; (dest "C:") ; (confirm) ; ) (copyfiles (prompt "Copying class interfaces") (help @copyfiles-help) (source "zclasses") (dest (tackon @default-dest "zclasses")) (all) (confirm) ) (copyfiles (prompt "Copying Icons") (help @copyfiles-help) (source "icons") (dest (tackon @default-dest "icons")) (all) ) (copyfiles (prompt "Copying Images") (help @copyfiles-help) (source "images") (dest (tackon @default-dest "images")) (all) ) (copyfiles (prompt "Copying ReadME") (help @copyfiles-help) (source "ReadME") (dest @default-dest) (infos) ) (copyfiles (prompt "Copying Press Release") (help @copyfiles-help) (source "PR") (dest @default-dest) (infos) ) (copyfiles (prompt "Copying Press Release") (help @copyfiles-help) (source "PR.TXT") (dest @default-dest) (infos) ) ) ) ; Are we supposed to install support libraries (if (bitand cbits 2) ( ; Install the support libraries (working "Installing support libraries") (copylib (prompt "Copying rexxdos.library") (help @copylib-help) (source "rexxlibs/rexxdos.library") (dest rexxlibdir) (confirm) ) (copylib (prompt "Copying rexxutil.library") (help @copylib-help) (source "rexxlibs/rexxutil.library") (dest rexxlibdir) (confirm) ) ; Make sure the class sub-directories exist */ (makedir classdir) (makedir (tackon classdir "Gadgets")) ; (makedir (tackon classdir "Images")) ; Install the classes (copylib (prompt "Copying button gadget") (help @copylib-help) (source "classes/gadgets/button.gadget") (dest (tackon classdir "Gadgets")) (confirm) ) ; (copylib ; (prompt "Copying string gadget") ; (help @copylib-help) ; (source "classes/gadgets/string.gadget") ; (dest (tackon classdir "Gadgets")) ; (confirm) ; ) ; (copylib ; (prompt "Copying label image") ; (help @copylib-help) ; (source "classes/images/label.image") ; (dest (tackon classdir "Images")) ; (confirm) ; ) ) ) ; Are we supposed to install examples (if (bitand cbits 4) ( (working "Installing examples") (makedir rexxdir (prompt "Creating ZedREXX Examples directory") (infos) ) (copyfiles (prompt "Copying examples") (help @copyfiles-help) (source "REXX") (dest rexxdir) (all) (infos) (confirm) ) ) ) ; Make changes to the startup sequence (working "Modifying the user-startup") ; (set rexxlibdir (getassign "REXXLIBS")) ; (set @default-dest (getassign "ZEDREXX")) (startup "ZedREXX" (prompt "Adding REXXLIBS: assignment to user-startup") (help @startup-help) (command "; ZedREXX 1.0 - Copyright (c) 1993-1994 Reality Check, Inc.\n") (command "; All Rights Reserved Worldwide\n") (command (cat "Assign ZEDREXX: " @default-dest "\n")) (command (cat "Assign REXXLIBS: ZEDREXX:RexxLibs Add\n")) (command (cat "Assign LIBS: ZEDREXX:Libs ZEDREXX:RexxLibs ZEDREXX:Classes Add\n")) (command (cat "Assign C: ZedREXX:c Add\n")) (command (cat "Path ZedREXX:c Add\n")) (command "ZEDREXX:c/AddREXXLibs >NIL: <NIL:\n") (command "Run >NIL: <NIL: ZEDREXX:c/Subvert\n") (command "Run >NIL: <NIL: ZEDREXX:c/zClsMgr\n") ) ; Get it running so they don't have to reboot to start things (execute "dos-install") ; Flush the old libraries (run "c/flushlibs") ) )