home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-09-16 | 36.0 KB | 1,352 lines |
- ;*************************************************************************
- ; Title:
- ; Install-CanDo
- ;*************************************************************************
- ; Description:
- ; The Commodore Installer Script for CanDo 2.0 Software
- ;*************************************************************************
- ; Author:
- ; Eddie Churchill, c/o INOVAtronics, Inc.
- ;*************************************************************************
- ; Still to do:
- ;*************************************************************************
- ; History:
- ; 17:21:33 CST, 21 Jan 1992
- ; Added resident cando.library checking
- ; 11:55:39 CST, 20 Jan 1992
- ; Added DelOpt settings
- ; 13:44:22 CST, 15 Jan 1992
- ; Preserve old cando.info file if one exists
- ; 18:15:15 CST, 02 Jan 1992
- ; Made it actually ask for destination in novice mode
- ; 15:19:24 CST, 19 Dec 1991
- ; Updated for Installer 1.9
- ; 14:39:07 CST, 16 Dec 1991
- ; Finished
- ; 11:28:31 CST, 03 Dec 1991
- ; Rewritting script for Installer 1.7
- ;*************************************************************************
-
-
- ;******************************************************
- ;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
- ;******************************************************
-
- ; some useful variables
- (set true 1)
- (set false 0)
- (set on true)
- (set off false)
- (set yes true)
- (set no false)
- (set yep yes)
- (set nope no)
- (set is_a_file 1)
- (set is_a_dir 2)
- (set quote "\"")
- (set newline "\n")
- (set nothing "")
- (set testing nope)
- ; (set testing yep) ;<- uncomment this for testing mode
- (set os2 (< 2293760 (getversion "exec.library" (resident)))) ; true if under 2.0
- (set resident_candolib (getversion "cando.library" (resident)))
- (set ntsc_mode false)
- (set pal_mode true)
- (set free-mem (+ (database "total-mem") 0)) ; leftover free ram
-
- ; set up our delete options
- (delopts "AskUser" "OkNoDelete" "Force")
-
- ; determine the default system display mode
- (if (= (database "vblank") "60")
- (set display_mode ntsc_mode)
- (set display_mode pal_mode)
- )
-
- ; some useful procedures
- ; fills in the display_text string
- (procedure get_display_text
- (
- (if (= display_mode ntsc_mode)
- (set display_text "NTSC")
- (set display_text "PAL")
- )
- )
- )
-
- ; change userlevel to expert
- (procedure expert_level
- (
- (user 2)
- )
- )
-
- ; reset userlevel back to default
- (procedure default_level
- (
- (user default-level)
- )
- )
-
- ; store off userlevel
- (procedure save_default_level
- (
- (set default-level @user-level)
- )
- )
-
- ; some overused strings
- (set omp (cat "One moment please..." newline))
- (set pci "Patching the copied icons.")
-
- ; a general purpose global error trapper
- (onerror
- (makeassign "CanDoProgram_Master" (safe))
- (makeassign "CanDoExtras_Master" (safe))
- (makeassign "CanDoExamples_Master" (safe))
- )
-
-
- ;****************************************
- ;***** FIGURE OUT WHERE STUFF GOES ******
- ;****************************************
-
- ; now figure out the initial defaults for a bunch of things
- (if (= testing true)
- ( ; then clause
- (set cando_dir "Ram:CanDo")
- ; (set cando_dir nothing)
- ; (set cando_dir (getassign "CanDo"))
- (set c_dir "Ram:c")
- (set libs_dir "Ram:libs")
- )
- ( ; else clause
- ; @default-dest is already set for us
- (set cando_dir (getassign "CanDo"))
- (set c_dir (getassign "C"))
- (set libs_dir (getassign "LIBS"))
- )
- )
-
- ; introduce our selfs to the viewers
- (welcome "Welcome to the CanDo 2.00 installer. This installer uses "
- "the Commodore Amiga Installer. All of our future new products "
- "will be using this installer and we would love to get any feedback "
- "that might help in improving the installation procedure." newline newline
- )
-
- ; first reset the user level so that the novice can see whats going on
- (save_default_level)
- (expert_level)
-
- ; see if we are doing an update
- (if (<> cando_dir nothing)
- (if (askbool
- (prompt "There seems to be a CanDo already installed in"
- " your drawer named " quote cando_dir quote ". "
- "Do you want the update installed over it?")
- (help
- "The installer has determined that you may already have a "
- "copy of CanDo installed on your system. If this is wrong or "
- "you want the update installed elsewhere, select NO as an "
- "answer. Otherwise, select YES."
- )
- (default 1)
- )
- ( ; the then clause
- (set is_update true) ; hey, the user said yes
- )
- ( ; the else clause
- (set is_update false) ; hey, the user said nope
- (set cando_dir
- (askdir
- (prompt "Where would you like CanDo installed?")
- (help @askdir-help)
- (default @default-dest)
- (newpath)
- )
- )
- )
- )
- )
-
- ; if cando_dir is still nothing then where do they want it?
- (if (= cando_dir nothing)
- (set cando_dir
- (askdir
- (prompt "Where would you like CanDo installed?")
- (help @askdir-help)
- (default @default-dest)
- (newpath)
- )
- )
- )
-
- ; before we go on lets reset the user's level back to what it was
- (default_level)
-
- ; verify that the cando directory exists
- (if (<> (exists cando_dir) is_a_dir)
- (makedir cando_dir
- (prompt
- "The directory you have selected for CanDo does not "
- "seem to exist. Do you want us to create it for you?"
- )
- (help @makedir-help)
- (infos)
- (confirm)
- )
- )
-
- ; lets make sure the C: stuff goes there
- (set c_dir
- (askdir
- (prompt "Where would you like CanDo's C: files installed?")
- (help @askdir-help)
- (default c_dir)
- (newpath)
- )
- )
-
- ; verify that the directory exists
- (if (<> (exists c_dir) is_a_dir)
- (makedir c_dir
- (prompt
- "The directory you have selected for CanDo 'C:' files does not "
- "seem to exist. Do you want us to create it for you?"
- )
- (help @makedir-help)
- (infos)
- (confirm)
- )
- )
-
- ; lets make sure the Libs: stuff goes there
- (set libs_dir
- (askdir
- (prompt "Where would you like CanDo's Libs: files installed?")
- (help @askdir-help)
- (default libs_dir)
- (newpath)
- )
- )
-
- ; verify that the directory exists
- (if (<> (exists libs_dir) is_a_dir)
- (makedir libs_dir
- (prompt
- "The directory you have selected for CanDo 'Libs:' files does not "
- "seem to exist. Do you want us to create it for you?"
- )
- (help @makedir-help)
- (infos)
- (confirm)
- )
- )
-
-
- ;***********************************
- ;***** GET FIRST DISK IN HERE ******
- ;***********************************
-
- ; ask for the first disk, it should be here but lets check anyway
- (askdisk
- (prompt "Please insert the disk labeled \"CanDo Program\".")
- (help "The CanDo Program disk contains the main CanDo program,"
- "CanDo.Library, DeckRunner, DeckBinder and some example decks."
- )
- (dest "CanDo")
- (newname "CanDoProgram_Master")
- )
-
- ; tell the user of our progress
- (complete 5)
-
-
- ;************************************
- ;***** FIGURE OUT DISPLAY MODE ******
- ;************************************
-
- ; tell the user about it
- (working omp "Checking to see what type of Display this system uses.")
-
- ; make sure the display_text is filled in
- (get_display_text)
-
- ; ask the expert user what mode to use
- (set display_mode
- (askchoice
- (prompt "You are currently using a " display_text " system. "
- "Which display system do you want CanDo configured for?"
- )
- (help "This should be initially set to the correct display system "
- "according to your Amiga. If you want, you can override this. "
- "NTSC is normally only useful in the Americas (USA, Canada, "
- " Mexico, etc.) whereas PAL is used everywhere else." newline
- "All this really does is choose which basedeck CanDo should "
- "default to. NTSC's basedeck's window is 320 by 200 and PAL's "
- "is 320 by 256."
- newline newline
- @askchoice-help
- )
- (choices "NTSC Display (200/400 pixels high)" "PAL Display (256/512 pixels high)")
- (default display_mode)
- )
- )
-
- ; figure out the correct text string
- (get_display_text)
-
- ; tell the user of our progress
- (complete 10)
-
-
- ;****************************************
- ;***** COPY OVER FIRST DISK'S STUFF *****
- ;****************************************
-
- ; first copy over the c: stuff
- (working omp "Scanning CanDo's C directory for files.")
-
- (set c_dir
- (copyfiles
- (prompt "Copying C: files needed by CanDo")
- (help "This will copy " quote "DeckRunner" quote " and " quote
- "DeckBinder" quote " to your system's C directory." newline
- newline
- @copyfiles-help
- )
- (source "CanDoProgram_Master:C")
- (dest c_dir)
- (pattern "Deck#?")
- (files)
- (confirm)
- )
- )
-
- ; look for c:deckrunner
- (set deck_tool (tackon c_dir "DeckRunner"))
- (if (<> (exists deck_tool) is_a_file)
- (set deck_tool "DeckRunner")
- )
-
- ; look for c:deckbinder
- (set bind_tool (tackon c_dir "DeckBinder"))
- (if (<> (exists bind_tool) is_a_file)
- (set bind_tool "DeckBinder")
- )
-
- ; tell the user of our progress
- (complete 15)
-
- ; first copy over the libs: stuff
- (working omp "Scanning to see which libraries are on this distribution disk.")
-
- (copylib
- (prompt "Copying/Updating CanDo.Library")
- (source "CanDoProgram_Master:Libs/CanDo.Library")
- (dest libs_dir)
- (help "This will copy over the CanDo.Library file to your "
- "system's Libs directory." newline newline
- @copylib-help
- )
- (confirm)
- )
-
- ; tell the user of our progress
- (complete 20)
-
- ; which os are we running on?
- (if (= os2 false)
- (
- (copylib ; math IEEE double base library
- (prompt "Copying/Updating MathIEEEDoubBas.Library")
- (source "CanDoProgram_Master:Libs/MathIEEEDoubBas.Library")
- (dest libs_dir)
- (help "This will copy over the 1.3 MathIEEEDoubBas.Library file "
- "to your system's Libs directory." newline newline
- @copylib-help
- )
- (confirm)
- )
-
- (copylib ; math IEEE double transidental library
- (prompt "Copying/Updating MathIEEEDoubTrans.Library")
- (source "CanDoProgram_Master:Libs/MathIEEEDoubTrans.Library")
- (dest libs_dir)
- (help "This will copy over the 1.3 MathIEEEDoubTrans.Library file "
- "to your system's Libs directory." newline newline
- @copylib-help
- )
- (confirm)
- )
-
- (copylib ; diskfont library
- (prompt "Copying/Updating DiskFont.Library")
- (source "CanDoProgram_Master:Libs/DiskFont.Library")
- (dest libs_dir)
- (help "This will copy over the 1.3 DiskFont.Library file "
- "to your system's Libs directory." newline newline
- @copylib-help
- )
- (confirm)
- )
-
- (copylib ; Version library
- (prompt "Copying/Updating Version.Library")
- (source "CanDoProgram_Master:Libs/Version.Library")
- (dest libs_dir)
- (help "This will copy over the 1.3 Version.Library file "
- "to your system's Libs directory." newline newline
- @copylib-help
- )
- (optional)
- (confirm)
- )
-
- (copylib ; Icon library
- (prompt "Copying/Updating Icon.Library")
- (source "CanDoProgram_Master:Libs/Icon.Library")
- (dest libs_dir)
- (help "This will copy over the 1.3 Icon.Library file "
- "to your system's Libs directory." newline newline
- @copylib-help
- )
- (confirm)
- )
- )
- (
- (message "You have 2.xx, so we won't install any of the other "
- "libraries included with CanDo. You will need to have the "
- "following 2.xx libraries:" newline newline
- "MathIEEEDoubBas.Library" newline
- "MathIEEEDoubTrans.Library" newline
- "DiskFont.Library" newline newline
- "These libraries should be in your " quote "Libs:" quote
- " directory."
- (help "The CanDo diskettes come installed with the 1.3x libraries "
- "and system utilities and your system is installed with a newer "
- "operating system version so we should not install those libraries."
- )
- )
- )
- )
-
- ; tell the user of our progress
- (complete 25)
-
- ; preserving old cando info if it exists
- (set temp (tackon cando_dir "CanDo.info"))
- (if (= (exists temp) is_a_file)
- (
- (working omp "Preserving your old CanDo info file.")
- (rename temp (tackon cando_dir "CanDo_Old.info"))
- )
- )
-
- ; Copy over the cando program itself
- (working omp "Scanning for the CanDo program and readme files.")
-
- (set cando_dir
- (copyfiles
- (prompt "Copying CanDo program and readme files")
- (help "This will copy the CanDo program and some various "
- "readme files." newline newline
- @copyfiles-help
- )
- (source "CanDoProgram_Master:")
- (dest cando_dir)
- (pattern "(CanDo|ReadMeFirst|TheReader)")
- (files)
- (infos)
- (confirm)
- )
- )
-
- ; tell the user of our progress
- (complete 30)
-
- ; now patch the copied icons, if cando_dir exists
- (if (and (= (exists cando_dir) is_a_dir) (<> cando_dir nothing))
- (
- (working omp pci)
-
- ; the cando program icon
- (set cando_tool (tackon cando_dir "CanDo"))
- (if (= (exists cando_tool) is_a_file)
- (tooltype
- (dest cando_tool)
- (settooltype "IconDefaultTool" (cat quote deck_tool quote))
- (setstack 20480)
- (noposition)
- )
- )
-
- ; the reader program icon
- (set temp (tackon cando_dir "TheReader"))
- (if (= (exists temp) is_a_file)
- (
- (tooltype
- (dest temp)
- (noposition)
- )
- (set reader_tool temp)
- )
- (
- (set reader_tool "MORE")
- )
- )
-
- ; the readmefirst text file
- (set temp (tackon cando_dir "ReadMeFirst"))
- (if (= (exists temp) is_a_file)
- (tooltype
- (dest temp)
- (setdefaulttool reader_tool)
- (noposition)
- )
- )
- )
- (
- ; since we did not figure out some things we need to set these variables
- (set cando_tool "CanDo")
- (set reader_tool "More")
- )
- )
-
- ; tell the user of our progress
- (complete 35)
-
- ; copy over the decks and their resources
- (working omp "Scanning for example decks and resource files.")
-
- (set stuff_dir
- (copyfiles
- (prompt "Copying example decks and their resource files.")
- (help "This will copy the CanDo example decks and their "
- "resource files." newline newline
- @copyfiles-help
- )
- (source "CanDoProgram_Master:")
- (dest cando_dir)
- (pattern "(Images|Sounds|Text|Anims|BrushAnims|Brushes|Utilities|Decks)")
- (infos)
- (confirm)
- )
- )
-
- ; tell the user of our progress
- (complete 40)
-
- ; now patch the copied icons, if stuff_dir exists
- (if (and (= (exists stuff_dir) is_a_dir) (<> stuff_dir nothing))
- (
- (working omp pci)
-
- ; the drawer icons themselves
- (foreach stuff_dir "(Images|Sounds|Text|Anims|BrushAnims|Brushes|Utilities|Decks)"
- (tooltype
- (dest (tackon stuff_dir @each-name))
- (noposition)
- )
- )
-
- ; now set defaulttool of each of the decks
- (set decks_dir (tackon stuff_dir "Decks"))
- (if (and (= (exists decks_dir) is_a_dir) (<> decks_dir nothing))
- (foreach "CanDoProgram_Master:Decks" "~(#?.info)"
- (if (> 0 @each-type) ; hey its a file!
- (tooltype
- (dest (tackon decks_dir @each-name))
- (setdefaulttool deck_tool)
- (noposition)
- )
- )
- )
- )
-
- ; fix up the cando icon for these resources
- (if (= (exists cando_tool) is_a_file)
- (tooltype
- (dest cando_tool)
- (settooltype "Documents"
- (cat quote (tackon stuff_dir "Text") quote)
- )
- (settooltype "Images"
- (cat quote (tackon stuff_dir "Images") quote)
- )
- (settooltype "Sounds"
- (cat quote (tackon stuff_dir "Sounds") quote)
- )
- (settooltype "BrushAnims"
- (cat quote (tackon stuff_dir "BrushAnims") quote)
- )
- (settooltype "Brushes"
- (cat quote (tackon stuff_dir "Brushes") quote)
- )
- (settooltype "Applications"
- (cat quote (tackon stuff_dir "Applications") quote)
- )
- (settooltype "Decks"
- (cat quote decks_dir quote)
- )
- )
- )
- )
- (
- ; since we did not figure out the decks directory then set this var
- (set decks_dir nothing)
- )
- )
-
- ; tell the user of our progress
- (complete 45)
-
-
- ;************************************
- ;***** GET SECOND DISK IN HERE ******
- ;************************************
-
- ; ask for the second disk.
- (askdisk
- (prompt "Please insert the disk labeled \"CanDo Extras\".")
- (help "The CanDo Extras disk contains various overlays and "
- "support files for the CanDo program."
- )
- (dest "CanDoExtras")
- (newname "CanDoExtras_Master")
- )
-
- ; tell the user of our progress
- (complete 50)
-
-
- ;*****************************************
- ;***** COPY OVER SECOND DISK'S STUFF *****
- ;*****************************************
-
- ; copy over cando's files and overlays
- (working omp "Scanning for CanDo's data files and overlays.")
-
- ; due to a bug and because we want to still test we do this
- (set extras_dir
- (copyfiles
- (prompt "Copying CanDo's data files and overlays.")
- (help "This will copy the CanDo's data and overlay files."
- newline newline
- @copyfiles-help
- )
- (source "CanDoExtras_Master:")
- (dest cando_dir)
- (pattern "(CanDoFiles|EditorTools|HelpFiles|ObjectTools|XtraTools)")
- (infos)
- (confirm)
- )
- )
-
- ; tell the user of our progress
- (complete 55)
-
- ; now patch the copied icons, if stuff_dir exists
- (if (and (= (exists extras_dir) is_a_dir) (<> extras_dir nothing))
- (
- (working omp pci)
-
- ; the drawer icons themselves
- (foreach extras_dir "(CanDoFiles|EditorTools|HelpFiles|ObjectTools|XtraTools)"
- (tooltype
- (dest (tackon stuff_dir @each-name))
- (noposition)
- )
- )
-
- ; fix up the cando icon for these resources
- (if (= (exists cando_tool) is_a_file)
-
- ; are the extras dirs in the same place as cando?
- (if (= cando_dir extras_dir)
- ( ; if they are the same then we don't need the tooltypes
- (tooltype
- (dest cando_tool)
- (settooltype "CanDoFiles")
- (settooltype "EditorTools")
- (settooltype "HelpFiles")
- (settooltype "ObjectTools")
- (settooltype "XtraTools")
- )
- )
- ( ; if they are different then we need to fill in the tooltypes
- (tooltype
- (dest cando_tool)
- (settooltype "CanDoFiles"
- (cat quote (tackon extras_dir "CanDoFiles") quote)
- )
- (settooltype "EditorTools"
- (cat quote (tackon extras_dir "EditorTools") quote)
- )
- (settooltype "HelpFiles"
- (cat quote (tackon extras_dir "HelpFiles") quote)
- )
- (settooltype "ObjectTools"
- (cat quote (tackon extras_dir "ObjectTools") quote)
- )
- (settooltype "XtraTools"
- (cat quote (tackon extras_dir "XtraTools") quote)
- )
- )
- )
- )
- )
-
- ; Set up the base deck based on display type
- (working omp "Configuring CanDo to use " display_text " display.")
-
- ; since the cando is setup for ntsc we only need to this for pal mode
- (if (= display_mode pal_mode)
- (
- ; make up the tempory directory name
- (set temp_dir (tackon extras_dir "CanDoFiles/Overlays"))
-
- ; rename current (NTSC) base deck to basedeck.ntsc
- (rename
- (tackon temp_dir "BaseDeck")
- (tackon temp_dir "BaseDeck.NTSC")
- )
-
- ; rename basedeck.pal to basedeck
- (rename
- (tackon temp_dir "BaseDeck.PAL")
- (tackon temp_dir "BaseDeck")
- )
- )
- )
-
- ; tell the user of our progress
- (complete 60)
-
- ; clean up the drawers. remove any unneeded or out of date stuff
- (working omp "Scanning for any unneeded or out of date stuff.")
-
- ; removing out of date images from CanDoFiles
- (set temp_dir (tackon extras_dir "CanDoFiles"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; notify that we are working on this drawer
- (working omp "Cleaning up the CanDoFiles directory.")
-
- ; Delete CanDoFiles/UpAndDown.Grab
- (set temp_file (tackon temp_dir "UpAndDown.Grab"))
- (if (= (exists temp_file) is_a_file)
- (delete temp_file)
- )
-
- ; Delete CanDoFiles/EdToolStrip.Grab
- (set temp_file (tackon temp_dir "EdToolStrip.Grab"))
- (if (= (exists temp_file) is_a_file)
- (delete temp_file)
- )
-
- ; Delete CanDoFiles/DiskIcon.Grab
- (set temp_file (tackon temp_dir "DiskIcon.Grab"))
- (if (= (exists temp_file) is_a_file)
- (delete temp_file)
- )
- )
- )
-
- ; Removing some old (pre2.0) overlay files
- (set temp_dir (tackon extras_dir "CanDoFiles/Overlays"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; notify that we are working on this drawer
- (working omp "Cleaning up the Overlays directory.")
-
- ; Delete CanDoFiles/Overlays/Extras
- (set temp_file (tackon temp_dir "Extras"))
- (if (= (exists temp_file) is_a_file)
- (delete temp_file)
- )
-
- ; Delete CanDoFiles/Overlays/GeneralList
- (set temp_file (tackon temp_dir "GeneralList"))
- (if (= (exists temp_file) is_a_file)
- (delete temp_file)
- )
-
- ; Delete CanDoFiles/Overlays/LittleLister
- (set temp_file (tackon temp_dir "LittleLister"))
- (if (= (exists temp_file) is_a_file)
- (delete temp_file)
- )
-
- ; Delete CanDoFiles/Overlays/Misc
- (set temp_file (tackon temp_dir "Misc"))
- (if (= (exists temp_file) is_a_file)
- (delete temp_file)
- )
- )
- )
-
- ; Cleanup editor tools
- (set temp_dir (tackon extras_dir "EditorTools"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; notify that we are working on this drawer
- (working omp "Cleaning up the EditorTools directory.")
-
- ; delete the old routines tool if it exists
- (set my_dir (tackon temp_dir "Routines"))
- (if (= (exists my_dir) is_a_dir)
- (
- (delete (tackon my_dir "Resource"))
- (delete (tackon my_dir "ToolIcon.Grab"))
- (delete (tackon my_dir ".info"))
- (delete my_dir)
- (delete (cat my_dir ".info"))
- )
- )
-
- ; if the layout tool then it is out of date, slick it
- (set my_dir (tackon temp_dir "Layout"))
- (if (= (exists my_dir) is_a_dir)
- (
- ; first delete all the stuff in the directory
- (foreach my_dir "#?"
- (if (< 0 @each-type) ; hey its a directory!
- (
- ; if the item is a directory then delete inside
- (set my2_dir (tackon my_dir @each-name))
- (foreach my2_dir "#?"
- (delete (tackon my2_dir @each-name))
- )
-
- ; then delete the directory
- (delete my2_dir)
- )
- ; otherwise delete the file
- (delete (tackon my_dir @each-name))
- )
- )
-
- ; then delete the directory and its icon
- (delete my_dir)
- (delete (cat my_dir ".info"))
- )
- )
-
- ; if paint/brushes exists then delete it
- (set my_dir (tackon temp_dir "Paint/Brushes"))
- (if (= (exists my_dir) is_a_dir)
- (
- ; delete the brushes directory
- (delete (tackon my_dir "Complement.Grab"))
- (delete (tackon my_dir "Jam1.Grab"))
- (delete (tackon my_dir "Jam2.Grab"))
- (delete (tackon my_dir "PaintPanel.Grab"))
- (delete (tackon my_dir ".info"))
- (delete my_dir)
- (delete (cat my_dir ".info"))
- )
- )
- )
- )
-
- ; Clean up helpfiles directory
- (set temp_dir (tackon extras_dir "HelpFiles"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; notify that we are working on this drawer
- (working omp "Cleaning up the HelpFiles directory.")
-
- ; if file Main.Index exists then delete it
- (set temp_file (tackon temp_dir "Main.Index"))
- (if (= (exists temp_file) is_a_file)
- (delete temp_file)
- )
-
- ; if directories exists then delete them
- (if (exists (tackon temp_dir "ARexx"))
- (foreach temp_dir "#?"
- (if (< 0 @each-type) ; hey its a directory!
- (
- (set my_dir (tackon temp_dir @each-name))
- (foreach my_dir "#?"
- (delete (tackon my_dir @each-name))
- )
- (delete my_dir)
- (delete (cat my_dir ".info"))
- )
- )
- )
- )
- )
- )
-
- ; tell the user of our progress
- (complete 65)
-
- ; Cleanup object tools
- (set temp_dir (tackon extras_dir "ObjectTools"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; notify that we are working on this drawer
- (working omp "Cleaning up the ObjectTools directory.")
-
- ; delete the old routines tool if it exists
- (set my_dir (tackon temp_dir "Routines"))
- (if (= (exists my_dir) is_a_dir)
- (
- (delete (tackon my_dir "Resource"))
- (delete (tackon my_dir "Handler"))
- (delete (tackon my_dir ".info"))
- (delete my_dir)
- (delete (cat my_dir ".info"))
- )
- )
-
- ; delete old directory in document objecttool
- (set my_dir (tackon temp_dir "Document/Brushes"))
- (if (= (exists my_dir) is_a_dir)
- (
- ; the brushes directory
- (delete (tackon my_dir "ScrollBar.Grab"))
- (delete (tackon my_dir "ScrollBar.Grab.info"))
- (delete (tackon my_dir ".info"))
- (delete my_dir)
- (delete (cat my_dir ".info"))
- )
- )
-
- ; delete old directory in field objecttool
- (set my_dir (tackon temp_dir "Field/Brushes"))
- (if (= (exists my_dir) is_a_dir)
- (
- ; the brushes directory
- (delete (tackon my_dir "Justification.Grab"))
- (delete (tackon my_dir "Justification.Grab.info"))
- (delete (tackon my_dir ".info"))
- (delete my_dir)
- (delete (cat my_dir ".info"))
- )
- )
-
- ; delete old directory in Window objecttool
- (set my_dir (tackon temp_dir "Window/Brushes"))
- (if (= (exists my_dir) is_a_dir)
- (
- ; the brushes directory
- (delete (tackon my_dir "Objects.Grab"))
- (delete (tackon my_dir "Objects.Grab.info"))
- (delete (tackon my_dir ".info"))
- (delete my_dir)
- (delete (cat my_dir ".info"))
- )
- )
- )
- )
-
- ; Wipe out xtratools
- (set temp_dir (tackon extras_dir "XtraTools"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; notify that we are working on this drawer
- (working omp "Cleaning up the XtraTools directory.")
-
- ; delete everything except the Error object
- (foreach temp_dir "~(Error|Error.info)"
- (if (< 0 @each-type) ; hey its a directory!
- (
- (set my_dir (tackon temp_dir @each-name))
- (foreach my_dir "#?"
- (delete (tackon my_dir @each-name))
- )
- (delete my_dir)
- )
- (delete (tackon temp_dir @each-name))
- )
- )
- )
- )
- )
- )
-
- ; tell the user of our progress
- (complete 70)
-
-
- ;************************************
- ;***** GET THIRD DISK IN HERE ******
- ;************************************
-
- ; ask for the third disk.
- (askdisk
- (prompt "Please insert the disk labeled \"CanDo Examples and Utilities\".")
- (help "The CanDo Examples and Utilities disk contains various utilities and "
- "example decks for your use."
- )
- (dest "CanDoExamples")
- (newname "CanDoExamples_Master")
- )
-
- ; tell the user of our progress
- (complete 75)
-
-
- ;****************************************
- ;***** COPY OVER THIRD DISK'S STUFF *****
- ;****************************************
-
- ; copy cando example disk's decks, cliutilities and utilities stuff
- (working omp "Scanning for CanDo's utilities and example decks.")
-
- ; due to a bug and because we want to still test we do this
- (set mostuff_dir
- (copyfiles
- (prompt "Copying CanDo's utilities and example decks.")
- (help "This will copy the CanDo's utilities and example decks."
- newline newline
- @copyfiles-help
- )
- (source "CanDoExamples_Master:")
- (dest stuff_dir)
- (pattern "(CLIUtilities|Utilities|Errata.Doc|Decks)")
- (infos)
- (confirm)
- )
- )
-
- ; tell the user of our progress
- (complete 80)
-
- ; now patch the copied icons, if mostuff_dir exists
- (if (and (= (exists mostuff_dir) is_a_dir) (<> mostuff_dir nothing))
- (
- (working omp pci)
-
- ; first fix up the drawer icons
- (foreach mostuff_dir "(CLIUtilities|Utilities|Decks)"
- (tooltype
- (dest (tackon mostuff_dir @each-name))
- (noposition)
- )
- )
-
- ; then fix up the readme file icon
- (tooltype
- (dest (tackon mostuff_dir "Errata.Doc"))
- (noposition)
- (setdefaulttool reader_tool)
- )
-
- ; patch icons in the CLIutilities drawer
- (set temp_dir (tackon mostuff_dir "CLIUtilities"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; first the readme files
- (foreach temp_dir "#?.doc"
- (tooltype
- (dest (tackon temp_dir @each-name))
- (noposition)
- (setdefaulttool reader_tool)
- )
- )
-
- ; identify the deckbrowser tool
- (set browse_tool (tackon temp_dir "DeckBrowser"))
- (if (<> (exists browse_tool) is_a_file)
- (set browse_tool "DeckBrowser")
- )
-
- ; identify the shutdowndeck tool
- (set killdeck_tool (tackon temp_dir "ShutDownDeck"))
- (if (<> (exists killdeck_tool) is_a_file)
- (set killdeck_tool "ShutDownDeck")
- )
- )
- (
- ; else fill in tool vars with defaults
- (set browse_tool "DeckBrowser")
- (set killdeck_tool "ShutDownDeck")
- )
- )
-
- ; patch icons in the utilities drawer
- (set temp_dir (tackon mostuff_dir "Utilities"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; first the readme files
- (foreach temp_dir "#?.doc"
- (tooltype
- (dest (tackon temp_dir @each-name))
- (noposition)
- (setdefaulttool reader_tool)
- )
- )
-
- ; patch thebinder utility
- (set temp_file (tackon temp_dir "TheBinder"))
- (if (= (exists temp_file) is_a_file)
- (tooltype
- (dest temp_file)
- (settooltype "Source" (cat quote decks_dir quote))
- (settooltype "Destination" (cat quote "Ram:Application" quote))
- (settooltype "RunnerNeedsLibrary" (cat quote deck_tool quote))
- (settooltype "RunnerNoLibrary" (cat quote browse_tool quote))
- (settooltype "Binder" (cat quote bind_tool quote))
- (noposition)
- )
- )
-
- ; patch themultibinder utility
- (set temp_file (tackon temp_dir "TheMultiBinder"))
- (if (= (exists temp_file) is_a_file)
- (tooltype
- (dest temp_file)
- (settooltype "Source" (cat quote decks_dir quote))
- (settooltype "Destination" (cat quote "Ram:Application" quote))
- (settooltype "RunnerNeedsLibrary" (cat quote deck_tool quote))
- (settooltype "RunnerNoLibrary" (cat quote browse_tool quote))
- (settooltype "Binder" (cat quote bind_tool quote))
- (settooltype "ObjectsOnly" "No")
- (noposition)
- )
- )
-
- ; patch therelocator utility
- (set temp_file (tackon temp_dir "TheRelocator"))
- (if (= (exists temp_file) is_a_file)
- (tooltype
- (dest temp_file)
- (settooltype "Source" (cat quote decks_dir quote))
- (settooltype "Destination" (cat quote "Ram:NewDeck" quote))
- (noposition)
- )
- )
-
- ; patch theprinter utility
- (set temp_file (tackon temp_dir "ThePrinter"))
- (if (= (exists temp_file) is_a_file)
- (tooltype
- (dest temp_file)
- (settooltype "Source" (cat quote decks_dir quote))
- (noposition)
- )
- )
-
- ; patch stopcando utility
- (set temp_file (tackon temp_dir "StopCanDo"))
- (if (= (exists temp_file) is_a_file)
- (tooltype
- (dest temp_file)
- (settooltype "DeckKiller" (cat quote killdeck_dir quote))
- (noposition)
- )
- )
- )
- )
-
- ; tell the user of our progress
- (complete 85)
-
- ; patch icons in the decks drawer
- (set temp_dir (tackon mostuff_dir "Decks"))
- (if (and (= (exists temp_dir) is_a_dir) (<> temp_dir nothing))
- (
- ; then patch each drawer of decks
- (foreach "CanDoExamples_Master:Decks" "~(#?.info)"
- (if (< 0 @each-type) ; hey its a directory!
- (
- ; shorten the path
- (set my_dir (tackon temp_dir @each-name))
-
- ; now do the decks inside
- (foreach my_dir "~(#?.#?)"
- (if (> 0 @each-type) ; hey its a file!
- (tooltype
- (dest (tackon my_dir @each-name))
- (setdefaulttool deck_tool)
- (noposition)
- )
- )
- )
- (tooltype
- (dest (tackon my_dir "AboutTheseDecks.Doc"))
- (setdefaulttool reader_tool)
- (noposition)
- )
-
- ; patch the drawer's icon
- (tooltype
- (dest my_dir)
- (noposition)
- )
- )
- )
- )
-
- ; then patch the weird sub-dirs: subdecks
- (set my_dir (tackon temp_dir "ComplexExamples/SubDecks"))
- (if (= (exists temp_dir) is_a_dir)
- (
- (foreach my_dir "~(#?.#?)" ;<- no icons
- (tooltype
- (dest (tackon my_dir @each-name))
- (setdefaulttool deck_tool)
- (noposition)
- )
- )
- )
- )
-
- ; then patch the weird sub-dirs: helpfiles
- (set my_dir (tackon temp_dir "ComplexExamples/BudgetHelpFiles"))
- (if (= (exists temp_dir) is_a_dir)
- (
- (foreach my_dir "BudHelp.???" ;<- no icons
- (tooltype
- (dest (tackon my_dir @each-name))
- (setdefaulttool reader_tool)
- (noposition)
- )
- )
- )
- )
- )
- )
- )
- )
-
- ; tell the user of our progress
- (complete 90)
-
- ; copy any cando example disk xtratools that may exists.
- (working omp "Scanning for additional XtraTools.")
-
- ; scan the directory
- (set temp_dir "CanDoExamples_Master:MoreXtraTools")
- (if (= (exists temp_dir) is_a_dir)
- ( ; if they exists then copy the directory
- (copyfiles
- (prompt "Copying additional XtraTools.")
- (help "This will copy the additional XtraTools from the Examples Disk."
- newline newline
- @copyfiles-help
- )
- (source temp_dir)
- (dest (tackon extras_dir "XtraTools"))
- (pattern "#?")
- (infos)
- (confirm)
- )
-
- ; adjust the tooltype for CanDo
- (tooltype
- (dest cando_tool)
- (settooltype "MenuTools" "ConfigCanDo|Proportional|ObjectLayer|SuperDuper|BookMark|LastBookMark")
- )
- )
- ( ; else none where found
- (working "No additional XtraTools where found.")
- )
- )
-
- ; tell the user of our progress
- (complete 95)
-
- ; copy any cando example disk editortools that may exists.
- (working omp "Scanning for additional EditorTools.")
-
- ; scan the directory
- (set temp_dir "CanDoExamples_Master:MoreEditorTools")
- (if (= (exists temp_dir) is_a_dir)
- ( ; if they exists then copy the directory
- (copyfiles
- (prompt "Copying additional EditorTools.")
- (help "This will copy the additional EditorTools from the Examples Disk."
- newline newline
- @copyfiles-help
- )
- (source temp_dir)
- (dest (tackon extras_dir "EditorTools"))
- (pattern "#?")
- (infos)
- (confirm)
- )
- )
- ( ; else none where found
- (working "No additional EditorTools where found.")
- )
- )
-
- ; modify S:User-Startup
- (working omp "Updating S:User-Startup.")
-
- (startup "CanDo"
- (prompt
- "Some instructions need to be added to the \"S:User-Startup\" "
- "so that your system will be properly configured to use CanDo.")
- (help @startup-help)
- (command
- "ASSIGN CanDo: " quote cando_dir quote newline
- "ASSIGN CanDoExtras: " quote extras_dir quote newline
- "ASSIGN CanDoExamples: " quote mostuff_dir quote newline
- )
- )
-
- ; tell the user of our progress
- (complete 100)
-
-
- ;*****************************
- ;***** WE BE ALMOST DONE *****
- ;*****************************
-
- ; make sure that default-dir is pointing to the right place
- (set @default-dest cando_dir)
-
- ; some debug stuff
- (if testing
- (
- (debug (cat "cando_dir = " quote cando_dir quote))
- (debug (cat "c_dir = " quote c_dir quote))
- (debug (cat "libs_dir = " quote libs_dir quote))
- (debug (cat "deck_tool = " quote deck_tool quote))
- (debug (cat "bind_tool = " quote bind_tool quote))
- (debug (cat "browse_tool = " quote browse_tool quote))
- (debug (cat "killdeck_tool = " quote killdeck_tool quote))
- (debug (cat "cando_tool = " quote cando_tool quote))
- (debug (cat "reader_tool = " quote reader_tool quote))
- (debug (cat "stuff_dir = " quote stuff_dir quote))
- (debug (cat "mostuff_dir = " quote mostuff_dir quote))
- (debug (cat "decks_dir = " quote decks_dir quote))
- )
- )
-
- ; unmake those three assignments
- (makeassign "CanDoProgram_Master" (safe))
- (makeassign "CanDoExtras_Master" (safe))
- (makeassign "CanDoExamples_Master" (safe))
-
- ; final message for our viewers
- ; well either way we want to say this
- (set end_text "Well thats it folks, have a fun time with CanDo v2.00.") ; altspace in name
-
- ; if the system has a library loaded then ask user to reset their machine
- (if (> resident_candolib 0)
- (set end_text
- (cat
- "!! REBOOT YOUR MACHINE BEFORE USING CANDO !!"
- newline
- newline
- "This machine has an old version of CanDo.library in memory. "
- "In order to flush the library you should reboot your machine."
- newline
- newline
- end_text
- )
- )
- )
-
- ; now for the real exit
- (exit end_text)
-