home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 8 / amigaformatcd08.iso / screenplay / utilities / stccg / install next >
Text File  |  1996-11-05  |  11KB  |  326 lines

  1. ; Install-Script for STCCG.guide
  2. ;
  3. ; © 1996 Ralf Schwate
  4. ;
  5. ; $VER:STCCG-install 2.0 (04-Nov-96)
  6. ;
  7. ; Version 2.0
  8. ;
  9. ; 2.0  revamped, deletes 1.x installation and starts over again:-)
  10. ;      dirty hack, hope it does run in all cases...
  11. ; 1.1  usable now for updates. checks whether data-files exist!
  12. ; 1.0  Initial Release
  13. ;
  14. (if (= @language "english")
  15.     (
  16.         (set @abort-button "Cancel installation")
  17.         (set @app-name "STCCGguide")
  18.         (set #stccg_introduction (cat "\n"
  19.  
  20.             "STCCG.guide 2.0                                    \n"
  21.             "All Rights Reserved.                               \n"
  22.             "                                                   \n"
  23.             "©1996 Ralf Schwate                                 \n"
  24.             "                                                   \n"
  25.             "An AmigaGuide-Database for the Card Game           \n"
  26.             "Star Trek: The Next Generation                     \n"
  27.         ))
  28.         (set #stccg_error (cat "\n"
  29.  
  30.             " Some error has occured. Please inform the author  \n"
  31.             " (e.g. Ralf.Schwate@mch.sni.de) after having tried \n"
  32.             " a different Installer release.                    \n"
  33.         ))
  34.         (set #stccg_datafile_missing (cat "\n"
  35.  
  36.             " Datafiles are missing! You also need the archive  \n"
  37.             " STCCGdata.lha extracted in the same directory     \n"
  38.             " where you extracted this archive!                 \n"
  39.             "\n"
  40.             " Aborting install....                              \n"
  41.         ))
  42.         (set #stccg_where "\nPlease select a destination for the STCCG.guide drawer")
  43.         (set #stccg_where_help
  44.             (cat "Use this dialogue to select the partition or the directory where you "
  45.                  "want the STCCG.guide drawer to be created.\n\n"
  46.                  @askdir-help
  47.             )
  48.         )
  49.         (set #stccg_update_install (cat "\n"
  50.  
  51.             " You already have STCCG.guide installed. This      \n"
  52.             " installation assumes, you want an update of the   \n"
  53.             " installation.                                     \n\n"
  54.             " If you want to install new, abort the installation\n"
  55.             " remove the assign 'STCCG:' ('assign STCCG: remove'\n"
  56.             " in a shell) and start the installation a second   \n"
  57.             " time!                                             \n"
  58.         ))
  59.         (set #stccg_new_install (cat "\n"
  60.  
  61.             " This is a new installation of STCCG.guide!        \n"
  62.             " A directory will be created in which all files    \n"
  63.             " will be copied!                                   \n"
  64.         ))
  65.         (set #stccg_already_installed_font (cat "\n"
  66.  
  67.             " It seems you already have installed a             \n"
  68.             " StarTrek.font!                                    \n"
  69.             " You need an 8pt size font to use the Guides       \n"
  70.             " correctly. If you installed this font with a      \n"
  71.             " previous STCCGguide version you are safe.         \n"
  72.         ))
  73.         (set #stccg_already_installed_crille (cat "\n"
  74.  
  75.             " It seems you already have installed a             \n"
  76.             " StarTrekTNGCrille.font!                           \n"
  77.             " You need an 30pt size font to use the Guides      \n"
  78.             " correctly. If you installed this font with a      \n"
  79.             " previous STCCGguide version you are safe.         \n"
  80.         ))
  81.         (set #stccg_install_font "Installing needed fonts in Fonts:?\n")
  82.         (set #stccg_install_font_help (cat "\n"
  83.  
  84.             " STCCG.guide needs the font StarTrek.font in size 8\n"
  85.             " to correctly display some of its pages.           \n"
  86.             " The installer script tries to install this font   \n"
  87.             " into the Fonts:-directory.                        \n"
  88.         ))
  89.         (set #stccg_install_crillefont_help (cat "\n"
  90.  
  91.             " STCCG.guide needs the font StarTrekTNGCrille.font \n"
  92.             " in size 30 to correctly display some of its pages.\n"
  93.             " The installer script tries to install this font   \n"
  94.             " into the Fonts:-directory.                        \n"
  95.         ))
  96.         (set #stccg_delete "\nOld files in STCCG: removed!\n")
  97.         (set #stccg_delete_help (cat "\n"
  98.  
  99.             " There is a new structure in the STCCG:-directory. \n"
  100.             " Since this installation includes all guide-files  \n"
  101.             " it is save to remove the old installation.        \n"
  102.             " If you don't want this abort this installation and\n"
  103.             " remove the STCCG:-assign by hand (so this instal- \n"
  104.             " lation assumes a first installation).             \n"
  105.         ))
  106.         (set #stccg_add_assign "\nAdd STCCG assign to user-startup?\n")
  107.         (set #stccg_add_assign_help (cat "\n"
  108.  
  109.             " STCCG.guide needs this assign to find crosslinked \n"
  110.             " files in it's database!                           \n"
  111.         ))
  112.         (set #stccg_install_show_script (cat
  113.  
  114.             " There is already a show-script installed!         \n"
  115.             " Do you want to update the current show-script?    \n"
  116.         ))
  117.         (set #stccg_install_show_script_help (cat "\n"
  118.  
  119.             " STCCG.guide needs the show-script to show pictures\n"
  120.             " contained in the guide. There should be no need to\n"
  121.             " update the current script. Only if the viewing    \n"
  122.             " utility cannot be found anymore.                  \n"
  123.         ))
  124.         (set #stccg_viewer "\nPlease select a viewer for pictures in the database")
  125.         (set #stccg_viewer_help (cat "\n"
  126.  
  127.             " STCCG.guide needs this file to show the pictures  \n"
  128.             " included in the database. Should support jpg- and \n"
  129.             " gif-formats (jpg is sufficient, there are no more \n"
  130.             " gifs any more)!                                   \n"
  131.         ))
  132.         (set #stccg_complete (cat "\n"
  133.             " Installation complete.                            \n\n"
  134.             " You may consider to install also the picture files\n"
  135.             " with their own installer, so you can view the card\n"
  136.             " pictures from the guide...                        \n\n"
  137.             " Enjoy...                                          \n"
  138.         ))
  139.     )
  140. )
  141.  
  142. ; ** Setting of Variables
  143. ;
  144.  
  145. (set install_mode 0)
  146. (set install_mode_new 0)
  147. (set install_mode_update 1)
  148. (set install_show_script 1)
  149. (set install_show_script_no 0)
  150. (set install_show_script_yes 1)
  151.  
  152. (onerror (
  153.  
  154.     (if (> @ioerr 0)
  155.  
  156.         (message (cat "\n ERROR CODE: " @ioerr "\n\n" #stccg_error))
  157.     )
  158. ))
  159.  
  160.  
  161. ; ** Start of Installation
  162. ;
  163.  
  164.  
  165. (message #stccg_introduction)
  166.  
  167. (welcome)
  168.  
  169. (transcript "On installing STCCG.guide ...")
  170.  
  171. (complete 0)
  172.  
  173. (if (exists "USER:" (noreq))
  174.     (set #stccg_default "USER:")
  175.     (set #stccg_default "SYS:TOOLS")
  176. )
  177.  
  178. (if (exists "STCCG:" (noreq))
  179.     (
  180.         (message #stccg_update_install)
  181.         (set install_mode install_mode_update)
  182.     )
  183.     (
  184.         (message #stccg_new_install)
  185.         (set install_mode install_mode_new)
  186.     )
  187. )
  188.  
  189. (if (= install_mode install_mode_new)
  190.     (
  191.         (set install_path
  192.             (askdir
  193.                 (prompt #stccg_where)
  194.                 (help   #stccg_where_help)
  195.                 (default #stccg_default)
  196.             )
  197.         )
  198.     )
  199. )
  200.  
  201. (if (= install_mode install_mode_update)
  202.     (
  203.         (set install_dir (expandpath "STCCG:"))
  204.         (if (exists "STCCG:show" (noreq))
  205.             (
  206.                 (copyfiles (source "STCCG:show") (dest "T:"))
  207.             )
  208.         )
  209.         (delete ("STCCG:#?") (prompt #stccg_delete) (confirm) (help #stccg_delete_help) (optional force))
  210.     )
  211.  
  212.     (
  213.         (set install_dir (tackon install_path "STCCGguide"))
  214.  
  215.         (if (exists install_dir)
  216.             (exit "should not happen yet!\n" (quiet))
  217.  
  218.             (
  219.                 (makedir install_dir (infos))
  220.             )
  221.         )
  222.  
  223.         (makeassign "STCCG" install_dir)
  224.     )
  225. )
  226.  
  227. (set @default-dest (install_dir))
  228.  
  229. (complete 10)
  230.  
  231. (copyfiles (source "Guides") (dest "STCCG:") (all))
  232.  
  233. (complete 70)
  234.  
  235. (if (exists "fonts:StarTrek" (noreq))
  236.     (message #stccg_already_installed_font)
  237.     (copyfiles
  238.         (prompt #stccg_install_font)
  239.         (help #stccg_install_font_help)
  240.         (source "Fonts")
  241.         (dest "Fonts:")
  242.     )
  243. )
  244.  
  245. (if (exists "fonts:StarTrekTNGCrille" (noreq))
  246.     (message #stccg_already_installed_crille)
  247.     (copyfiles
  248.         (prompt #stccg_install_font)
  249.         (help #stccg_install_crillefont_help)
  250.         (source "Fonts")
  251.         (dest "Fonts:")
  252.     )
  253. )
  254.  
  255. (complete 80)
  256.  
  257. (startup "STCCGguide"
  258.     (prompt #stccg_add_assign)
  259.     (help   #stccg_add_assign_help)
  260.  
  261.     (command ("assign >nil: STCCG: %s" install_dir))
  262. )
  263.  
  264. (complete 90)
  265.  
  266. (set install_show_script install_show_script_no)
  267. (if (exists "STCCG:show" (noreq))
  268.     (set install_show_script
  269.         (askbool
  270.             (prompt #stccg_install_show_script)
  271.             (help #stccg_install_show_script_help)
  272.             (default 0)
  273.         )
  274.     )
  275.     (if (= install_mode install_mode_update)
  276.         (if (exists "T:show" (noreq))
  277.             (
  278.                 (set install_show_script
  279.                     (askbool
  280.                         (prompt #stccg_install_show_script)
  281.                         (help #stccg_install_show_script_help)
  282.                         (default 0)
  283.                     )
  284.                 )
  285.                 (if (= install_show_script install_show_script_yes)
  286.                     (copyfiles (source "T:show") (dest "STCCG:"))
  287.                     (delete ("T:show") (optional force))
  288.                 )
  289.             )
  290.             (set install_show_script install_show_script_no)
  291.         )
  292.         (set install_show_script install_show_script_no)
  293.     )
  294. )
  295.  
  296. (if (= install_show_script install_show_script_no)
  297.     (
  298.         (if (exists "c:")
  299.             (set viewer_default "c:")
  300.             (set viewer_default "")
  301.         )
  302.         (if (exists "c:vt")
  303.             (set viewer_default "c:vt")
  304.             (set viewer_default "")
  305.         )
  306.         (if (exists "c_aminet:vt")
  307.             (set viewer_default "c_aminet:vt")
  308.             (set viewer_default "")
  309.         )
  310.         (set #show_file
  311.             (askfile
  312.                 (prompt #stccg_viewer)
  313.                 (help   #stccg_viewer_help)
  314.                 (default viewer_default)
  315.             )
  316.         )
  317.         (set stccg_show (".key pic\n%s <pic> &\n" #show_file))
  318.         (textfile (dest "STCCG:show") (append stccg_show))
  319.     )
  320. )
  321.  
  322. (complete 100)
  323.  
  324. (exit #stccg_complete)
  325.  
  326.