home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / SGMLS / Install < prev    next >
Text File  |  1999-11-24  |  5KB  |  165 lines

  1. ;
  2. ; Installer script for sgmls
  3. ;
  4. ; Copyright © 1995,1999 Dipl.-Inform. Kai Hofmann
  5. ; All rights reserved!
  6. ; Released without any explicit or implicit warranty!
  7. ;
  8. ; EMail: hofmann@hofmann-int.de
  9. ; WWW  : http://www.hofmann-int.de/
  10. ;
  11. ; $VER: Install 43.2 (24.11.99)
  12. ;
  13. ; -----------------------------------------------------------------------------
  14.  
  15.  (set #welcome (cat "Welcome to the sgmls parser!\n\n"))
  16.  (set #iuquest ("What do you want to do with the %s parser?\n\n" @app-name))
  17.  (set #iuc1    "Install")
  18.  (set #iuc2    "Uninstall")
  19.  (set #use37   ("You must be using OS 2.04 or higher to install and use the %s parser" @app-name))
  20.  (set #exedestdir ("Where do you want to install the %s parser?" @app-name))
  21.  (set #docdestdir "To which directory should I copy the .doc files?")
  22.  (set #del1 "Deleting .info file - it is created by an installer bug!")
  23.  (set #remove ("Removing %s" @app-name))
  24.  (set #notfound "Sorry, could not found %s")
  25.  (set #endunin ("\nUninstalling %s finished, but if you have installed the docs, so please remove them by hand!" @app-name))
  26.  (set #delete-help "Delete a file")
  27.  (set #cplprompt "Copying %s to %s")
  28.  
  29. ; --- GetCPU ------------------------------------------------------------------
  30.  
  31.  (procedure P_GetCPU
  32.   ; Param:
  33.   ;
  34.   ; Results:
  35.   ; #cpu #cpu_str
  36.   ; -1 = unknown; 0 = 68000; 1 = 68010; 2 = 68020; 3 = 68030; 4 = 68040;
  37.   ;          5 = 68060
  38.   ;
  39.   ; Used Vars:
  40.  
  41.   (set #cpu_str (database "cpu"))
  42.   (set #cpu 0)
  43.   (while (<> #cpu_str (select #cpu "68000" "68010" "68020" "68030" "68040" "68060" #cpu))
  44.     (set #cpu (+ #cpu 1))
  45.   )
  46.   (if (= #cpu 6)
  47.     (
  48.      (set #cpu -1)
  49.      (set #cpu_str -1)
  50.     )
  51.   )
  52.  
  53.  )
  54.  
  55. ; -----------------------------------------------------------------------------
  56.  
  57.  (if (= 0 (askchoice (prompt #iuquest)
  58.                      (choices #iuc1 #iuc2)
  59.                      (default 0)
  60.                      (help @askchoice-help)
  61.           )
  62.      )
  63.      (
  64.       ; Install
  65.       (if (< (/ (getversion) 65536) 37)
  66.           (abort #use37)
  67.       )
  68.       (welcome #welcome)
  69.       (complete 0)
  70.       (set @default-dest "c:")
  71.       (set @default-dest (askdir (prompt #exedestdir)
  72.                                  (default @default-dest)
  73.                                  (help @askdir-help)
  74.                          )
  75.       )
  76.       (copyfiles (prompt (#cplprompt @app-name @default-dest))
  77.                  (source "c")
  78.                  (choices "sgmlsasp" "rast")
  79.                  (dest @default-dest)
  80.                  (optional "askuser")
  81.                  (help @copyfiles-help)
  82.       )
  83.       (P_GetCPU)
  84.       (if (= #cpu 1)
  85.         (
  86.          (set #cpu 0)
  87.          (set #cpu_str "68000")
  88.         )
  89.         (if (= #cpu 3)
  90.           (
  91.            (set #cpu 2)
  92.            (set #cpu_str "68020")
  93.           )
  94.           (if (= #cpu -1)
  95.             (
  96.              (set #cpu 0)
  97.              (set #cpu_str "68000")
  98.             )
  99.           )
  100.         )
  101.       )
  102.       (copyfiles (prompt (#cplprompt @app-name @default-dest))
  103.                  (source (cat "c/sgmls" #cpu_str))
  104.                  (dest @default-dest)
  105.                  (all)
  106.                  (optional "askuser")
  107.                  (newname "sgmls")
  108.                  (help @copyfiles-help)
  109.       )
  110.       (complete 50)
  111.       (set destination (askdir (prompt #docdestdir)
  112.                                (default "SYS:")
  113.                                (help @askdir-help)
  114.                        )
  115.       )
  116.       (copyfiles (prompt (#cplprompt @app-name destination))
  117.                  (source "docs/")
  118.                  (dest destination)
  119.                  (infos)
  120.                  (all)
  121.                  (optional "askuser")
  122.                  (help @copyfiles-help)
  123.       )
  124.       (delete (tackon destination ".info")
  125.               (prompt #del1)
  126.               (optional "force")
  127.               (help #delete-help)
  128.       )
  129.       (complete 100)
  130.      )
  131. ;else
  132.      (
  133.       ; Uninstall
  134.       (if (exists "c:sgmls" (noreq))
  135.           (delete "c:sgmls"
  136.                   (prompt #remove)
  137.                   (help #delete-help)
  138.                   (optional "force")
  139.           )
  140.           (message (#notfound "sgmls"))
  141.       )
  142.       (complete 33)
  143.       (if (exists "c:sgmlsasp" (noreq))
  144.           (delete "c:sgmlsasp"
  145.                   (prompt #remove)
  146.                   (help #delete-help)
  147.                   (optional "force")
  148.           )
  149.           (message (#notfound "sgmlsasp"))
  150.       )
  151.       (complete 66)
  152.       (if (exists "c:rast" (noreq))
  153.           (delete "c:rast"
  154.                   (prompt #remove)
  155.                   (help #delete-help)
  156.                   (optional "force")
  157.           )
  158.           (message (#notfound "rast"))
  159.       )
  160.       (complete 100)
  161.       (message #endunin)
  162.       (exit (quiet))
  163.      )
  164.  )
  165.