home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 25 / amigaformatcd25.iso / websites / f1_gp / ic / champdata.lzx / IAF1GPC / Make_IAF1GPC_Datafile next >
Text File  |  1998-02-12  |  5KB  |  185 lines

  1. ; Internet Amiga F1GP Championship datafile installer
  2. ; $VER: Make_IAF1GPC_Datafile 1.0 (18.9.97)
  3. ;
  4. ; Copyright © 1997 Oliver Roberts
  5.  
  6. (if (= (exists "Env:Language") 1)
  7.     (set @language (getenv "Language"))
  8. )
  9.  
  10. ;*****************
  11. ; English strings
  12. ;
  13. (set #str-welcome (cat
  14.     "This is more than just your usual installation utility.  You can "
  15.     "use it at any time to make sure your datafile complies to the rules. "
  16.     "This utility creates a new datafile by merging the datafile "
  17.     "you usually use, with the offical championship datafile. Only the "
  18.     "required settings to make your datafile comply with the IAF1GPC "
  19.     "rules will be changed (all other settings will remain intact).")
  20. )
  21. (set #str-series "Which championship series are you competing in?")
  22. (set #str-getsrcfile (cat
  23.     "Select the location and filename of your usual F1GP-Ed datafile:\n"
  24.     "(if this is left blank, you'll just get a copy of the championship "
  25.     "datafile)")
  26. )
  27. (set #str-notdata "That doesn't appear to be a F1GP-Ed datafile!\n\nInstallation failed.")
  28. (set #str-getdestfile (cat
  29.     "Select the location and filename of the datafile to be created. "
  30.     "If the file already exists, it will be replaced!  If it does not "
  31.     "exist, the prefix \".f1gp\" will be added to the filename, if "
  32.     "necessary.")
  33. )
  34. (set #str-makedata "Making new datafile \"%s\" using your settings from \"%s\"")
  35. (set #str-copydata "Making new datafile \"%s\" using default settings")
  36. (set #str-lesscars (cat
  37.     "Everybody who is able to use F1GP-Ed's \"Less cars in races\" patch "
  38.     "should do so.  However, you need to have registered F1GP-Ed and your "
  39.     "Amiga needs enough memory (at least 1.5Mb, approx) so that you can "
  40.     "run F1GP-Ed, F1GP and AGPLapTime together.\n\n"
  41.     "Depending on whether you intend to use this patch or not, a slightly "
  42.     "different datafile will be created for you (either a 26 car grid or "
  43.     "the 1997 real life season data + your own car)\n\n"
  44.     "Will you be using this patch?")
  45. )
  46. (set #str-nofile "You didn't specify a file!  Please try again.")
  47. (set #str-notexist "The file you specified does not exist!  Please try again.")
  48. (set #str-makefailed "Failed to make datafile - returncode: %ld")
  49. (set #str-exit1 (cat
  50.     "Installation complete.  New IAF1GPC complient datafile created in "
  51.     "your \"%s\" drawer (filename \"%s\").\n\nYou should not make any "
  52.     "changes to this datafile.  If you do need to change it, you must "
  53.     "run it through this installer script to make sure it complies to "
  54.     "the IAF1GPC rules.  Therefore, it's probably a good idea to install ")
  55. )
  56. (set #str-exit2 (cat
  57.     "this installer script on your harddrive - just drag the drawer to the "
  58.     "desired location using Workbench.\n\nSend general IAF1GPC queries to "
  59.     "Markus.Kruggel@uni-duisburg.de.  If you have problems with the "
  60.     "datafile or with this installer contact Oliver Roberts (oliver@poboxes.com)")
  61. )
  62.  
  63. ;*******
  64. ; BEGIN
  65. ;
  66.  
  67. (message #str-welcome)
  68.  
  69. (welcome)
  70.  
  71. (set #done 0)
  72. (set #srcfile @default-dest)
  73. (until #done
  74.     (
  75.         (set #srcfile
  76.             (askfile
  77.                 (prompt #str-getsrcfile)
  78.                 (help @askfile-help)
  79.                 (default (pathonly #srcfile))
  80.             )
  81.         )
  82.         (if (OR (= "" (fileonly #srcfile)) (exists #srcfile))
  83.             (set #done 1)
  84.             (message #str-notexist)
  85.         )
  86.     )
  87. )
  88. (if (<> "" (fileonly #srcfile))
  89.     (if (NOT (= 6275 (getsize #srcfile)))
  90.         (abort #str-notdata)
  91.     )
  92. )
  93.  
  94. (set #done 0)
  95. (set #destfile #srcfile)
  96. (until #done
  97.     (
  98.         (set #destfile
  99.             (askfile
  100.                 (prompt #str-getdestfile)
  101.                 (help @askfile-help)
  102.                 (default (pathonly #destfile))
  103.             )
  104.         )
  105.         (if (= "" (fileonly #destfile))
  106.             (message #str-nofile)
  107.             (set #done 1)
  108.         )
  109.     )
  110. )
  111. (if (NOT (exists #destfile))
  112.     (if (OR (< (strlen (fileonly #destfile)) 5) (<> ".f1gp" (substr #destfile (- (strlen #destfile) 5))))
  113.         (set #destfile (cat #destfile ".f1gp"))
  114.     )
  115. )
  116. (set @default-dest (pathonly #destfile))
  117. (if (= "" (fileonly #srcfile))
  118.     (set #srcfile "")
  119. )
  120.  
  121. (set #series
  122.     (askchoice
  123.         (prompt #str-series)
  124.         (help @askchoice-help)
  125.         (choices (if (< @installer-version 42) "Ace" "\x1b[2pAce") "Semi-Pro")
  126.     )
  127. )
  128. (set #icfile ("champ9798_%s.f1gp" (if (= #series 0) "ace" "semipro")))
  129.  
  130. (set #lesscars
  131.     (askbool
  132.         (prompt #str-lesscars)
  133.         (help @askbool-help)
  134.     )
  135. )
  136.  
  137. (set #rc
  138.     (run ("makeicdata \"%s\" \"%s\" \"%s\" %ld" (tackon "Datafiles" #icfile) #srcfile #destfile #lesscars)
  139.         (prompt (if (= "" #srcfile) (#str-copydata #destfile) (#str-makedata #destfile #srcfile)))
  140.         (confirm)
  141.         (help "")
  142.     )
  143. )
  144. (if (<> 0 #rc)
  145.     (abort (#str-makefailed #rc))
  146. )
  147.  
  148. (set #icon (tackon "Datafiles" #icfile))
  149. (if (NOT (exists (cat #icon ".info")))
  150.     (
  151.         (copyfiles
  152.             (prompt #str-copydata)
  153.             (source (cat #icon ".info"))
  154.             (dest @default-dest)
  155.             (help @copyfiles-help)
  156.         )
  157.         (tooltype
  158.             (prompt "")
  159.             (help "")
  160.             (dest #icon)
  161.             (noposition)
  162.         )
  163.     )
  164. )
  165.  
  166. (set #mcmd "")
  167. (if (> (exists ("sys:Utilities/more")) 0) (set #mcmd  "sys:Utilities/more") )
  168. (if (> (exists ("c:more")) 0) (set #mcmd  "c:more") )
  169. (if (> (exists ("c:amigaguide")) 0) (set #mcmd  "c:amigaguide") )
  170. (if (> (exists ("sys:Utilities/amigaguide")) 0) (set #mcmd  "sys:Utilities/amigaguide") )
  171. (if (> (exists ("c:multiview")) 0) (set #mcmd "c:multiview") )
  172. (if (> (exists ("sys:Utilities/multiview")) 0) (set #mcmd  "sys:Utilities/multiview") )
  173.  
  174. (if (<> "" #mcmd)
  175.     (run (cat "run " #mcmd " ReadMe.txt"))
  176. )
  177.  
  178. (if (< @installer-version 42)
  179.     (
  180.         (message (#str-exit1 (pathonly #destfile) (fileonly #destfile)) #str-exit2)
  181.         (exit (quiet))
  182.     )
  183.     (exit (#str-exit1 (pathonly #destfile) (fileonly #destfile)) #str-exit2)
  184. )
  185.