home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 103 / af103sub.adf / akSVGDT.LZX / akSVG-Datatype / akDT_Install next >
Text File  |  2001-10-10  |  11KB  |  259 lines

  1. ;********************************************************************************
  2. ;            __     ____           __           __                 
  3. ;           / /__  / __ \        _/ /_        _/ /_               
  4. ;   ______ / // / / / / /______ /  __/______ /  __/__  __ ______ ______
  5. ;  / __  // _  / / / / // __  / / /  / __  / / /   \ \/ // __  // ____/
  6. ; / __  // /| | / /_/ // __  / / /_ / __  / / /_    \  // /_/ // __/_
  7. ;/_/ /_//_/ |_|/_____//_/ /_/ /___//_/ /_/ /___/    / // ____//_____/
  8. ;                                                  /_// /    
  9. ; akJFIF, akLJPG, akPNG, akSVG, akGIF, faxx          /_/    
  10. ;
  11. ; $VER: akDT_Installer 0.94 (July-21-1997)
  12. ; Installer by Robert C. Reiswig ©1996-1997
  13. ;
  14. ; If you wish to use any part of this installer you must ask. May not be 
  15. ; integrated/placed into any other package! Changes, suggestions or problems:
  16. ; akDatatype@vgr.com 
  17. ;--------------------------------------------------------------------------------
  18. ;
  19. ;********************************************************************************
  20. (if (= @user-level 0) (set @user-level 1))
  21. (set whereback "SYS:Storage")
  22. (set dtdest (tackon whereback "Datatypes"))
  23. (set cksum 0)
  24.  
  25. (foreach "classes/datatypes" "#?.datatype" (set wakdt @each-name) ) 
  26. ;(set vernum1 (getversion (cat "classes/datatypes/" wakdt))) (set ver1 (/ vernum1 65536)) 
  27. ;(set rev1 (- vernum1 (* ver1 65536) ) ) (set akdtver (cat ver1 "." rev1))
  28.  
  29. (set cpu (database "cpu")) 
  30. (if (> (exists ("sys:libs/68060.library")) 0) (set #cpu 5) )
  31. (if (= cpu 68000) (set #cpu 0)) (if (= cpu 68010) (set #cpu 1))
  32. (if (= cpu 68020) (set #cpu 2)) (if (= cpu 68030) (set #cpu 3))
  33. (if (= cpu 68040) (set #cpu 4)) (if (= cpu 68060) (set #cpu 5)) 
  34. (if (= wakdt "faxx.datatype") (set extraC "\n\n&\n\n(C)opyright 1995-97 GPSoft"))
  35.  
  36. ;********************************************************************************
  37. ;English Information  
  38. ;********************************************************************************
  39. (set #about (cat "\n\n\nWelcome to the " wakdt "\n\n(C)opyright 1996, 1997 by Andreas R. Kleinert" extraC) )
  40. (set #whereDTs "In what directory are the Datatypes located? (Not the 'Datatypes' dir itself, 1 level up, ie 'Classes'.) If they aren't installed, select where you wish to install them. (Default: 'SYS:classes'.)")
  41. (set #dtdirnotfound "\nThe 'Datatypes' directory was not found. Please select where you have the 'Datatypes' directory located. Do not select the 'Datatypes' directory itself, but one directory level up. If you have the datatypes in 'SYS:classes/datatypes' you would pick 'SYS:classes'.\n\n'datatypes' directory not found in:\n\n") 
  42. (set #backupdts " BackUp Current Datatype & Prefs")
  43. (set #whattodo "\nWould you like to backup the Datatypes Currently installed on your system that will be updated, along with the Prefs program if installed?\n")
  44. (set #whereback "Where would you like to BackUp the Datatypes? If a directory Called 'Datatypes' is not there one will be created. (Default is 'SYS:Storage')")
  45. (set #wherebackp "Where would you like to BackUp the Prefs Program?")
  46. (set #askcpu "\nCPU Check: What CPU does the machine have that you are installing the Datatype on? The installer has found:\n")
  47. (set #backup1 "\nThe Datatype was Backed-up to:\n")
  48. (set #backup2 "\n\nThe 'Devs:' files that were backed-up will have the <checksum> of the file appended to the file name.")
  49. (set #foundnonak1 "\nThe installer has found that you have a '")
  50. (set #foundnonak2 "' installed.  This will create a conflict with the '")
  51. (set #foundnonak3 "' that is used for decoding pictures.\n\n Is it ok to move the datatype to:\n\n")
  52. (set #Skip "Skip")
  53. (set #Delete "Delete")
  54. (set #movedt "Move DT")
  55. (set #tools "\nWhat Datatype Prefs(s) would you like to install?\n")
  56. (set #akprefs " - Prefs for ")
  57. (set #Where "Where do you wish to install ")
  58. (set #whereakprefs "? If there is a copy already there a backup of it will be created!")
  59.  
  60. ;********************************************************************************
  61. ; Welcome to Install akDT
  62. ;********************************************************************************
  63. (message #about)
  64. (welcome)
  65.  
  66. ;********************************************************************************
  67. ; Ask Where the Current DTs are and check for Datatypes dir.
  68. ;********************************************************************************
  69. (set whereDTs "SYS:Classes")
  70.  
  71. (procedure getdir
  72.   (set whereDTs  (askdir (prompt #whereDTs)
  73.                          (help   #whereDTs)
  74.                          (default whereDTs) 
  75.              )
  76.   )
  77. )
  78.  
  79. (getdir)
  80.  
  81. (while (= (exists (tackon whereDTs "Datatypes")) 0) 
  82.   (
  83.     (message (cat #dtdirnotfound "'" whereDTs "'"))
  84.     (getdir)   
  85.   )
  86. )
  87.  
  88. ;********************************************************************************
  89. ; Ask to Backup the Current DTs
  90. ;********************************************************************************
  91. (set ja (askoptions   (choices #backupdts)
  92.                        (prompt #whattodo)
  93.                       (help   #whattodo)
  94.                          (default 1)
  95.     )
  96. )
  97.  
  98. ;********************************************************************************
  99. ; If Backup, ask where and make dirs
  100. ;********************************************************************************
  101. (if (= ja 1)
  102.  (
  103.   (set whereback (askdir (prompt #whereback)
  104.                          (help   #whereback)
  105.                          (default whereback) 
  106.              )
  107.   )
  108.  
  109.   (set dtdest (tackon whereback "Datatypes"))
  110.   (if (< (exists dtdest) 2)  (makedir dtdest (infos)) )
  111.   (if (< (exists (tackon dtdest "classes")) 2)  (makedir (tackon dtdest "classes") (infos)) )
  112.   (if (< (exists (tackon dtdest "classes/codecs")) 2)  (makedir (tackon dtdest "classes/codecs") (infos)) )
  113.   (if (< (exists (tackon dtdest "classes/datatypes")) 2)  (makedir (tackon dtdest "classes/datatypes") (infos)) ) 
  114.   (if (< (exists (tackon dtdest "devs")) 2)  (makedir (tackon dtdest "devs") (infos)) )
  115.   (if (< (exists (tackon dtdest "devs/datatypes")) 2)  (makedir (tackon dtdest "devs/datatypes") (infos)) ) 
  116.   (if (< (exists (tackon dtdest "libs")) 2)  (makedir (tackon dtdest "libs") (infos)) )
  117.  
  118.  )
  119. )
  120.  
  121. (set @default-dest (tackon whereback "Datatypes"))
  122.  
  123. ;********************************************************************************
  124. ; Backup Procedure 
  125. ;******************************************************************************** 
  126. (procedure backup
  127. (if (= ak 1) (set filename (substr @each-name 2)) (set filename @each-name) )
  128.  
  129.  (if (> (exists (tackon WHERE filename)) 0)
  130.   (
  131.    (set vernum1 (getversion (tackon WHERE filename)) )
  132.    (set ver1 (/ vernum1 65536))
  133.    (set rev1 (- vernum1 (* ver1 65536) ) )
  134.    (set verrev (cat ver1 "." rev1))
  135.  
  136.    (if (= cksum 1)
  137.      (
  138.        ;(working "working")
  139.        (set sum (getsum (tackon WHERE filename) ) ) 
  140.        (if (< sum 0) (set sum (* sum -1)) )
  141.        (set verrev sum)
  142.      )
  143.    )
  144.  
  145.    (set file-error (copyfiles (source (tackon WHERE filename)
  146.                                       (dest TO)
  147.                                       (newname (cat filename "." verrev))
  148.                                       (infos)
  149.                                       (optional "nofail")
  150.                               )              
  151.                    )   
  152.    )
  153.  
  154.   )
  155.  )
  156. )
  157.  
  158. ;********************************************************************************
  159. ; Ask what & Guess CPU 
  160. ;******************************************************************************** 
  161. (set cpuPick (askchoice (choices "68000" "68010" "68020" "68030+68881/882"
  162.                          "68040+FPU" "68060+FPU"
  163.                 )
  164.              (prompt #askcpu)
  165.                      (help   #askcpu)
  166.                    (default #cpu)
  167.       )
  168. )
  169.  
  170. (if (< cpuPick 3) (set wcpu ""))     (if (= cpuPick 3) (set wcpu ".030"))
  171. (if (= cpuPick 4) (set wcpu ".040")) (if (= cpuPick 5) (set wcpu ".060"))
  172. (if (= (exists (cat "classes/datatypes/" wakdt ".060")) 0) (set wcpu ".040"))
  173. (if (= (exists (cat "classes/datatypes/" wakdt ".040")) 0) (set wcpu ".030"))
  174. (if (= (exists (cat "classes/datatypes/" wakdt ".030")) 0) (set wcpu ""))
  175.  
  176. (if (= (exists (tackon "classes/datatypes" wakdt)) 0) (set wcpu "") )
  177.  
  178. ;********************************************************************************
  179. ; Look in Archive, if the File to be copied over is already there & it is ok to 
  180. ; back-up.. then Back-up file with <filename>.<ver.rev> OR <filename>.<checksum>
  181. ;******************************************************************************** 
  182. (set cksum 0) (set ak 0)
  183.  
  184.  (foreach "classes/datatypes" "#?.datatype"
  185.   ( 
  186.     (set WHERE (tackon whereDTs "datatypes"))  (set TO (tackon dtdest "classes/datatypes")) 
  187.     (if (= ja 1) (backup) ) 
  188.     (copylib (source (cat (tackon "classes/datatypes" @each-name) wcpu) ) (dest WHERE) (newname @each-name) (optional "nofail") (infos) ) 
  189.   )
  190.  )
  191.  
  192.  (foreach "devs/datatypes" "~(#?.info)"
  193.   ( 
  194.     (set WHERE "devs:datatypes")  (set TO (tackon dtdest "devs/datatypes"))  
  195.     (set cksum 1)    (if (= ja 1) (backup) )    (set cksum 0) 
  196.     (copyfiles (source (tackon "devs/datatypes" @each-name)) (dest WHERE) (optional "nofail") (infos) ) 
  197.   )
  198.  )
  199.  
  200. ;********************************************************************************
  201. ;  Prefs to install, ie prefs 
  202. ;********************************************************************************
  203. (if (> (exists "Prefs/Datatypes") 0)
  204. (
  205.  
  206. (foreach "Prefs/Datatypes" "ak#?Prefs" (set wakprefs @each-name) ) 
  207.  
  208. (set ToDo      (askoptions (choices (cat " " wakprefs #akprefs wakdt))
  209.                 (prompt #tools)
  210.                 (help #tools)
  211.                 (default 1)
  212.         )
  213. )
  214.  
  215. (if (IN ToDo 0)
  216.   (
  217.     (set akDrawer (askdir (prompt (cat #Where wakprefs #whereakprefs))
  218.                           (help   (cat #Where  wakprefs #whereakprefs))
  219.                   (default "SYS:Prefs")
  220.                   )
  221.     )
  222.  
  223.     (if (AND (> (exists (tackon akDrawer wakprefs) ) 0) (= ja 1))
  224.       (
  225.         (set wherebackp (askdir (prompt #wherebackp)
  226.                                 (help   #wherebackp)
  227.                                 (default (tackon whereback "Datatypes")) 
  228.                         )
  229.         )
  230.  
  231.         (set vernum1 (getversion (tackon akDrawer wakprefs)))
  232.         (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  233.  
  234.         (copyfiles (source (tackon akDrawer wakprefs))
  235.                            (dest wherebackp) (infos)
  236.                            (newname (cat wakprefs ver1 "." rev1))
  237.         )
  238.  
  239.       )
  240.     )
  241.  
  242.     (copyfiles (source (tackon "Prefs/Datatypes" wakprefs))  (dest akDrawer) (infos) (optional "force" "askuser" "nofail"))
  243.   )
  244. )
  245.  
  246. )
  247. ); End IFPrefsDir
  248.  
  249. ;********************************************************************************
  250. ; Run AddDataTypes then the Pref Program
  251. ;********************************************************************************
  252. (run "AddDataTypes REFRESH")
  253. (if (> (exists "Prefs") 0) (run (tackon "Prefs" wakprefs)) )
  254.  
  255. ;********************************************************************************
  256. ; END  
  257. ;********************************************************************************
  258. (if (= ja 1) (message (cat #backup1 "'" (tackon whereback "Datatypes") "'\n\n" #backup2)) )
  259.