home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Contrib / CD-Write-Demo / Install < prev   
Text File  |  1995-10-10  |  11KB  |  332 lines

  1. ;
  2. ;CD-Write-Demo installation script - $VER: Install_CD-Write_MP 1.1 (18.9.95)
  3. ;Copyright © 1995 by Ralph Babel
  4. ;all rights reserved
  5. ;
  6.  
  7. (set lang (patmatch "deutsch" @language))
  8.  
  9. (if (= lang 0)
  10.  (
  11.   (set txt-yes "Yes")
  12.   (set txt-no "No")
  13.   (set txt-prompt-rw "Please enter the name of CD-Write's modifications directory:")
  14.   (set txt-help-rw "The directory name to be entered determines in which directory CD-Write is expected to store the modification data. This directory must be located on a medium that can always be written to.\n\n")
  15.   (set txt-no-rw "The parent directory you specified ...\n\n»%s«\n\n... does not exist.\n\nPlease create it first, or correct your input.")
  16.   (set txt-bad-rw "The name of the modifications directory must not contain spaces, quotation marks, or vertical bars \"|\".\n\nPlease correct your input.")
  17.   (set txt-confirm-rw "So you want CD-Write to store its modification data in the directory ...\n\n»%s«\n\n...?")
  18.   (set txt-error-rw "The directory you specified ...\n\n»%s«\n\n... could not be created.\n\nPlease verify your input.")
  19.   (set txt-prompt-cdw "Enter the DOS device name under which CD-Write should be mounted:")
  20.   (set txt-help-cdw "CD-Write's DOS device name must be specified without a trailing colon and must not yet be assigned.\n\n")
  21.   (set txt-bad-cdw "The DOS device name must not contain spaces, quotation marks, or colons.\n\nPlease correct your input.")
  22.   (set txt-dup-cdw "The DOS device name ...\n\n»%s«\n\n... has already been assigned.\n\nPlease correct your input.")
  23.   (set txt-prompt-l "Into which directory should the filesystem code be copied?")
  24.   (set txt-bad-l "The name of the filesystem directory must not contain spaces or quotation marks.\n\nPlease correct your input.")
  25.   (set txt-prompt-ml "Into which MountList file should the MountList entry be inserted?")
  26.   (set txt-help-ml "The MountList entry is required so that CD-Write can be mounted automatically.\n\n")
  27.   (set txt-bad-ml "The name of the MountList file must not contain quotation marks.\n\nPlease correct your input.")
  28.   (set txt-prompt-startup "The following command ...\n\n%s\n\n... must be added to your User-Startup file.")
  29.   (set txt-help-startup "This command serves to mount CD-Write every time upon system start-up.\n\n")
  30.   (set txt-prompt-dd "Into which directory should the new DOSDrivers entry be copied?")
  31.   (set txt-help-dd "Devices with an associated DOSDrivers entry are mounted automatically upon system start-up. The directory in which these entries are located must already exist; it is not created automatically.\n\n")
  32.   (set txt-prompt-mount "Should »%s« be mounted now using the command ...\n\n»%s«\n\n...?")
  33.   (set txt-help-mount "If »%s« is not mounted at this point, CD-Write won't become active until after the next reboot.")
  34.   (set txt-info ":Pearls/text/Babylon/cdwrite/cdwrite-e.txt")
  35.   (set txt-exit "Have fun!")
  36.   (set txt-abort "Installation not possible.\n\nCD-Write requires at least Kickstart 2.04.")
  37.  )
  38. )
  39.  
  40. (if (= lang 1)
  41.  (
  42.   (set txt-yes "Ja")
  43.   (set txt-no "Nein")
  44.   (set txt-prompt-rw "Bitte legen Sie das Änderungsdatenverzeichnis für CD-Write fest:")
  45.   (set txt-help-rw "Der einzugebende Verzeichnisname legt fest, in welchem Verzeichnis CD-Write die Änderungsdaten ablegen soll. Dieses Verzeichnis muß sich auf einem ständig beschreibbaren Medium befinden.\n\n")
  46.   (set txt-no-rw "Das von Ihnen angegebene übergeordnete Verzeichnis ...\n\n»%s«\n\n... existiert nicht.\n\nBitte legen Sie es erst an, oder berichtigen Sie Ihre Eingabe.")
  47.   (set txt-bad-rw "Der Name des Änderungsdatenverzeichnisses darf weder Leerzeichen noch Anführungszeichen, noch den vertikalen Strich \"|\" enthalten.\n\nBitte berichtigen Sie Ihre Eingabe.")
  48.   (set txt-confirm-rw "CD-Write soll also seine Änderungsdaten im Verzeichnis ...\n\n»%s«\n\n... ablegen?")
  49.   (set txt-error-rw "Das von Ihnen angegebene Verzeichnis ...\n\n»%s«\n\n... konnte nicht angelegt werden.\n\nBitte überprüfen Sie Ihre Eingabe.")
  50.   (set txt-prompt-cdw "Unter welchem DOS-Gerätenamen soll CD-Write angemeldet werden?")
  51.   (set txt-help-cdw "Der DOS-Gerätename von CD-Write muß ohne Doppelpunkt spezifiziert werden und darf noch nicht vergeben sein.\n\n")
  52.   (set txt-bad-cdw "Der DOS-Gerätename darf weder Leerzeichen noch Anführungszeichen, noch Doppelpunkte enthalten.\n\nBitte berichtigen Sie Ihre Eingabe.")
  53.   (set txt-dup-cdw "Der DOS-Gerätename ...\n\n»%s«\n\n... ist bereits vergeben.\n\nBitte berichtigen Sie Ihre Eingabe.")
  54.   (set txt-prompt-l "In welches Verzeichnis soll das Dateisystem kopiert werden?")
  55.   (set txt-bad-l "Der Name des Dateisystemverzeichnisses darf weder Leerzeichen noch Anführungszeichen enthalten.\n\nBitte berichtigen Sie Ihre Eingabe.")
  56.   (set txt-prompt-ml "In welche MountList-Datei soll der MountList-Eintrag eingefügt werden?")
  57.   (set txt-help-ml "Der MountList-Eintrag wird benötigt, um CD-Write automatisch anmelden zu können.\n\n")
  58.   (set txt-bad-ml "Der Name der MountList-Datei darf keine Anführungszeichen enthalten.\n\nBitte berichtigen Sie Ihre Eingabe.")
  59.   (set txt-prompt-startup "Das folgende Kommando ...\n\n%s\n\n... muß in Ihre User-Startup-Datei eingefügt werden.")
  60.   (set txt-help-startup "Dieses Kommando meldet CD-Write bei jedem Systemstart an.\n\n")
  61.   (set txt-prompt-dd "In welchem Verzeichnis soll der DOSDrivers-Eintrag angelegt werden?")
  62.   (set txt-help-dd "Geräte mit zugehörigem DOSDrivers-Eintrag werden bei jedem Systemstart automatisch angemeldet. Das Verzeichnis, in dem diese Einträge liegen, muß bereits existieren; es wird nicht automatisch angelegt.\n\n")
  63.   (set txt-prompt-mount "Soll »%s« bereits jetzt durch den Befehl ...\n\n»%s«\n\n... angemeldet werden?")
  64.   (set txt-help-mount "Wird »%s« jetzt nicht angemeldet, so wird CD-Write erst nach einem Neustart aktiv.")
  65.   (set txt-info ":Pearls/text/Babylon/cdwrite/cdwrite-d.txt")
  66.   (set txt-exit "Die Installation von CD-Write ist beendet.\n\n\nViel Spaß!")
  67.   (set txt-abort "Installation nicht möglich.\n\nCD-Write setzt zumindest Kickstart 2.04 voraus.")
  68.  )
  69. )
  70.  
  71. (if (>= (getversion) $00250084)
  72.  (
  73.   (complete 0)
  74.   (welcome)
  75.   (set oldlevel @user-level)
  76.  
  77.   (user 1)
  78.  
  79.   (set rw-dir (tackon @default-dest "cdwdata"))
  80.   (set ok false)
  81.   (until ok
  82.    (set rw-dir
  83.     (askdir
  84.      (default rw-dir)
  85.      (prompt txt-prompt-rw)
  86.      (help txt-help-rw @askdir-help)
  87.      (newpath)
  88.     )
  89.    )
  90.  
  91.    (set rw-dir-path (pathonly rw-dir))
  92.    (set rw-dir-last (fileonly rw-dir))
  93.  
  94.    (if (exists rw-dir-path)
  95.     (
  96.      (if (or (patmatch "#? #?" rw-dir-path) (not (patmatch "#?:#?" rw-dir-path)))
  97.       (set rw-dir-path (expandpath rw-dir-path))
  98.      )
  99.  
  100.      (set i 0)
  101.      (set found false)
  102.      (until found
  103.       (set found (= (substr rw-dir-path i 1) ":"))
  104.       (if (not found)
  105.        (set i (+ i 1))
  106.       )
  107.      )
  108.  
  109.      (set rw-dir-dev (substr rw-dir-path 0 (+ i 1)))
  110.  
  111.      (if (patmatch "#? #?" rw-dir-dev)
  112.       (
  113.        (set rw-dir-dev (getdevice rw-dir-dev))
  114.        (if (not (patmatch "#? #?" rw-dir-dev))
  115.         (set rw-dir-path (cat rw-dir-dev ":" (substr rw-dir-path (+ i 1))))
  116.        )
  117.       )
  118.      )
  119.  
  120.      (set rw-dir (tackon rw-dir-path rw-dir-last))
  121.  
  122.      (set ok (not (patmatch "#?[ \"|]#?" rw-dir)))
  123.      (if ok
  124.       (
  125.        (set ok
  126.         (askbool
  127.          (choices txt-yes txt-no)
  128.          (default 1)
  129.          (prompt (txt-confirm-rw rw-dir))
  130.          (help txt-help-rw)
  131.         )
  132.        )
  133.        (if ok
  134.         (
  135.          (if (not (exists rw-dir (noreq)))
  136.           (
  137.            (trap 4 (makedir rw-dir))
  138.            (if (<> @error-msg "")
  139.             (
  140.              (message (txt-error-rw rw-dir))
  141.              (set ok false)
  142.             )
  143.            )
  144.           )
  145.          )
  146.         )
  147.        )
  148.       )
  149.       (message txt-bad-rw)
  150.      )
  151.     )
  152.     (message (txt-no-rw rw-dir-path))
  153.    )
  154.   )
  155.  
  156.   (user oldlevel)
  157.  
  158.   (set suffix 0)
  159.   (set ok false)
  160.   (until ok
  161.    (set cdw-name (cat "CDW" suffix))
  162.    (exists (cat cdw-name ":") (noreq))
  163.    (set ok (= (getassign cdw-name "d") ""))
  164.    (if (not ok)
  165.     (set suffix (+ suffix 1))
  166.    )
  167.   )
  168.  
  169.   (if (<> suffix 0)
  170.    (if (= @user-level 0)
  171.     (user 1)
  172.    )
  173.   )
  174.  
  175.   (set ok false)
  176.   (until ok
  177.    (set cdw-name
  178.     (askstring
  179.      (default cdw-name)
  180.      (prompt txt-prompt-cdw)
  181.      (help txt-help-cdw @askstring-help)
  182.     )
  183.    )
  184.  
  185.    (set ok (not (patmatch "#?[ \":]#?" cdw-name)))
  186.    (if ok
  187.     (
  188.      (exists (cat cdw-name ":") (noreq))
  189.      (set ok (= (getassign cdw-name "d") ""))
  190.      (if (not ok)
  191.       (message (txt-dup-cdw cdw-name))
  192.      )
  193.     )
  194.     (message txt-bad-cdw)
  195.    )
  196.   )
  197.  
  198.   (user oldlevel)
  199.  
  200.   (set l-dir "L:")
  201.   (set ok false)
  202.   (until ok
  203.    (
  204.     (set l-dir
  205.      (askdir
  206.       (default l-dir)
  207.       (prompt txt-prompt-l)
  208.       (help @askdir-help)
  209.      )
  210.     )
  211.  
  212.     (if (not (patmatch "#?:#?" l-dir))
  213.      (set l-dir (expandpath l-dir))
  214.     )
  215.  
  216.     (set ok (not (patmatch "#?[ \"]#?" l-dir)))
  217.     (if (not ok)
  218.      (message txt-bad-l)
  219.     )
  220.    )
  221.   )
  222.  
  223.   (set base-dir ":Contrib/CD-Write-Demo")
  224.  
  225.   (copyfiles
  226.    (source (tackon base-dir "l/BabelCDWriteFS"))
  227.    (dest l-dir)
  228.   )
  229.  
  230.   (complete 25)
  231.  
  232.   (if (< (shiftright (getversion "libs:version.library") 16) 38)
  233.    (
  234.     (set ml-file "DEVS:MountList")
  235.     (set ok false)
  236.     (until ok
  237.      (
  238.       (set ml-file
  239.        (askfile
  240.         (default ml-file)
  241.         (prompt txt-prompt-ml)
  242.         (help txt-help-ml @askfile-help)
  243.        )
  244.       )
  245.  
  246.       (set ok (not (patmatch "#?\"#?" ml-file)))
  247.       (if (not ok)
  248.        (message txt-bad-ml)
  249.       )
  250.      )
  251.     )
  252.  
  253.     (set tmp (cat "T:MountList." cdw-name ".tmp"))
  254.     (set entry (cat "\n" cdw-name ": Handler   = " (tackon l-dir "BabelCDWriteFS") "\n      Startup   = Meeting_Pearls_III:|" rw-dir "\n      StackSize = 4096\n      Priority  = 10\n      GlobVec   = -1\n      Mount     = 1\n#\n\n"))
  255.     (if (exists ml-file)
  256.      (textfile
  257.       (dest tmp)
  258.       (append entry)
  259.       (include ml-file)
  260.       (safe)
  261.      )
  262.      (textfile
  263.       (dest tmp)
  264.       (append entry)
  265.       (safe)
  266.      )
  267.     )
  268.  
  269.     (copyfiles
  270.      (source tmp)
  271.      (dest (pathonly ml-file))
  272.      (newname (fileonly ml-file))
  273.      (optional "fail" "force" "askuser")
  274.     )
  275.     (delete tmp (safe))
  276.  
  277.     (complete 50)
  278.  
  279.     (if (= ml-file "DEVS:MountList")
  280.      (set mount-cmd (cat "Mount " cdw-name ":"))
  281.      (set mount-cmd (cat "Mount " cdw-name ": From \"" ml-file "\""))
  282.     )
  283.  
  284.     (startup @app-name
  285.      (command mount-cmd)
  286.      (prompt (txt-prompt-startup mount-cmd))
  287.      (help txt-help-startup @startup-help)
  288.     )
  289.    )
  290.    (
  291.     (set dd-dir
  292.      (askdir
  293.       (default "DEVS:DOSDrivers")
  294.       (prompt txt-prompt-dd)
  295.       (help txt-help-dd @askdir-help)
  296.       (newpath)
  297.      )
  298.     )
  299.  
  300.     (set tmp (tackon dd-dir cdw-name))
  301.     (textfile
  302.      (dest tmp)
  303.      (append cdwname "Handler   = " (tackon l-dir "BabelCDWriteFS") "\nStartup   = Meeting_Pearls_III:|" rw-dir "\nStackSize = 4096\nPriority  = 10\nGlobVec   = -2\nMount     = 1\n")
  304.     )
  305.  
  306.     (copyfiles
  307.      (source (tackon base-dir "DOSDrivers/CDW0.info"))
  308.      (dest dd-dir)
  309.      (newname (cat cdw-name ".info"))
  310.     )
  311.  
  312.     (set mount-cmd (cat "Mount \"" tmp "\""))
  313.    )
  314.   )
  315.  
  316.   (complete 75)
  317.  
  318.   (run mount-cmd
  319.    (prompt (txt-prompt-mount cdw-name mount-cmd))
  320.    (help (txt-help-mount cdw-name))
  321.    (confirm)
  322.   )
  323.  
  324.   (run (cat "run >nil: :C/MetaTool " txt-info " TEXT") (safe))
  325.  
  326.   (complete 100)
  327.   (set @default-dest "")
  328.   (exit txt-exit)
  329.  )
  330.  (abort txt-abort)
  331. )
  332.