home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Raytracing / Raytracer / EDG-IFX0.DMS / in.adf / Install_Extras_2.1 < prev    next >
Encoding:
Text File  |  1995-04-14  |  10.2 KB  |  354 lines

  1. ; ImageFX 2.1 Extras Patch Install Script
  2. ;
  3. ; Written by Thomas Krehbiel
  4. ;
  5. ; Copyright © 1995 Nova Design, Inc.
  6. ; All Rights Reserved
  7.  
  8. (
  9.  
  10.    ;================================================================
  11.    ; Procedure Definitions
  12.    ;================================================================
  13.  
  14.    (procedure RunLhex
  15.       ; pf_archive = name of archive to extract from
  16.       ; pf_name = name of file to extract
  17.       ; tempdir = directory to extract to
  18.       (
  19.          (set pf_error
  20.             (run
  21.                ("RAM:lhex -a -f \"-w=%s\" x %s %s"
  22.                   tempdir
  23.                   pf_archive
  24.                   pf_name
  25.                )
  26.             )
  27.          )
  28.       )
  29.    )
  30.  
  31.    (procedure RunPatch
  32.       ; pf_old = old version of file
  33.       ; pf_new = where to put new version of file
  34.       ; pf_patch = name of patch file
  35.       (
  36.          (set pf_error
  37.             (run
  38.                ("RAM:spatch \"-o%s\" \"-p%s\" \"%s\""
  39.                   pf_new
  40.                   pf_patch
  41.                   pf_old
  42.                )
  43.             )
  44.          )
  45.       )
  46.    )
  47.  
  48.    (procedure DoPatch
  49.       ; pf_name = name of file with path
  50.       ; wheredir = where old files reside
  51.       ; patchdir = where patches reside
  52.       (
  53.          (set pf_user (tackon wheredir pf_name))
  54.          (set pf_old (tackon tempdir pf_name))
  55.          (set pf_new ("%s.new" (tackon wheredir pf_name)))
  56.          (set pf_patch ("%s.pch" (tackon patchdir pf_name)))
  57.          (if (exists pf_user)
  58.             (
  59.                ; only if it was installed
  60.                (working "Reading " pf_archive)
  61.                (RunLhex)
  62.                (if pf_error
  63.                   (
  64.                      (message "LHEX failed on `" pf_archive "'.")
  65.                   )
  66.                )
  67.                (working "Updating " pf_name)
  68.                (RunPatch)
  69.                (if pf_error
  70.                   (
  71.                      (message "Patch failed on file `" pf_user "'.")
  72.                   )
  73.                   ; else
  74.                   (
  75.                      (delete pf_user)
  76.                      (rename pf_new pf_user)
  77.                   )
  78.                )
  79.                (delete pf_old)
  80.             )
  81.          )
  82.       )
  83.    )
  84.  
  85.    ;================================================================
  86.    ; Setup
  87.    ;================================================================
  88.  
  89.    ; script variables...
  90.  
  91.    (set versionname "2.1")                      ; version number
  92.    (set programname ("ImageFX Extras %s" versionname)) ; name of program
  93.    (set diskname1 "ImageFX_Disk1:")             ; install disk name
  94.    (set diskname2 "ImageFX_Disk2:")             ; second install disk name
  95.    (set diskname3 "ImageFX_Disk3:")             ; third install disk name
  96.    (set diskname4 "ImageFX_Disk4:")             ; fourth install disk name
  97.    (set pdiskname1 "")                          ; patch install disk name
  98.  
  99.    (set tempdir "T:")
  100.  
  101.    ; system information...
  102.  
  103.    (set osver (/ (getversion) 65536))        ; os version
  104.    (set cputype (database "cpu"))            ; cpu type
  105.  
  106.    ;-------------------
  107.    ; Pick a default directory for the installation...
  108.    (set initialdir @default-dest)            ; defaults to biggest drive
  109.    (if (getassign "ImageFX")
  110.       (
  111.          (set initialdir (getassign "ImageFX"))
  112.       )
  113.       ; else
  114.       (
  115.          (if (getassign "ImageFX2")
  116.             (
  117.                (set initialdir (getassign "ImageFX2"))
  118.                ; if we found ImageFX2:, assume user wants to keep ImageFX2:
  119.                (set assignname "ImageFX2")
  120.             )
  121.          )
  122.       )
  123.    )
  124.  
  125.    ;-------------------
  126.    ; Warn user.
  127.    (message "These 'extras' were either not created by Nova Design, Inc., "
  128.             "or are based on software not created or supported by Nova Design.  "
  129.             "Because of this, Nova Design cannot provide technical support for these extras.  "
  130.             "They are provided for your amusement only; use them at your own risk.  "
  131.             "If you do not want to install them, click `Abort Install' now.")
  132.  
  133.  
  134.    (set tryagain 1)
  135.    (while tryagain
  136.       (
  137.  
  138.          (set tryagain 0)
  139.  
  140.          ;-------------------
  141.          ; Ask where to install it...
  142.          ;(set wheredir initialdir)
  143.          (set wheredir
  144.             (askdir
  145.                (prompt "Select the directory where ImageFX is currently installed.  The extras in "
  146.                        "this directory will be updated to version " versionname ".  All of your "
  147.                        "preferences will be preserved.  NOTE:  You will need your original ImageFX 2.0 "
  148.                        "disks to apply this update.")
  149.                (help @askdir-help)
  150.                (default initialdir)
  151.             )
  152.          )
  153.  
  154.          ;-------------------
  155.          ; Make sure it's a valid ImageFX
  156.          (set checkvar 0)
  157.          (set checkvar (+ checkvar (exists (tackon wheredir "Modules/Sys/Scale"))))
  158.          (set checkvar (+ checkvar (exists (tackon wheredir "Hooks/Sys/PaintFX"))))
  159.          (if (= 0 checkvar)
  160.             (
  161.                (message "`" wheredir "' does not appear to contain a copy of ImageFX 2.0.")
  162.                (set tryagain 1)
  163.                (set initialdir wheredir)
  164.             )
  165.          )
  166.  
  167.       )
  168.    )
  169.  
  170.    (message "The " programname " update will be installed in the drawer `" wheredir "'.  If this is correct, click `Proceed'.")
  171.  
  172.    (set @default-dest wheredir)
  173.  
  174.    ;-------------------
  175.    ; Ask which versions of modules the user wants to install.
  176.    ;(set cpu
  177.    ;   (askchoice
  178.    ;      (prompt "Select which versions of hooks and modules you would "
  179.    ;              "like to install:")
  180.    ;      (help "Some ImageFX hooks and modules (such as the JPEG modules) "
  181.    ;            "have alternate versions optimized for faster processors. "
  182.    ;            "You may choose to install only the modules optimized for "
  183.    ;            "the processor in your machine to save hard drive space.")
  184.    ;      (choices
  185.    ;         "For Any Processor"
  186.    ;         "For 68000 Or 68010"
  187.    ;         "For 68020 Or 68030, No Floating Point"
  188.    ;         "For 68020 Or 68030, With Floating Point"
  189.    ;         "For 68040, With Floating Point"
  190.    ;      )
  191.    ;      (default 0)
  192.    ;   )
  193.    ;)
  194.  
  195.    ;-------------------
  196.    ; Ask which components to install
  197.    (set todo
  198.       (askoptions
  199.          (prompt "Select the " versionname " Extras you would like to install "
  200.                  "(Extras that are installed from previous versions of ImageFX "
  201.                  "will be updated automatically):")
  202.          (help "Check the boxes to indicate which extras you would like "
  203.                "installed on your system.")
  204.          (choices
  205.             "CyberGraphics Render Module"
  206.             "JSTREAM Loader & Saver Modules"
  207.          )
  208.       )
  209.    )
  210.  
  211.    (set mask_cyber   1)
  212.    (set mask_jstream 2)
  213.  
  214.    ;================================================================
  215.    ; PATCH EXISTING FILES
  216.    ;================================================================
  217.  
  218.    ;-------------------
  219.    ; Copy SPATCH to RAM: for speediness
  220.    (copyfiles
  221.       (prompt "")
  222.       (help "")
  223.       (source pdiskname1)
  224.       (dest "RAM:")
  225.       (choices "spatch")
  226.    )
  227.  
  228.    ;================================================================
  229.    ; DISK 1
  230.    ;================================================================
  231.  
  232.    (askdisk
  233.       (prompt "Please insert ImageFX 2.0 Disk 1 in any drive.")
  234.       (help "")
  235.       (dest (substr diskname1 0 (- (strlen diskname1) 1)))
  236.    )
  237.  
  238.    ;-------------------
  239.    ; Copy LHEX to RAM: for speediness
  240.    (copyfiles
  241.       (prompt "")
  242.       (help "")
  243.       (source diskname1)
  244.       (dest "RAM:")
  245.       (choices "lhex")
  246.    )
  247.  
  248.    ;-------------------
  249.    ; Begin by extracting our patch archive into the user's
  250.    ; chosen ImageFX directory.  This will be deleted at the end.
  251.  
  252.    (working "Extracting Update Files...")
  253.  
  254.    (set patchdir (tackon wheredir "PatchesX"))
  255.    (makedir patchdir)
  256.  
  257.    (run
  258.       ("RAM:lhex >CON:0/0//80/lhex/AUTO -a -f \"-w=%s\" x %s"
  259.          patchdir
  260.          (tackon pdiskname1 "PatchesX.lha")
  261.       )
  262.    )
  263.  
  264.    ;================================================================
  265.    ; DISK 4
  266.    ;================================================================
  267.  
  268.    ; only patch postscript if it's there already
  269.    (if (exists (tackon wheredir "Modules/Loaders/PostScript"))
  270.       (
  271.  
  272.          (askdisk
  273.             (prompt "Please insert ImageFX 2.0 Disk 4 in any drive.")
  274.             (help "")
  275.             (dest (substr diskname4 0 (- (strlen diskname4) 1)))
  276.          )
  277.  
  278.          ; copy hooks.lha to ram for speed
  279.          (copyfiles
  280.             (prompt "")
  281.             (help "")
  282.             (source diskname4)
  283.             (dest tempdir)
  284.             (choices "Extras1.lha")
  285.          )
  286.  
  287.          (set pf_archive (tackon tempdir "Extras1.lha"))
  288.  
  289.          (set pf_name "Modules/Loaders/PostScript") (DoPatch)
  290.  
  291.          (delete (tackon tempdir "Extras1.lha"))
  292.          (run ("delete %s all quiet" (tackon tempdir "Modules")))
  293.  
  294.       )
  295.    )
  296.  
  297.    ;================================================================
  298.    ; INSTALL NEW FILES
  299.    ;================================================================
  300.  
  301.    ; don't need these any more
  302.    (delete "RAM:spatch")
  303.    (delete "RAM:lhex")
  304.  
  305.    (if (BITAND mask_cyber todo)
  306.       (
  307.          (copyfiles
  308.             (prompt "")
  309.             (help "")
  310.             (source (tackon patchdir "Modules/Render"))
  311.             (dest (tackon wheredir "Modules/Render"))
  312.             (choices "CyberGraphics.000" "CyberGraphics.030")
  313.          )
  314.       )
  315.    )
  316.  
  317.    (if (BITAND mask_jstream todo)
  318.       (
  319.          (copyfiles
  320.             (prompt "")
  321.             (help "")
  322.             (source (tackon patchdir "Modules/Loaders"))
  323.             (dest (tackon wheredir "Modules/Loaders"))
  324.             (choices "JSTREAM.000" "JSTREAM.030" "JSTREAM.040")
  325.          )
  326.          (copyfiles
  327.             (prompt "")
  328.             (help "")
  329.             (source (tackon patchdir "Modules/Savers"))
  330.             (dest (tackon wheredir "Modules/Savers"))
  331.             (choices "JSTREAM.000" "JSTREAM.030" "JSTREAM.040")
  332.          )
  333.          (copyfiles
  334.             (prompt "")
  335.             (help "")
  336.             (source (tackon patchdir "Help"))
  337.             (dest (tackon wheredir "Help"))
  338.             (choices "JStream.guide" "JStream.guide.info")
  339.          )
  340.       )
  341.    )
  342.  
  343.    ; delete the patches
  344.    (run ("delete %s all quiet" patchdir))
  345.  
  346.    ; Installation complete!
  347. )
  348.  
  349. ; Revision History:
  350. ;
  351. ;  14.04.95 tek   Created for Beta 2 release.
  352. ;
  353.  
  354.