home *** CD-ROM | disk | FTP | other *** search
/ The Amiga Game Guide / AmigaGameGuide_CD.iso / Amiga / Tools / WHDLoad / Install < prev    next >
Text File  |  1977-12-31  |  4KB  |  158 lines

  1. ;----------------------------
  2. ; Check version and install if newer
  3. ; IN:    #source-file
  4. ;    #dest-file
  5.  
  6. (procedure P_install
  7.   (set #sver (getversion #source-file))
  8.   (if
  9.     (exists #dest-file)
  10.     (set #dver (getversion #dest-file))
  11.     (set #dver 0)
  12.   )
  13.   (if
  14.     (< #sver #dver)
  15.     (abort
  16.       "The installation has determinated that the already installed program"
  17.       ("\"%s\" has a newer version than the program to install." #source-file)
  18.       "The current WHDLoad package seems to be outdated. Therefore the"
  19.       "installation will be canceled. Please try to get a newer version of"
  20.       "the WHDLoad package."
  21.     )
  22.   )
  23.   (set #prompt ("\nNow installing the program\n\n\"%s\" with version %ld.%ld\n\n" (fileonly #source-file) (/ #sver 65536) (BITAND #sver 65535)))
  24.   (if
  25.     (> #dver 0)
  26.     (set #prompt ("%sby overwriting\n\n\"%s\" with version %ld.%ld" #prompt #dest-file (/ #dver 65536) (BITAND #dver 65535)))
  27.     (set #prompt ("%sinto the directory\n\n\"%s\"" #prompt (pathonly #dest-file)))
  28.   )
  29.   (if
  30.     (= @user-level 2)
  31.     (set #choice
  32.       (askbool
  33.         (prompt #prompt)
  34.         (default 1)
  35.         (choices "Install" "Skip")
  36.         (help @askbool-help)
  37.       )
  38.     )
  39.     (set #choice 1)
  40.   )
  41.   (if
  42.     (= #choice 1)
  43.     (copyfiles
  44.       (help @copyfiles-help)
  45.       (source #source-file)
  46.       (dest (pathonly #dest-file))
  47.       (newname (fileonly #dest-file))
  48.     )
  49.   )
  50. )
  51.  
  52. ;----------------------------
  53.  
  54. (if
  55.   (exists "C/InstallBB")
  56.   (set #mode "dev")
  57.   (set #mode "usr")
  58. )
  59.  
  60. (if
  61.   (= #mode "dev")
  62.   (welcome
  63.     "Welcome to the WHDLoad installation.\n"
  64.     "This script will copy all files which need a special location to their recommend places.\n"
  65.     "All other files like the source examples and the Install Templates will not copied."
  66.     "Therefore it is recommend to move this drawer yourself to your prefered location.\n"
  67.     "If you don't want to install all provided programs, please select the expert mode where you can skip these."
  68.   )
  69.   (welcome
  70.     "Welcome to the WHDLoad installation."
  71.   )
  72. )
  73.  
  74. (set @default-dest
  75.   (askdir
  76.     (prompt "Where should WHDLoad and the other tools installed ?\nThe location must be reachable via the path !\nRecommend is \"C:\".")
  77.     (help @askdir-help)
  78.     (default "C:")
  79.     (disk)
  80.   )
  81. )
  82.  
  83. (set #path "C")
  84. (foreach #path "#?"
  85.   (set #source-file (tackon #path @each-name))
  86.   (set #dest-file   (tackon @default-dest @each-name))
  87.   (P_install)
  88. )
  89.  
  90. (if
  91.   (= #mode "dev")
  92.   (
  93.     (set #dest
  94.       (askdir
  95.         (prompt "Where should the include files installed ?")
  96.         (help @askdir-help)
  97.         (default "Includes:")
  98.       )
  99.     )
  100.     (set #path "include")
  101.     (foreach #path "#?"
  102.       (copyfiles
  103.         (help @copyfiles-help)
  104.         (source (tackon #path @each-name))
  105.         (dest #dest)
  106.       )
  107.     )
  108.     (set #dest
  109.       (askdir
  110.         (prompt "Where should the autodoc file installed ?")
  111.         (help @askdir-help)
  112.         (default "Autodocs:")
  113.       )
  114.     )
  115.     (copyfiles
  116.       (help @copyfiles-help)
  117.       (source "autodoc/whdload.doc")
  118.       (dest #dest)
  119.     )
  120.     (exit
  121.       "\n"
  122.       "Installation is complete.\n"
  123.       "\n"
  124.       "All files which need a special location has been copied.\n"
  125.       "Please move all other files yourself to your prefered place.\n"
  126.       "\n"
  127.       "Hope WHDLoad and the tools will be useful for you.\n"
  128.       "\n"
  129.       "Bye Bert."
  130.       (quiet)
  131.     )
  132.   )
  133.   (
  134.     (set #dest
  135.       (askdir
  136.         (prompt "Where should the documentation for WHDLoad installed ?\nA drawer WHDLoad will be created there.")
  137.         (help @askdir-help)
  138.         (default "Help:")
  139.       )
  140.     )
  141.     (copyfiles
  142.       (help @copyfiles-help)
  143.       (source "Docs")
  144.       (dest (tackon #dest "WHDLoad"))
  145.       (all)
  146.       (infos)
  147.     )
  148.     (exit
  149.       "\n"
  150.       "Installation is now complete.\n"
  151.       "Please read the documentation carefully on how to use and configure WHDLoad for your needs."
  152.       (quiet)
  153.     )
  154.   )
  155. )
  156.  
  157.  
  158.