home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 3 / MA_Cover_3.iso / bazy / ax / install_ax < prev    next >
Encoding:
Text File  |  1997-10-04  |  13.8 KB  |  390 lines

  1. ; Install-Script for Ax 1.0
  2.  
  3. (set #bad-kick
  4.    (cat "\n\nSorry! You must have Workbench 2.04 or"
  5.         "\nhigher to to use this package."
  6.         "\n\nAborting Installation!"))
  7.  
  8.  
  9. (set #no-classact
  10.    (cat "\nHmmm!  You don't seem to have the ClassAct 2.0"
  11.         "\nGUI system installed.  You can obtain the"
  12.         "\nlatest ClassAct classes via ftp on the"
  13.         "\nInternet at: \n\n ftp.warped.com/pub/amiga/classact/"
  14.         "\n\nDo you wish to continue installation?"))
  15.  
  16. (set #Help-ContInstall
  17.    (cat "\nThis package requires ClassAct 2.0, which does not"
  18.         "\nappear to be installed on your system.  Select"
  19.         "\n'Continue' to intall the program anyway, or select"
  20.         "\n'Abort' to end the installation."))
  21.  
  22. ; ---------------------------------------------------------------------------
  23.  
  24. ; ************* PLEASE COPY THIS PROCEDURE ALONG WITH THE STRINGS IT USES
  25. ; ************* TO THE INSTALLER SCRIPT OF YOUR CLASSACT APPLICATION.
  26. ; ************* IT WILL TAKE CARE OF INSTALLING THE CLASSACT CLASSES YOU
  27. ; ************* PROVIDED WITH YOUR APPLICATION TO THE USER'S SYSTEM.
  28.  
  29. ; ClassAct installation procedure V 1.5 (12.5.96) by Osma Ahvenlampi
  30.  
  31. ; percentage of the size of included ClassAct classes versus the whole
  32. ; distribution (ie. total "complete" percentage after ClassAct is installed)
  33. (set classact-complete 90)
  34.  
  35. ; ClassAct installer scripts
  36. (set #classdest-prompt "Please select the directory where you want the ClassAct classes installed.\n(See help for details)")
  37. (set #classdest-help (cat "ClassAct is a GUI toolkit consisting of shared BOOPSI classes.\n\nSome programs require some or all of the ClassAct classes installed on your system. "
  38.     (if v39 (cat "OS 3.0 has a standard directory for BOOPSI classes, the SYS:Classes directory. It is recommended that you install ClassAct there.")
  39.             (cat "OS 2.0 does not have a standard place for disk resident BOOPSI classes. On OS 3.0 these classes are stored in the SYS:Classes directory. It is recommended that you create this directory and install ClassAct there.\nThis directory must be added in the LIBS: assign. This can be done by placing the command\nAssign >NIL: LIBS: SYS:Classes ADD\nto User-Startup. This installer will do this for you.")
  40.         )
  41.     )
  42. )
  43. (set #classes-020 "Do you want to use the OS 3.0, 020 optimised version of ClassAct?")
  44. (set #help-020 "Some ClassAct libraries have versions optimised for use on 020 or better equipped OS 3.0 or later machines. If your Amiga is such equipped, you should install these. The 68000/2.0 versions will also work, but are slightly slower.")
  45. (set #noclasses-message "The directory you selected for your ClassAct classes is not a part of the LIBS: assign.\n\nIt is necessary to add this assign so that the classes will be found properly.")
  46. (set #creating-dir "Creating directory ")
  47. (set #usbackup-prompt "User-Startup will now be backed up.")
  48. (set #usbackup-help "This installer will next make a modification in User-Startup. Before doing this the old User-Startup will be backed up to S:User-Startup.old")
  49. (set #adding-1 "Adding ")
  50. (set #adding-2 " to LIBS: assign\n")
  51. (set #adding-help "This is necessary so that the custom classes can be found.")
  52. (set #junod-button "It seems you have a late Commodore 'V42' button.gadget installed on your system.\n\nClassAct's button.gadget is far more capable than this gadget, and we recommend that you replace it. The ClassAct button.gadget is backwards compatible to the Commodore gadget. Do you wish to back up the Commodore gadget and replace it with the ClassAct version?")
  53. (set #junod-backed "The Commodore 'V42' button.gadget has been backed up with the name button.gadget.v42.\n\nThe ClassAct button.gadget will be installed in its place.")
  54. (set #junod-kept "The Commodore 'V42' button.gadget was not replaced with the more capable ClassAct version.\n\nPrograms depending on the availability of ClassAct-only features will be likely to work wrong.")
  55. (set #caprefs-message "CAPrefs is a small utility that sets some user preferences for ClassAct applications. These include the bevel style (Thin/Gadtools/Xen), window backfills, and group label details.\n\nPlease use the ClassAct GUI prefs editor to alter the default settings provided. ClassAct prefs will be installed in your system Prefs drawer.\n\n")
  56. (set #caprefs-startup-1 "Adding the command\n\n")
  57. (set #caprefs-startup-2 "\n\nTo your s:User-Startup.")
  58.  
  59. (procedure install-classact
  60. ; call this procedure to copy the classes included in the Classes directory
  61. ; in your distribution dir.
  62.      (if (exists "Classes") ; The archive contains a ClassAct library update.
  63.      (
  64.           (set comp-dest  (/ (* classact-complete 2) 10))
  65.           (set comp-libs  (/ (* classact-complete 3) 10))
  66.           (set comp-dirs  (/ (* classact-complete 4) 10))
  67.           (set comp-junod (/ (* classact-complete 5) 10))
  68.           (set comp-020   (/ (* classact-complete 6) 10))
  69.           (set comp-gad   (/ (* classact-complete 7) 10))
  70.           (set comp-im    (/ (* classact-complete 8) 10))
  71.           (set comp-prefs (/ (* classact-complete 9) 10))
  72.  
  73.           ; has the user installed ClassAct in CLASSACT: ?
  74.           (set @classact-dest (getassign "CLASSACT" "A"))
  75.           (if (= @classact-dest "") (set @classact-dest "SYS:Classes"))
  76.  
  77.           ; is ClassAct already in SYS:Classes ?
  78.           (if (or (not (exists (tackon @classact-dest "Gadgets/layout.gadget") (noreq)))
  79.                   (= @user-level 2))
  80.               ; no, ask where it should be placed
  81.               (set @classact-dest
  82.                   (askdir
  83.                       (prompt #classdest-prompt)
  84.                       (help #classdest-help)
  85.                       (default @classact-dest)
  86.                       (newpath)
  87.                   )
  88.               )
  89.           )
  90.  
  91.           (complete comp-dest)
  92.  
  93.           (if (<> (run (cat "C/CheckAssign LIBS: " @classact-dest)) 0)
  94.               (
  95.                   (message #noclasses-message)
  96.                   (if (not (exists @classact-dest))
  97.                        (makedir @classact-dest (prompt (cat #creating-dir @classact-dest)))
  98.                    )
  99.                   (set @addassign (cat "Assign >NIL: LIBS: " @classact-dest " ADD\n"))
  100.                   (startup "CLASSACT"
  101.                     (command @addassign)
  102.                       (prompt (cat #adding-1 @classact-dest #adding-2))
  103.                       (help #adding-help)
  104.                   )
  105.                   (run (@addassign))
  106.               )
  107.           )
  108.  
  109.           (complete comp-libs)
  110.  
  111.           (set @classact-gadgets (tackon @classact-dest "Gadgets"))
  112.           (set @classact-images (tackon @classact-dest "Images"))
  113.  
  114.           (if (not (exists @classact-gadgets (noreq)))
  115.               (makedir @classact-images
  116.                   (prompt (cat #creating-dir @classact-gadgets))
  117.               )
  118.           )
  119.  
  120.           (if (not (exists @classact-images (noreq)))
  121.               (makedir @classact-images
  122.                   (prompt (cat #creating-dir @classact-images))
  123.               )
  124.           )
  125.  
  126.           (complete comp-dirs)
  127.  
  128.           (if (exists "SYS:Classes/Gadgets/button.gadget")
  129.               (if (< 41 (/ (getversion "SYS:Classes/Gadgets/button.gadget") 65536))
  130.                   (if (askbool (prompt #junod-button) (help @askbool-help) (default 1))
  131.                       (
  132.                           (rename "SYS:Classes/Gadgets/button.gadget" "SYS:Classes/Gadgets/button.gadget.v42")
  133.                           (message #junod-backed)
  134.                       )
  135.                       (message #junod-kept)
  136.                   )
  137.               )
  138.           )
  139.  
  140.           (complete comp-junod)
  141.  
  142.           (if (exists "Classes/Gadgets/layout.gadget.020")
  143.                (set classes-020 (askbool (prompt #classes-020) (help #help-020) (default (and cpu020 v39))))
  144.                (set classes-020 0)
  145.           )
  146.  
  147.           (complete comp-020)
  148.  
  149.           (foreach "Classes/Gadgets" "#?.gadget"
  150.                (
  151.                     (set thislib (tackon "Classes/Gadgets" @each-name))
  152.                     (if (and classes-020 (exists (cat thislib ".020")))
  153.                          (set thislib (cat thislib ".020"))
  154.                     )
  155.                    (copylib (source thislib)
  156.                        (dest @classact-gadgets)
  157.                        (newname @each-name)
  158.                        (prompt (cat #installing @each-name))
  159.                        (help #classdest-help)
  160.                        (optional "force" "askuser")
  161.                    )
  162.               )
  163.           )
  164.  
  165.           (complete comp-gad)
  166.  
  167.           (foreach "Classes/Images" "#?.image"
  168.                (
  169.                     (set thislib (tackon "Classes/Images" @each-name))
  170.                     (if (and classes-020 (exists (cat thislib ".020")))
  171.                          (set thislib (cat thislib ".020"))
  172.                     )
  173.                    (copylib (source thislib)
  174.                        (dest @classact-images)
  175.                        (newname @each-name)
  176.                        (prompt (cat #installing @each-name))
  177.                        (help #classdest-help)
  178.                        (optional "force" "askuser")
  179.                    )
  180.               )
  181.           )
  182.  
  183.           (complete comp-im)
  184.  
  185.           (foreach "Classes" "#?.class"
  186.                (
  187.                     (set thislib (tackon "Classes" @each-name))
  188.                     (if (and classes-020 (exists (cat thislib ".020")))
  189.                          (set thislib (cat thislib ".020"))
  190.                     )
  191.                    (copylib (source thislib)
  192.                        (dest @classact-dest)
  193.                        (newname @each-name)
  194.                        (prompt (cat #installing @each-name))
  195.                        (help #classdest-help)
  196.                        (optional "force" "askuser")
  197.                    )
  198.               )
  199.           )
  200.      )
  201.      )
  202.      (if (exists "Prefs/ClassAct") ; The archive contains ClassAct prefs tools
  203.      (
  204.           (message #caprefs-message)
  205.  
  206.           (copylib (source "Prefs/CAPrefs")
  207.                (dest "C:")
  208.                (prompt (cat #installing "CAPrefs"))
  209.           )
  210.           (copylib (source "Prefs/ClassAct")
  211.                (dest "SYS:Prefs")
  212.                (prompt (cat #installing "ClassAct Prefs"))
  213.                (infos)
  214.           )
  215.  
  216.           (complete comp-prefs)
  217.  
  218.           (if (not (exists "ENVARC:ClassAct" (noreq)))
  219.                (
  220.                     (makedir "ENVARC:ClassAct"
  221.                          (prompt (cat #creating-dir "ENVARC:ClassAct"))
  222.                     )
  223.                     (textfile (dest "ENVARC:ClassAct/ClassAct")
  224.                          (append "")
  225.                     )
  226.                )
  227.           )
  228.  
  229.           (set caprefs-cmd "C:CAPrefs >NIL:\n")
  230.  
  231.           (startup "CAPREFS"
  232.                (prompt (cat #caprefs-startup-1 caprefs-cmd #caprefs-startup-2))
  233.                (help #caprefs-message)
  234.                (command caprefs-cmd)
  235.           )
  236.      )
  237.      )
  238.  
  239.      (complete classact-complete)
  240. )
  241.  
  242. ; ************** END OF CLASSACT INSTALL PROCEDURE. COPY THE BLOCK ABOVE
  243. ; ************** TO YOUR CLASSACT APPLICATION INSTALLER.
  244.  
  245. ; ---------------------------------------------------------------------------
  246.  
  247. (complete 0)
  248.  
  249. (if (< (getversion) (* 37 65536))
  250.         (abort #bad-kick)
  251. )
  252.  
  253. ; determine cpu type
  254. (set cpu (database "cpu"))
  255.  
  256. (set defcpu
  257.      (if (OR (= cpu "68000") (= cpu "68010"))
  258.           (set defcpu 0)
  259.           (set defcpu 1)
  260.      )
  261. )
  262.  
  263. ; ------------------------------
  264. ; Check if ClassAct 2.0 installed
  265. ; ------------------------------
  266.  
  267. (if (< (getversion "libs:window.class") (* 41 65536))
  268.    (set ContInstall
  269.              (askbool
  270.                 (prompt #no-classact)
  271.                 (help #Help-ContInstall)
  272.                 (default 0)
  273.                 (choices "Continue Installation" "Abort Installation")
  274.              )
  275.    )
  276. )
  277.  
  278. (if (= ContInstall 1)
  279.         (abort "\nInstallation Aborted!")
  280. )
  281.  
  282. (set @default-dest
  283.      (askdir
  284.           (prompt "In which directory would you like Ax installed? (A directory will be created there.)")
  285.           (help @askdir-help)
  286.           (default @default-dest)
  287.      )
  288. )
  289.  
  290. (set maindir (tackon @default-dest "Ax"))
  291.  
  292. (set axver
  293.      (askchoice
  294.           (prompt "Which executable type of Ax would you like installed?")
  295.           (help @askchoice-help)
  296.           (choices "68000" "68030+")
  297.           (default defcpu)
  298.      )
  299. )
  300.  
  301. (set rexxdir
  302.      (askdir
  303.           (prompt "In which directory would you like Ax's ARexx scripts installed?")
  304.           (help @askdir-help)
  305.           (default (tackon maindir "Rexx"))
  306.           (newpath)
  307.      )
  308. )
  309.  
  310. (set helpdir
  311.      (askdir
  312.           (prompt "In which directory would you like Ax's AmigaGuide documentation installed?")
  313.           (help @askdir-help)
  314.           (default maindir)
  315.           (newpath)
  316.      )
  317. )
  318.  
  319. (select axver
  320.      (copyfiles
  321.           (prompt "Copying main executable (Ax)...")
  322.           (help @copyfiles-help)
  323.           (source "Ax")
  324.           (dest maindir)
  325.           (infos)
  326.           (optional "nofail")
  327.      )
  328.  
  329.      (copyfiles
  330.           (prompt "Copying main executable (Ax030)...")
  331.           (help @copyfiles-help)
  332.           (source "Ax030")
  333.           (dest maindir)
  334.           (infos)
  335.           (newname "Ax")
  336.           (optional "nofail")
  337.      )
  338. )
  339.  
  340. (copyfiles
  341.      (prompt "Copying UpdateDB utility...")
  342.      (help @copyfiles-help)
  343.      (source "UpdateDB")
  344.      (dest maindir)
  345.      (optional "nofail")
  346. )
  347.  
  348. (complete 25)
  349.  
  350. (copyfiles
  351.      (prompt "Copying AmigaGuide documentation...")
  352.      (help @copyfiles-help)
  353.      (source "Docs/Ax.guide")
  354.      (dest helpdir)
  355.      (infos)
  356.      (optional "nofail")
  357. )
  358.  
  359. ; .guide file uses AmigaGuide instead of MultiView for OS <= V38
  360. (set ver (/ (getversion) 65536))
  361.  
  362. (if (<= ver 38)
  363.      (tooltype
  364.           (dest (tackon helpdir "Ax.guide"))
  365.           (setdefaulttool "AmigaGuide")
  366.      )
  367. )
  368.  
  369. (complete 30)
  370.  
  371. (copyfiles
  372.      (prompt "Copying ARexx scripts...")
  373.      (help @copyfiles-help)
  374.      (source "Rexx")
  375.      (dest rexxdir)
  376.      (confirm)
  377.      (pattern "#?.ax")
  378.      (infos)
  379.      (optional "nofail")
  380. )
  381.  
  382. (complete 50)
  383.  
  384. (install-classact)
  385.  
  386. (complete 100)
  387.  
  388. (exit)
  389.  
  390.