home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 18 / amigaformatcd18.iso / +look_here_1st!+ / af_on_the_web / websites / weirdscience / downloads / miami20n.lha / Install_Miami next >
Text File  |  1997-04-09  |  8KB  |  302 lines

  1. (procedure check-system-version
  2.  (set exec-version (/ (getversion) 65536))
  3.  (if (< exec-version 37)
  4.   (abort "Miami 2.0 needs Kickstart 2.04 or higher.\n")
  5.  )
  6.  (if (< exec-version 39)
  7.   (set ag-browser "AmigaGuide")
  8.   (set ag-browser "MultiView")
  9.  )
  10. )
  11.  
  12. (procedure select-destination-directory
  13.  (if (exists "Miami:" (noreq))
  14.   (
  15.    (set old-miami-assign 1)
  16.    (set old-miami-assign-location (expandpath "Miami:"))
  17.    (set @default-dest
  18.     (askdir
  19.      (prompt "Select the directory where you want to "
  20.       "install Miami 2.0. You already have a 'Miami:' "
  21.       "assign on your system, so it is assumed that this "
  22.       "is the location of an older version of Miami that "
  23.       "you want to upgrade.")
  24.      (help "Select the directory where you want to "
  25.       "install Miami 2.0. Since you already have a 'Miami:' "
  26.       "assign on your system you should probably accept "
  27.       "the default.")
  28.      (default "Miami:")
  29.     )
  30.    )
  31.   ) (
  32.    (set old-miami-assign 0)
  33.    (set @default-dest
  34.     (askdir
  35.      (prompt "Select the directory where you want to "
  36.       "install Miami 2.0. Most of the files do not have "
  37.       "to be copied if you accept the default. A separate "
  38.       "directory WILL NOT be created at the location you "
  39.       "specify.")
  40.      (help "Select the directory where you want to "
  41.       "install Miami 2.0. You can choose to install "
  42.       "'in-place', i.e. within the directory where your "
  43.       "Miami files are currently located, or you can have "
  44.       "Miami installed in a different location, copying "
  45.       "all files.")
  46.      (default source-dir)
  47.     )
  48.    )
  49.   )
  50.  )
  51.  (makeassign "Miami" @default-dest)
  52. )
  53.  
  54. (procedure check-registered
  55.  (set is-registered (exists (tackon @default-dest "Miami.key2")))
  56. )
  57.  
  58. (procedure select-cpu
  59.  (if is-registered
  60.   (set cpu-choice
  61.    (askchoice
  62.     (prompt "Please select which version of\nMiami you want to use:")
  63.     (help "Miami exists in an 68000 version\nand an 68020 version. The "
  64.      "68020 version\ncan only be used by registered users.")
  65.     (choices "68000 version" "68020 version")
  66.    )
  67.   )
  68.   (set cpu-choice 0)
  69.  )
  70. )
  71.  
  72. (procedure select-icon
  73.  (set icon-choice
  74.   (askchoice
  75.    (prompt "Please select which icons you\nwant to use:")
  76.    (help "Miami comes with three different\nicon styles. Please select\n"
  77.     "the one you prefer.")
  78.    (choices "do not install new icons" "standard" "Magic Workbench" "NewIcons")
  79.   )
  80.  )
  81. )
  82.  
  83. (procedure check-in-place
  84.  (set is-in-place
  85.   (= (expandpath source-dir) (expandpath @default-dest))
  86.  )
  87. )
  88.  
  89. (procedure copy-file
  90.  (copyfiles
  91.   (source (tackon source-dir to-copy))
  92.   (dest @default-dest)
  93.   (optional force)
  94.  )
  95. )
  96.  
  97. (procedure copy-files
  98.  (if (exists (tackon @default-dest "Miami"))
  99.   (delete (tackon @default-dest "Miami") force)
  100.  )
  101.  (if (exists (tackon @default-dest "Miami.info"))
  102.   (delete (tackon @default-dest "Miami.info") force)
  103.  )
  104.  (if is-in-place
  105.   (
  106.    (if cpu-choice
  107.     (
  108.      (delete (tackon @default-dest "Miami.000") force)
  109.      (delete (tackon @default-dest "Miami.000.info") force)
  110.      (rename (tackon @default-dest "Miami.020") (tackon @default-dest "Miami"))
  111.      (rename (tackon @default-dest "Miami.020.info") (tackon @default-dest "Miami.info"))
  112.     )
  113.     (
  114.      (delete (tackon @default-dest "Miami.020") force)
  115.      (delete (tackon @default-dest "Miami.020.info") force)
  116.      (rename (tackon @default-dest "Miami.000") (tackon @default-dest "Miami"))
  117.      (rename (tackon @default-dest "Miami.000.info") (tackon @default-dest "Miami.info"))
  118.     )
  119.    )
  120.    (complete 50)
  121.   ) (
  122.    (if cpu-choice
  123.     (set to-copy "Miami.020")
  124.     (set to-copy "Miami.000")
  125.    )
  126.    (copy-file)
  127.    (if cpu-choice
  128.     (rename (tackon @default-dest "Miami.020") (tackon @default-dest "Miami"))
  129.     (rename (tackon @default-dest "Miami.000") (tackon @default-dest "Miami"))
  130.    )
  131.    (set to-copy "Miami.guide") (copy-file)
  132.    (set to-copy "Miami.guide.info") (copy-file)
  133.    (set to-copy "MiamiArp") (copy-file)
  134.    (set to-copy "MiamiFinger") (copy-file)
  135.    (set to-copy "MiamiIfConfig") (copy-file)
  136.    (set to-copy "MiamiInit") (copy-file)
  137.    (set to-copy "MiamiInit.info") (copy-file)
  138.    (set to-copy "MiamiInitSANA2") (copy-file)
  139.    (set to-copy "MiamiInitSANA2.info") (copy-file)
  140.    (set to-copy "MiamiNetStat") (copy-file)
  141.    (set to-copy "MiamiPing") (copy-file)
  142.    (set to-copy "MiamiRegister") (copy-file)
  143.    (set to-copy "MiamiRegister.info") (copy-file)
  144.    (set to-copy "MiamiResolve") (copy-file)
  145.    (set to-copy "MiamiRoute") (copy-file)
  146.    (set to-copy "MiamiSysCtl") (copy-file)
  147.    (set to-copy "MiamiTCPDump") (copy-file)
  148.    (set to-copy "MiamiTraceRoute") (copy-file)
  149.    (set to-copy "README_FIRST") (copy-file)
  150.    (set to-copy "README_FIRST.info") (copy-file)
  151.    (complete 25)
  152.    (if (not (exists (tackon @default-dest "libs")))
  153.     (makedir (tackon @default-dest "libs"))
  154.    )
  155.    (copyfiles
  156.     (source (tackon source-dir "libs"))
  157.     (dest (tackon @default-dest "libs"))
  158.     (all)
  159.    )
  160.   )
  161.  )
  162.  (if (not (= icon-choice 0)) (
  163.   (set to-copy
  164.    (select icon-choice
  165.     ""
  166.     "Icons/Standard/Miami.info"
  167.     "Icons/MagicWB/Miami.info"
  168.     "Icons/NewIcons/Miami.info"
  169.    )
  170.   )
  171.   (copyfiles
  172.    (source (tackon source-dir to-copy))
  173.    (dest @default-dest)
  174.   )
  175.   (copyfiles
  176.    (source (tackon source-dir to-copy))
  177.    (dest @default-dest)
  178.    (newname "MiamiInit.info")
  179.   )
  180.   (copyfiles
  181.    (source (tackon source-dir to-copy))
  182.    (dest @default-dest)
  183.    (newname "MiamiInitSANA2.info")
  184.   )
  185.   (copyfiles
  186.    (source (tackon source-dir to-copy))
  187.    (dest @default-dest)
  188.    (newname "MiamiRegister.info")
  189.   )
  190.  ))
  191.  (complete 50)
  192. )
  193.  
  194. (procedure set-tooltypes
  195.  (tooltype
  196.   (dest (tackon @default-dest "Miami"))
  197.   (noposition)
  198.  )
  199.  (tooltype
  200.   (dest (tackon @default-dest "MiamiInit"))
  201.   (noposition)
  202.  )
  203.  (tooltype
  204.   (dest (tackon @default-dest "MiamiInitSANA2"))
  205.   (noposition)
  206.  )
  207.  (tooltype
  208.   (dest (tackon @default-dest "MiamiRegister"))
  209.   (noposition)
  210.  )
  211.  (tooltype
  212.   (dest (tackon @default-dest "Miami.guide"))
  213.   (noposition)
  214.   (setdefaulttool ag-browser)
  215.  )
  216. )
  217.  
  218. (procedure add-to-startup
  219.  (if old-miami-assign
  220.   (if (= (old-miami-assign-location (expandpath @default-dest)))
  221.    (set change-startup 0)
  222.    (set change-startup 1)
  223.   )
  224.   (set change-startup 1)
  225.  )
  226.  (if change-startup
  227.   (
  228.    (set startup-addition (cat
  229.     "assign Miami: \"" (expandpath @default-dest) "\"\n"
  230.     )
  231.    )
  232.    (if
  233.     (askbool
  234.      (prompt "It is strongly recommended that an assign "
  235.       "'Miami:' is created for the Miami installation "
  236.       "directory. Miami by itself will work fine without "
  237.       "this assign, but some utility programs like "
  238.       "MiamiTCPDump need it. Would you like Installer "
  239.       "to make the required change to your user-startup "
  240.       "file ?")
  241.      (help "It is strongly recommended that an assign "
  242.       "'Miami:' is created for the Miami installation "
  243.       "directory. Miami by itself will work fine without "
  244.       "this assign, but some utility programs like "
  245.       "MiamiTCPDump need it. Please indicate if you would like Installer "
  246.       "to make the required change to your user-startup "
  247.       "file.")
  248.      (choices "Yes" "No")
  249.     )
  250.     (startup "Miami"
  251.      (command startup-addition)
  252.      (prompt "Installer will modify your s:user-startup "
  253.       "script. The following lines will be added:\n\n"
  254.       startup-addition)
  255.      (help "Installer will modify your s:user-startup "
  256.       "script. The following lines will be added:\n\n"
  257.       startup-addition)
  258.     )
  259.     (textfile
  260.      (dest (tackon @default-dest "addition-to-user-startup"))
  261.      (append startup-addition)
  262.     )
  263.    )
  264.   )
  265.  )
  266. )
  267.      
  268.  
  269. ;;;; Start
  270.  
  271. (welcome "Welcome to the Miami 2.0 installation.\n")
  272.  
  273. (set app-name "Miami 2.0")
  274.  
  275. (check-system-version)
  276.  
  277. (complete 0)
  278.  
  279. (set source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  280.  (expandpath @icon))
  281. )
  282.  
  283. (select-destination-directory)
  284.  
  285. (check-registered)
  286.  
  287. (select-cpu)
  288.  
  289. (select-icon)
  290.  
  291. (check-in-place)
  292.  
  293. (copy-files)
  294.  
  295. (set-tooltypes)
  296.  
  297. (complete 75)
  298.  
  299. (add-to-startup)
  300.  
  301. (complete 100)
  302.