home *** CD-ROM | disk | FTP | other *** search
- ; Internet Amiga F1GP Championship datafile installer
- ; $VER: Make_IAF1GPC_Datafile 1.0 (18.9.97)
- ;
- ; Copyright © 1997 Oliver Roberts
-
- (if (= (exists "Env:Language") 1)
- (set @language (getenv "Language"))
- )
-
- ;*****************
- ; English strings
- ;
- (set #str-welcome (cat
- "This is more than just your usual installation utility. You can "
- "use it at any time to make sure your datafile complies to the rules. "
- "This utility creates a new datafile by merging the datafile "
- "you usually use, with the offical championship datafile. Only the "
- "required settings to make your datafile comply with the IAF1GPC "
- "rules will be changed (all other settings will remain intact).")
- )
- (set #str-series "Which championship series are you competing in?")
- (set #str-getsrcfile (cat
- "Select the location and filename of your usual F1GP-Ed datafile:\n"
- "(if this is left blank, you'll just get a copy of the championship "
- "datafile)")
- )
- (set #str-notdata "That doesn't appear to be a F1GP-Ed datafile!\n\nInstallation failed.")
- (set #str-getdestfile (cat
- "Select the location and filename of the datafile to be created. "
- "If the file already exists, it will be replaced! If it does not "
- "exist, the prefix \".f1gp\" will be added to the filename, if "
- "necessary.")
- )
- (set #str-makedata "Making new datafile \"%s\" using your settings from \"%s\"")
- (set #str-copydata "Making new datafile \"%s\" using default settings")
- (set #str-lesscars (cat
- "Everybody who is able to use F1GP-Ed's \"Less cars in races\" patch "
- "should do so. However, you need to have registered F1GP-Ed and your "
- "Amiga needs enough memory (at least 1.5Mb, approx) so that you can "
- "run F1GP-Ed, F1GP and AGPLapTime together.\n\n"
- "Depending on whether you intend to use this patch or not, a slightly "
- "different datafile will be created for you (either a 26 car grid or "
- "the 1997 real life season data + your own car)\n\n"
- "Will you be using this patch?")
- )
- (set #str-nofile "You didn't specify a file! Please try again.")
- (set #str-notexist "The file you specified does not exist! Please try again.")
- (set #str-makefailed "Failed to make datafile - returncode: %ld")
- (set #str-exit1 (cat
- "Installation complete. New IAF1GPC complient datafile created in "
- "your \"%s\" drawer (filename \"%s\").\n\nYou should not make any "
- "changes to this datafile. If you do need to change it, you must "
- "run it through this installer script to make sure it complies to "
- "the IAF1GPC rules. Therefore, it's probably a good idea to install ")
- )
- (set #str-exit2 (cat
- "this installer script on your harddrive - just drag the drawer to the "
- "desired location using Workbench.\n\nSend general IAF1GPC queries to "
- "Markus.Kruggel@uni-duisburg.de. If you have problems with the "
- "datafile or with this installer contact Oliver Roberts (oliver@poboxes.com)")
- )
-
- ;*******
- ; BEGIN
- ;
-
- (message #str-welcome)
-
- (welcome)
-
- (set #done 0)
- (set #srcfile @default-dest)
- (until #done
- (
- (set #srcfile
- (askfile
- (prompt #str-getsrcfile)
- (help @askfile-help)
- (default (pathonly #srcfile))
- )
- )
- (if (OR (= "" (fileonly #srcfile)) (exists #srcfile))
- (set #done 1)
- (message #str-notexist)
- )
- )
- )
- (if (<> "" (fileonly #srcfile))
- (if (NOT (= 6275 (getsize #srcfile)))
- (abort #str-notdata)
- )
- )
-
- (set #done 0)
- (set #destfile #srcfile)
- (until #done
- (
- (set #destfile
- (askfile
- (prompt #str-getdestfile)
- (help @askfile-help)
- (default (pathonly #destfile))
- )
- )
- (if (= "" (fileonly #destfile))
- (message #str-nofile)
- (set #done 1)
- )
- )
- )
- (if (NOT (exists #destfile))
- (if (OR (< (strlen (fileonly #destfile)) 5) (<> ".f1gp" (substr #destfile (- (strlen #destfile) 5))))
- (set #destfile (cat #destfile ".f1gp"))
- )
- )
- (set @default-dest (pathonly #destfile))
- (if (= "" (fileonly #srcfile))
- (set #srcfile "")
- )
-
- (set #series
- (askchoice
- (prompt #str-series)
- (help @askchoice-help)
- (choices (if (< @installer-version 42) "Ace" "\x1b[2pAce") "Semi-Pro")
- )
- )
- (set #icfile ("champ9798_%s.f1gp" (if (= #series 0) "ace" "semipro")))
-
- (set #lesscars
- (askbool
- (prompt #str-lesscars)
- (help @askbool-help)
- )
- )
-
- (set #rc
- (run ("makeicdata \"%s\" \"%s\" \"%s\" %ld" (tackon "Datafiles" #icfile) #srcfile #destfile #lesscars)
- (prompt (if (= "" #srcfile) (#str-copydata #destfile) (#str-makedata #destfile #srcfile)))
- (confirm)
- (help "")
- )
- )
- (if (<> 0 #rc)
- (abort (#str-makefailed #rc))
- )
-
- (set #icon (tackon "Datafiles" #icfile))
- (if (NOT (exists (cat #icon ".info")))
- (
- (copyfiles
- (prompt #str-copydata)
- (source (cat #icon ".info"))
- (dest @default-dest)
- (help @copyfiles-help)
- )
- (tooltype
- (prompt "")
- (help "")
- (dest #icon)
- (noposition)
- )
- )
- )
-
- (set #mcmd "")
- (if (> (exists ("sys:Utilities/more")) 0) (set #mcmd "sys:Utilities/more") )
- (if (> (exists ("c:more")) 0) (set #mcmd "c:more") )
- (if (> (exists ("c:amigaguide")) 0) (set #mcmd "c:amigaguide") )
- (if (> (exists ("sys:Utilities/amigaguide")) 0) (set #mcmd "sys:Utilities/amigaguide") )
- (if (> (exists ("c:multiview")) 0) (set #mcmd "c:multiview") )
- (if (> (exists ("sys:Utilities/multiview")) 0) (set #mcmd "sys:Utilities/multiview") )
-
- (if (<> "" #mcmd)
- (run (cat "run " #mcmd " ReadMe.txt"))
- )
-
- (if (< @installer-version 42)
- (
- (message (#str-exit1 (pathonly #destfile) (fileonly #destfile)) #str-exit2)
- (exit (quiet))
- )
- (exit (#str-exit1 (pathonly #destfile) (fileonly #destfile)) #str-exit2)
- )
-