home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / fish / disks / d1101.lha / Programs / C_dt / Install < prev    next >
Encoding:
Text File  |  1995-07-09  |  4.0 KB  |  164 lines

  1. ;
  2. ; $PROJECT: c.datatype
  3. ;
  4. ; $VER: Install 39.2 (09.07.95)
  5. ;
  6. ; by
  7. ;
  8. ; Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  9. ;
  10. ; (C) Copyright 1995
  11. ; All Rights Reserved !
  12. ;
  13. ; $HISTORY:
  14. ;
  15. ; 09.07.95 : 039.002 : some portions from Marius Gröger (CPU selection)
  16. ; 12.03.95 : 039.001 : initial
  17. ;
  18.  
  19. (set cpu (database "cpu"))
  20.  
  21. (set #datatype "c.datatype")
  22. (set #datatype-desc (cat "C(%|++)-Source"))
  23.  
  24. (set mode
  25.       (askchoice
  26.             (prompt @app-name)
  27.             (help @askchoice-help)
  28.             (choices "Install" "Remove")
  29.       )
  30. )
  31.  
  32. (if mode
  33.           (set pmode "Remove")
  34.           (set pmode "Install")
  35. )
  36.  
  37. ; get classes dir
  38. (set classdir
  39.           (askdir
  40.                      (prompt "Where do the Classes belong")
  41.                      (help @askdir-help)
  42.                      (default "SYS:Classes")
  43.           )
  44. )
  45.  
  46. ; now do install or remove
  47. (if mode
  48.           ; Remove
  49.           (
  50.                      ; Show what we are doing
  51.                      (working "Removing " @app-name)
  52.  
  53.                      ; Remove the non-standard pieces
  54.                      (delete (tackon classdir "datatypes" #datatype))
  55.                      (delete (cat "devs:datatypes/" #datatype-desc) (infos))
  56.  
  57.                      ; Don't want to use the confusing "Installation Complete" message
  58.                      ; when what we really did was remove things...
  59.                      (message "The \"" @app-name "\" components "
  60.                                  "that you specified have been successfully removed")
  61.                      (exit (quiet))
  62.           )
  63.  
  64.           ; Install
  65.           (
  66.                      (working "Installing " @app-name)
  67.  
  68.                      (set #dtname (tackon "classes/datatypes" #datatype))
  69.  
  70.                      (if (OR (= cpu "68000") (= cpu "68010")) (set #cpuchoice 0))
  71.                      (if (= cpu "68020")                      (set #cpuchoice 1))
  72.                      (if (= cpu "68030")                      (set #cpuchoice 2))
  73.                      (if (OR (= cpu "68040") (= cpu "68060")) (set #cpuchoice 3))
  74.  
  75.                      ; choose cpu type
  76.                      (set proc
  77.                         (askchoice
  78.                             (prompt (cat "There are diffent versions of \"" #datatype "\", each one optimized "
  79.                                              "for a specific CPU type. Please select one: "))
  80.                             (choices "MC68000" "MC68020" "MC68030" "MC68040")
  81.                             (help (cat "  Select here the CPU type that is installed in your system. "
  82.                                     "\n\n  Currently, this is a MC" cpu ".\n\n  If you select a certain CPU type "
  83.                                     "in the choice box, the \"" #datatype "\" will run on any CPU which "
  84.                                     "type is higher or equal to the selection. However, it won't "
  85.                                     "run on a system equipped with a lower type.\n\n"
  86.                                     @askchoice-help)
  87.                             )
  88.                             (default #cpuchoice)
  89.                         )
  90.                      )
  91.  
  92.                      (copylib
  93.                                 (prompt (cat "Copying the Datatype"))
  94.                                 (help @copylib-help)
  95.                                 (source (cat (tackon "classes/datatypes" #datatype)
  96.                                               (if (= 0 proc) ".000")
  97.                                               (if (= 1 proc) ".020")
  98.                                               (if (= 2 proc) ".030")
  99.                                               (if (= 3 proc) ".040")
  100.                                 ))
  101.                                 (dest (tackon classdir "Datatypes"))
  102.                                 (newname #datatype)
  103.                                 (confirm)
  104.                      )
  105.  
  106.                      ; Install the descriptors
  107.                      (copyfiles
  108.                                 (prompt "Copying the Descriptors")
  109.                                 (help @copyfiles-help)
  110.                                 (source "devs/datatypes")
  111.                                 (dest "DEVS:DataTypes")
  112.                                 (pattern "#?")
  113.                                 (infos)
  114.                                 (confirm)
  115.                      )
  116.  
  117.                      ; Install prefs file
  118.                      (if     (askbool
  119.                                           (prompt "Install Prefs file ?")
  120.                                           (help @askbool-help)
  121.                                 )
  122.                                 (
  123.                                           (copyfiles
  124.                                                      (help @copyfiles-help)
  125.                                                      (source "envarc/datatypes/c.prefs")
  126.                                                      (dest "EnvArc:DataTypes")
  127.                                           )
  128.                                           (copyfiles
  129.                                                      (help @copyfiles-help)
  130.                                                      (source "envarc/datatypes/c.prefs")
  131.                                                      (dest "Env:DataTypes")
  132.                                           )
  133.                                 )
  134.                      )
  135.  
  136.                      ; install doc file
  137.                      (copyfiles
  138.                                 (prompt "Copying autodoc file")
  139.                                 (help @copyfiles-help)
  140.                                 (source "doc")
  141.                                 (dest "AutoDocs:")
  142.                                 (pattern "#?")
  143.                                 (confirm)
  144.                      )
  145.  
  146.                      ; install AmigaGuide file
  147.                      (copyfiles
  148.                                 (prompt "Copying AmigaGuide file")
  149.                                 (help @copyfiles-help)
  150.                                 (source "help")
  151.                                 (dest "AmigaGuide:")
  152.                                 (pattern "#?")
  153.                                 (confirm)
  154.                      )
  155.  
  156.                      ; Tell the system about the new descriptors
  157.                      (run "C:AddDataTypes Refresh")
  158.  
  159.           )
  160. )
  161.  
  162. (set @default-dest classdir)
  163.  
  164.