home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / a / am_ftp / amftpv1.58reg.lha / amftp / Install_AmFTP < prev    next >
Text File  |  1996-07-13  |  16KB  |  409 lines

  1. ;******************************************************************************
  2. ;      ____           ______ ______ ______
  3. ;     / __ \         / ____//_  __// __  /
  4. ;    / /_/ /_   _   / /_     / /  / /_/ /
  5. ;   / __  // \_/ \ / __/    / /  / ____/
  6. ;  / / / // /__/ // /      / /  / /
  7. ; /_/ /_//_/  /_//_/      /_/  /_/
  8. ;
  9. ; $VER: 1.53f (March-17-1996) 
  10. ; Changes, suggestions or problems: rcr@netcom.com
  11. ; If you wish to use any part of this installer you must ask.
  12. ;
  13. ; AmFTP Installer ©1995,1996 by Robert C. Reiswig 
  14. ;******************************************************************************
  15. ;*** System Stuff ***
  16. (set cpu (database "cpu"))  (set vblank (database "vblank"))
  17. (set graphmem (database "graphics-mem")) (set totmem (database "total-mem"))
  18. (set osver (/ (getversion "LIBS:version.library") 65536))
  19. (if (= vblank "60") ((set blank "NTSC")) ((set blank "PAL")))
  20. (set fastmem (- totmem graphmem))
  21.  
  22. (if (= osver 37) (set workbench "2.0")) (if (= osver 38) (set workbench "2.1"))
  23. (if (= osver 39) (set workbench "3.0")) (if (= osver 40) (set workbench "3.1"))
  24. (if (= osver 41) (set workbench "4.0"))
  25.  
  26. (set cpu (database "cpu"))
  27. (if (= cpu 68000) (set #cpu 0)) (if (= cpu 68010) (set #cpu 1))
  28. (if (= cpu 68020) (set #cpu 2)) (if (= cpu 68030) (set #cpu 3))
  29. (if (= cpu 68040) (set #cpu 4)) 
  30. (if (> (exists ("sys:libs/68060.library")) 0) (set #cpu 5) )
  31.  
  32. (set vernum1 (getversion "AmFTP")) (set ver1 (/ vernum1 65536)) 
  33. (set rev1 (- vernum1 (* ver1 65536) ) ) (set AmFTPver (cat ver1 "." rev1))
  34.  
  35. (if (> (exists ("env:Language")) 0) (set lanfound (getenv "Language")) )
  36. (set lan 0)
  37.  
  38. (if (= "english"    lanfound) (set lan 0))  (if (= "deutsch"    lanfound) (set lan 1))
  39. (if (= "français"   lanfound) (set lan 2))  (if (= "português"  lanfound) (set lan 3))
  40. (if (= "español"    lanfound) (set lan 4))  
  41. ;(if (= "greek"      lanfound) (set lan 5)) 
  42. ;(if (= "svenska"    lanfound) (set lan 6))  (if (= "suomi"      lanfound) (set lan 7))
  43. ;(if (= "nederlands" lanfound) (set lan 8))  (if (= "italiano"   lanfound) (set lan 9)) 
  44. ;(if (= "bosanski"   lanfound) (set lan 10)) (if (= "dansk"      lanfound) (set lan 11)) 
  45. ;(if (= "polski"     lanfound) (set lan 12)) (if (= "norsk"      lanfound) (set lan 13))
  46.  
  47. (if (> lan 12) (set lan 0))
  48.  
  49. (set #English    "English")  (set #Deutsch    "Deutsch")
  50. (set #Français   "Français") (set #Português "Português")
  51. (set #Español    "Español")
  52. ;(set #Polski     "Polski")   
  53. ;(set #Svenska    "Svenska")  (set #Nederlands "Nederlands")
  54. ;(set #Norsk      "Norsk")    (set #Suomi "Suomi")
  55. ;(set #Greek      "Greek")    (set #Italiano "Italiano")
  56. ;(set #Bosanski   "Bosanski") (set #Dansk "Dansk")
  57.  
  58.  
  59. (set mfound 0) (set newicon1 1) 
  60. (set keeper 1) (set firsttime 0)
  61.  
  62. ;********************************************************************
  63. ; English Strings
  64. ;********************************************************************
  65. (set #about (cat "\n\n\nWelcome to\n\nAmFTP " AmFTPver "\n\nCopyright © 1995,1996 by\n\nMathias Mischler\n") )
  66. (set #nomui (cat "\n\nAmFTP uses Magic User Interface (MUI).\n\nThe installer has not found MUI: to be assigned, "
  67.                  "therefore you AmFTP will not work correctly.  You will need to install "
  68.                  "MUI before running AmFTP."
  69.             )
  70. )
  71. (set #whereAmFTP "Where do you wish to install AmFTP. A directory called 'AmFTP' will be created if one is not there. If a copy of AmFTP is found it will be backed up.")
  72. (set muiver "No Version Installed")
  73. (set #newermui "\n\nAmFTP needs version 3.0 or higher of MUI installed to work correctly.\n\nNow would be a good time to Upgrade!\n\n It looks like you have: \n\n")
  74. (set #need-os "\n\nThe 68020 version of AmFTP needs version 3.0 or higher of the Amiga OS installed to work correctly.\n\n It looks like you have: \n\n")
  75. (set #000used "\n\nThe 68000 version will be installed.") 
  76. (set #filethere1 "\n\nThe installer has found AmFTP version ")
  77. (set #filethere2 " at ")
  78. (set #filethere3 "\n\nThe file will be renamed to ")
  79. (set #filethere4 " and it will then be moved to ")
  80. (set #oktodelete1 "\nIs it ok to delete the older AmFTP binary so that the AmFTP Directory can be made?\n")
  81. (set #oktodelete2 "\nIs it ok to delete the older _renamed_ AmFTP binary so that the AmFTP Directory can be made?\n")
  82. (set #backuptoXXX "Back-UP to file named 'AmFTP")
  83. (set #copyover "Copy Over Old Version")
  84. (set #AmFTPfound "\nThe Installer has found a copy of AmFTP already installed. What do you want to do?\n")
  85. (set #askcpu "\nCPU Check: What CPU does the machine have that you are installing AmFTP on? The installer has found:\n")
  86. (set #no020found "\n\nThe 68020 Version of AmFTP , AmFTP020, was not found in this archive the 68000 version was installed.")
  87. (set #newicon "\nDo you wish to copy over one of the AmFTP Icons from the archive? If you have any ToolTypes already set you should select no.\n")
  88. (set #pickicon "\nAmFTP has a number of different icons you can choose from. Which one would you like to use?\n")
  89. (set #nomultiview (cat "The installer could not find multiview or you are running on a 2.0x Amiga. "
  90.                        "The AmFTP Installer will let you choose between a few different icon to use. "
  91.                        "You can use a picture viewer to look at the 'Icons/ftp_Icons.iff' to see the choices side-by-side, "
  92.                        "or you can just look in the Icon drawer from where you are installing AmFTP from."
  93.                   )
  94. )
  95. (set #nonewicon  "No  - ToolTypes already set.")
  96. (set #yesnewicon "Yes - Copy over Icon.")
  97. (set #whatcat "\nSelect the AmFTP Language catalog you wish to install.\n")
  98. (set #wherecat "\nWhere do you wish to install the AmFTP Language Catalog? Default is ")
  99. (set #catnofind "Can not find this catalog in this AmFTP archive. You may need to get the complete archive from the support site.")
  100. (set #whatdocs "\nWhat AmFTP documentation would you like to install?\n")
  101. (set #wheredocs "Where would you like the AmFTP documentation you selected to be installed?")
  102. (set #byebye (cat "\nAmFTP Install Complete!\n\n" ))
  103. ;********************************************************************
  104. ; Hello
  105. ;********************************************************************
  106. (message #about)
  107. (welcome) 
  108.  
  109. ;********************************************************************
  110. ; MUI installed?
  111. ;********************************************************************
  112. (if (< (exists "mui:") 2)  (message #nomui) )
  113.  
  114. ;********************************************************************
  115. ; Check for AmFTP020 requs
  116. ;********************************************************************
  117. (set ver 0)
  118. (if (exists "mui:mui") 
  119.  (
  120.   (set vernum (getversion "mui:mui") )
  121.   (set ver (/ vernum 65536)) (set rev (- vernum (* ver 65536) ) )
  122.  
  123.   (if (= ver 7) (set muiver "2.0") )   (if (= ver 8) (set muiver "2.1") )
  124.   (if (= ver 9) (set muiver "2.2") )   (if (= ver 10) (set muiver "2.3") )
  125.   (if (= ver 11) (set muiver "3.0") )  (if (= ver 12) (set muiver "3.1") )
  126.   (if (= ver 13) (set muiver "3.2") )  (if (= ver 14) (set muiver "3.3") )
  127.  )
  128. )
  129.  
  130. (if (< ver 11)   ( (message (cat #newermui muiver))   (set cpuPick 0) ))
  131. ;(if (< osver 39) ( (message (cat #need-os workbench #000used)) (set cpuPick 0) ))
  132.  
  133.  
  134. ;********************************************************************
  135. ; Ask where to put AmFTP & Make dir if needed
  136. ;********************************************************************
  137. (set Package (getassign "AmiTCP"))
  138.   (if (= Package "") (set Package (getassign "Inet"))
  139. )
  140.  
  141. (set AmFTPdir  (askdir (prompt #whereAmFTP)
  142.                (help   #whereAmFTP)
  143.                     (default Package)
  144.                )  
  145. )
  146.  
  147. (set where AmFTPdir)
  148.  
  149. (if (= 1 (exists (tackon where "AmFTP") ) ) 
  150.   (
  151.     (set vernum1 (getversion (tackon where "AmFTP") ))
  152.     (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  153.     (set AmFTP_old (cat ver1 "." rev1))
  154.  
  155.     (message (cat #filethere1 ver1 "." rev1 #filethere2 where #filethere3 
  156.                   (cat "AmFTP" AmFTP_old) #filethere4 (tackon AmFTPdir "AmFTP") )
  157.     )
  158.     
  159.  
  160.     (copyfiles (source (tackon where "AmFTP"))
  161.                (dest where) 
  162.                (infos)
  163.                (newname (cat "AmFTP" AmFTP_old))
  164.     )
  165.  
  166.     (delete (tackon AmFTPdir "AmFTP") (prompt #oktodelete1) (help #oktodelete1) (confirm) (infos)) 
  167.  
  168.     (if (< (exists (tackon AmFTPdir "AmFTP")) 2) (makedir (tackon AmFTPdir "AmFTP") (infos)) )    
  169.  
  170.     (copyfiles (source (tackon where (cat "AmFTP" AmFTP_old) ))
  171.                        (dest (tackon AmFTPdir "AmFTP")) 
  172.                        (infos)
  173.                
  174.     )
  175.  
  176.     (delete (tackon where (cat "AmFTP" AmFTP_old)) (prompt #oktodelete2) (help #oktodelete2) (confirm) (infos) ) 
  177.  
  178.     ;(set firsttime 1)
  179.  
  180.   )
  181. )
  182.  
  183. (if (< (exists (tackon AmFTPdir "AmFTP")) 2) (makedir (tackon AmFTPdir "AmFTP") (infos)) )
  184. (set where (tackon AmFTPdir "AmFTP"))
  185. (set @default-dest where)
  186.  
  187. ;********************************************************************
  188. ; Check for old & backup
  189. ;********************************************************************
  190. (if (exists (tackon where "AmFTP")) 
  191.   (
  192.       (set vernum1 (getversion (tackon where "AmFTP") ))
  193.       (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  194.       (set AmFTP_old (cat ver1 "." rev1))
  195.  
  196.       (set keeper  (askchoice (choices  (cat #backuptoXXX AmFTP_old "'")  #copyover)
  197.                      (prompt #AmFTPfound)
  198.                  (help   #AmFTPfound)
  199.                      (default 0)
  200.                )
  201.       )    
  202.  
  203.  
  204.       (if (= keeper 0)
  205.          (copyfiles (source (tackon where "AmFTP"))
  206.                      (dest where) 
  207.                      (infos)
  208.                      (newname (cat "AmFTP" AmFTP_old))
  209.          )
  210.       )          
  211.  
  212.       (set firsttime 1)
  213.     
  214.   )
  215. )
  216.  
  217. ;********************************************************************
  218. ; Double Check on the CPU
  219. ;********************************************************************
  220. (set cpuPick (askchoice (choices "68000" "68010" "68020" "68030"
  221.                          "68040" "68060"
  222.                 )
  223.              (prompt #askcpu)
  224.                      (help   #askcpu)
  225.                    (default #cpu)
  226.       )
  227. )
  228.  
  229. ;********************************************************************
  230. ; Copy over correct AmFTP and Icon if wanted
  231. ;********************************************************************
  232. (if (AND (> cpuPick 1) (exists ("AmFTP020")) )
  233.    (copyfiles (source "AmFTP020") (dest where) (optional "nofail") (newname "AmFTP") )
  234.  
  235.    (copyfiles (source "AmFTP") (dest where) (optional "nofail") )
  236. )
  237.  
  238.  
  239. (if (AND (> cpuPick 1) (= (exists ("AmFTP020")) 0) )
  240.  (message #no020found)
  241. )
  242.  
  243. ;(if (= firsttime 0)  (copyfiles (source "AmFTP.info") (dest where) (optional "nofail") ) )
  244.  
  245. (if (exists ("RegisterAmFTP"))
  246.  (copyfiles (source "RegisterAmFTP") (dest where)  (infos) (optional "nofail") )
  247. )
  248.  
  249.  
  250. (if (OR (= keeper 0) (= firsttime 0))
  251.   (
  252.   
  253.    (set newicon (askchoice (choices #yesnewicon #nonewicon)
  254.                            (prompt #newicon)
  255.                        (help   #newicon)
  256.                            (default 0)
  257.             )
  258.    )
  259.  
  260.    (if (= newicon 0) 
  261.      (
  262.        (if (> (exists ("c:multiview")) 0)  ((set #mpath "c:") (set mfound 1)) )
  263.        (if (> (exists ("sys:Utilities/multiview")) 0) ((set #mpath "sys:Utilities") (set mfound 1)) )
  264.        (if (= mfound 1) (run (cat "run " (tackon #mpath "multiview ") "Icons/ftp_Icons.iff")) )
  265.        (if (<> mfound 1) (message #nomultiview))
  266.  
  267.  
  268.        (set pickicon (askchoice (choices "AmFTP:  World/Disk, 3 Arrows"
  269.                                          "AmFTP2: Amiga w/WorldMap & Sel_Arrow"
  270.                                          "AmFTP3: Amiga w/Earth"
  271.                                 )
  272.                                 (prompt #pickicon)
  273.                                 (help   #pickicon)
  274.                                 (default 0)
  275.             )
  276.        )
  277.  
  278.  
  279.  
  280.      )
  281.    )
  282.  
  283.   
  284.    (if (= pickicon 0) (copyfiles (source "Icons/AmFTP.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  285.    (if (= pickicon 1) (copyfiles (source "Icons/AmFTP2.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  286.    (if (= pickicon 2) (copyfiles (source "Icons/AmFTP3.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  287.  
  288.   )
  289.  
  290. )
  291.  
  292. ;********************************************************************
  293. ; Copy over AmFTPPrefs and Default Config if NOT there
  294. ;********************************************************************
  295. (if (> (exists ("amftpprefs")) 0) 
  296.  (copylib (source "amftpprefs") (dest where) (infos) (optional "nofail") )
  297. )
  298.  
  299. (if (= (exists ("env:mui/amftp.config")) 0) 
  300.  (copyfiles (source "amftp.config") (dest "env:mui") (optional "nofail") )
  301. )
  302.  
  303. (if (= (exists ("envarc:mui/amftp.config")) 0) 
  304.  (copyfiles (source "amftp.config") (dest "envarc:mui") (optional "nofail") )
  305. )
  306.  
  307.  
  308. ;********************************************************************
  309. ; Select and copy over Catalog
  310. ;********************************************************************
  311. (set catalog (askchoice (choices #English #Deutsch #Français #Português #Español)
  312. ;#Svenska #Suomi #Norsk #Greek #Nederlands #Italiano #Bosanski #Dansk #Polski)
  313.                            (prompt #whatcat)
  314.                        (help   #whatcat)
  315.                            (default lan)
  316.              )
  317. )
  318.  
  319.  
  320.  
  321. ;(set #Bosanski   "Bosanski") (set #Dansk "Dansk")
  322. ;(set #Polski     "Polski")
  323.  
  324. (if (= catalog 0)  (set #lcat #English ))
  325. (if (= catalog 1)  (set #lcat #Deutsch))
  326. (if (= catalog 2)  (set #lcat #Français))
  327. (if (= catalog 3)  (set #lcat #Português))
  328. (if (= catalog 4)  (set #lcat #Español))
  329. ;(if (= catalog 5)  (set #lcat #Svenska))
  330. ;(if (= catalog 6)  (set #lcat #Suomi))
  331. ;(if (= catalog 7)  (set #lcat #Norsk))    
  332. ;(if (= catalog 8)  (set #lcat #Greek))
  333. ;(if (= catalog 9)  (set #lcat #Nederlands))
  334. ;(if (= catalog 10)  (set #lcat #Italiano))
  335. ;(if (= catalog 11) (set #lcat #Bosanski))
  336. ;(if (= catalog 12) (set #lcat #Dansk))
  337. ;(if (= catalog 13) (set #lcat #Polski)) 
  338.  
  339. (if (<> catalog 0)
  340.  (
  341.   (if (> (exists (cat "Catalogs/" #lcat "/AmFTP.catalog")) 0)
  342.     (
  343.         (set wherecat  (askchoice (choices (tackon where (cat "Catalogs/" #lcat)) (cat "Locale:Catalogs/" #lcat) )
  344.                                   (prompt (cat #wherecat (tackon where (cat "Catalogs/" #lcat)) "\n"))
  345.                             (help   #wherecat)
  346.                                (default 0)
  347.                        )  
  348.         )
  349.  
  350.       (if (= wherecat 1)
  351.         (
  352.          (if (< (exists "Locale:") 2) ( (makedir "sys:Locale") (makeassign "Locale" "sys:Locale") ) )
  353.          (if (< (exists "Locale:Catalogs") 2) (makedir "sys:Locale/Catalogs") )
  354.          (if (< (exists (cat "Locale:Catalogs/" #lcat)) 2) (makedir (cat "sys:Locale/Catalogs/" #lcat)) )
  355.          (copylib (source (cat "Catalogs/" #lcat "/AmFTP.catalog")) (dest (cat "sys:Locale/Catalogs/" #lcat)) )
  356.         )
  357.   
  358.         (
  359.          (if (< (exists (tackon where "Catalogs")) 2) (makedir (tackon where "Catalogs")) )
  360.          (if (< (exists (tackon where (cat "Catalogs/" #lcat)) ) 2) (makedir (tackon where (cat "Catalogs/" #lcat)) ) )
  361.          (copylib (source (cat "Catalogs/" #lcat "/AmFTP.catalog")) (dest (tackon where (cat "Catalogs/" #lcat)) ) (optional "nofail") )
  362.         )
  363.       )
  364.  
  365.     )
  366.  
  367.     (message (cat "\nCatalogs/" #lcat "/AmFTP.catalog\n\n" #catnofind))
  368.   )
  369.  
  370.  
  371.  )
  372. )
  373.  
  374. ;********************************************************************
  375. ; Ask and and copy docs if wanted!
  376. ;********************************************************************
  377. (set docs (askoptions (choices "AmFTP.guide" "AmFTP.doc" "AmFTP.Changes")
  378.               (prompt #whatdocs)
  379.                       (help #whatdocs)
  380.                   (default 3)
  381.       )
  382. )
  383.  
  384. (if (<> docs 0)
  385.  (
  386.    (set docsdir (askdir (prompt #wheredocs)
  387.                (help   #wheredocs)
  388.                     (default where)
  389.                 )  
  390.    )
  391.  
  392.    (if (IN docs 0) (copyfiles (source "AmFTP.guide") (dest docsdir) (infos) (optional "nofail") ) )
  393.    (if (IN docs 1) (copyfiles (source "AmFTP.doc") (dest docsdir) (infos) (optional "nofail") ) )
  394.    (if (IN docs 2) (copyfiles (source "AmFTP.Changes") (dest docsdir) (infos) (optional "nofail") ) )
  395.  
  396.  )
  397. )
  398. ;********************************************************************
  399. ; copy keyfile if there 
  400. ;********************************************************************
  401. (if (> (exists "AmFTP.Key") 0)
  402.  (copyfiles (source "AmFTP.Key") (dest where) (infos) (optional "nofail") ) 
  403. )
  404.  
  405. ;********************************************************************
  406. ; End Bye 
  407. ;********************************************************************
  408. (exit #byebye)
  409.