home *** CD-ROM | disk | FTP | other *** search
/ Amiga Computing 105 / ac105a.adf / Doopsi.lzx / DoopsiInstall < prev    next >
Text File  |  2002-07-30  |  9KB  |  257 lines

  1. ;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  2. ;\                                              /
  3. ;/      The Doopsi Installer                    \
  4. ;\                                              /
  5. ;/      written by:  Andrea Galimberti          \
  6. ;\                                              /
  7. ;/      $VER: Doopsi Installer V1.00 (1996)     \
  8. ;\                                              /
  9. ;/                                              \
  10. ;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  11.  
  12.  
  13. ;* preamble
  14.  
  15. (set @app-name "Doopsi")
  16. (set @user-level 2)
  17.  
  18. (procedure addslash (
  19.    (set len (- (strlen dest_dir) 1))
  20.    (if (= (substr dest_dir len 1) ":")
  21.       (set new_dest dest_dir)
  22.       (set new_dest (cat dest_dir "/"))
  23.    )
  24.                     ) ;end proc
  25. )
  26.  
  27.  
  28. ;* messages
  29.  
  30. (if (= @language "italiano")
  31.    (
  32.       (set welcome_msg (cat "Benvenuti nel meraviglioso mondo di Doopsi!\n\n"
  33.          "Prima di iniziare dovete accertarvi di due cose: "
  34.          "primo, questo script di installazione Deve essere nella directory "
  35.          "dove avete messo gli archivi Programs.lha e Tutorial.lha, "
  36.          "altrimenti avrete un paio di noiosi errori \"File non trovato\"; "
  37.          "secondo, suppongo che la vostra Lha utility sia nel path, "
  38.          "altrimenti non posso trovarla.\n\n\n"
  39.          "Siete pronti?    Iniziamo!"
  40.                        )
  41.       )
  42.       (set selectdest_msg (cat "Selezionare la directory destinazione.\n"
  43.          "La directory Doopsi verrà creata automaticamente.")
  44.       )
  45.       (set selectfiles_msg "Selezionare i files da installare")
  46.       (set firstc_msg "Eseguibili Doopsi")
  47.       (set secondc_msg "Tutorial")
  48.       (set decprg_msg "Sto decomprimendo i Programmi in ")
  49.       (set dectut_msg "Sto decomprimendo il Tutorial in ")
  50.       (set deccat_msg "Sto decomprimendo i Cataloghi in ")
  51.       (set err_msg (cat "Si è verificato un errore!\n"
  52.                         "(Vi avevo detto di stare attenti)\n\n")
  53.       )
  54.       (set notfound_msg "non trovato")
  55.       (set copyloc_msg (cat "Sto copiando \"locator.library\" nella "
  56.                             "vostra directory LIBS:"
  57.                             "(non preoccupatevi: solo se è una versione "
  58.                             "più recente)")
  59.       )
  60.       (set copyreq_msg (cat "Sto copiando \"reqtools.library\" nella "
  61.                             "vostra directory LIBS:"
  62.                             "(non preoccupatevi: solo se è una versione "
  63.                             "più recente)")
  64.       )
  65.       (set assign_msg (cat "\n Ora dovete assegnare Doopsi: alla directory "
  66.          "in cui avete copiato l'Editor. L'installer eseguirà questo "
  67.          "compito al vostro posto nel seguente passaggio."
  68.                       )
  69.       )
  70.       (set users_msg (cat "Sto modificando la user-startup:\n\n\n"
  71.                           "aggiungo la seguente riga:\n\n")
  72.       )
  73.       (set exitbad_msg (cat "Installazione non così completa: sembra si "
  74.          "sia verificato almeno un errore. Rileggete i suggerimenti che "
  75.          "appaiono all'inizio dell'installazione e riprovate (sarete più "
  76.          "fortunati).")
  77.       )
  78.       (set exitgood_msg (cat "Ora siete pronti per entrare in un nuovo "
  79.          "mondo: Doopsi sarà un'esperienza indimenticabile!\n\n"
  80.          "Buon divertimento!")
  81.       )
  82.    )
  83.    (
  84.       (set welcome_msg (cat "Welcome to the wonderful world of Doopsi!\n\n"
  85.          "Before we start you have to make sure of two things: "
  86.          "first, this installer script Must be in the directory where "
  87.          "you put the archives Programs.lha and Tutorial.lha, "
  88.          "otherwise you'll get a couple of annoying \"File not found\" "
  89.          "errors; second, I suppose your Lha utility is in your path, "
  90.          "otherwise I cannot find it.\n\n\n"
  91.          "Are you ready?    Let's go!"
  92.                        )
  93.       )
  94.       (set selectdest_msg (cat "Select destination directory.\n"
  95.          "The Doopsi directory will be automatically created.")
  96.       )
  97.       (set selectfiles_msg "Select which files to install")
  98.       (set firstc_msg "Doopsi executables")
  99.       (set secondc_msg "Tutorial")
  100.       (set decprg_msg "Decompressing Program files to ")
  101.       (set dectut_msg "Decompressing Tutorial files to ")
  102.       (set err_msg (cat "An error has occurred!\n"
  103.                         "(Well, I told you to be careful)\n\n")
  104.       )
  105.       (set notfound_msg "not found")
  106.       (set copyloc_msg (cat "Copying \"locator.library\" to your "
  107.                             "LIBS: directory\n"
  108.                             "(don't worry: only if newer version)")
  109.       )
  110.       (set copyreq_msg (cat "Copying \"reqtools.library\" to your "
  111.                             "LIBS: directory\n"
  112.                             "(don't worry: only if newer version)")
  113.       )
  114.       (set assign_msg (cat "\n Now you need to assign Doopsi: to the "
  115.          "directory where you put the Doopsi Editor.  The Installer will "
  116.          "do it for you in the next step."
  117.                       )
  118.       )
  119.       (set users_msg (cat "Modifying the user-startup:\n\n\n adding "
  120.                           "the following line:\n\n")
  121.       )
  122.       (set exitbad_msg (cat "Installation not so complete: it seems that "
  123.          "at least one error has occurred. Reread the hints that appear "
  124.          "at the beginning of the installation and retry (maybe you'll "
  125.          "be luckier).")
  126.       )
  127.       (set exitgood_msg (cat "You are now ready to enter a new world: "
  128.          "Doopsi will be an unforgettable experience!\n\n"
  129.          "Have fun!")
  130.       )
  131.    )
  132. )
  133.  
  134.  
  135. ;* begin
  136.  
  137. (message welcome_msg)
  138.  
  139. (set oldpath (getassign ("Doopsi")))
  140. (if (<> oldpath 0)
  141.    (
  142.       (set oldpath (pathonly oldpath))
  143.       (set default_dir oldpath)
  144.    )
  145.    (set default_dir "Doopsi")
  146. )
  147.  
  148. (set dest_dir (askdir (prompt selectdest_msg)
  149.                       (default default_dir)
  150.                       (newpath) (disk)
  151.                       (help @askdir-help)
  152.               )
  153. )
  154.  
  155. (set @default-dest dest_dir)
  156.  
  157. (set user_selected (askoptions (prompt selectfiles_msg)
  158.                                (choices firstc_msg
  159.                                         secondc_msg
  160.                                )
  161.                                (help @askoptions-help)
  162.                    )
  163. )
  164.  
  165. (if (BITAND %01 user_selected)
  166.    (
  167.       (working "\n\n" decprg_msg dest_dir)
  168.       (addslash)
  169.       (if (NOT (exists "Programs.lha" (noreq)))
  170.          (
  171.             (message err_msg "Programs.lha " notfound_msg)
  172.             (set an_error 1)
  173.          )
  174.          (
  175.             (run ("lha x Programs.lha \"%s\"" new_dest))
  176.             (if (= @language "italiano")
  177.                (
  178.                   (working "\n\n" deccat_msg dest_dir)
  179.                   (run ("lha x Catalogs.lha \"%s\"" new_dest))
  180.                )
  181.             )
  182.             (copylib (prompt copyloc_msg)
  183.                      (source (cat new_dest "libs/locator.library"))
  184.                      (dest "Libs:")
  185.                      (nogauge)
  186.                      (help @copylib-help)
  187.                      (confirm)
  188.             )
  189.             (copylib (prompt copyreq_msg)
  190.                      (source (cat new_dest "libs/reqtools.library"))
  191.                      (dest "Libs:")
  192.                      (nogauge)
  193.                      (help @copylib-help)
  194.                      (confirm)
  195.             )
  196.             (delete (cat new_dest "libs/locator.library")
  197.                     (optional force)
  198.                     (help @delete-help)
  199.             )
  200.             (delete (cat new_dest "libs/reqtools.library")
  201.                     (optional force)
  202.                     (help @delete-help)
  203.             )
  204.             (delete (cat new_dest "libs")
  205.                     (optional force)
  206.                     (help @delete-help)
  207.             )
  208.             (set flag 1)
  209.          )
  210.       );EndIf
  211.    )
  212. )
  213.  
  214. (if (BITAND %10 user_selected)
  215.    (
  216.       (working "\n\n" dectut_msg dest_dir)
  217.       (if (NOT new_dest)
  218.          (addslash)
  219.       )
  220.       (if (NOT (exists "Tutorial.lha" (noreq)))
  221.          (
  222.             (message err_msg "Tutorial.lha " notfound_msg)
  223.             (set an_error 1)
  224.          )
  225.          (run ("lha x Tutorial.lha \"%s\"" new_dest))
  226.       )
  227.  
  228.    )
  229. )
  230.  
  231.  
  232. (if (= flag 1)
  233.    (if (<> oldpath dest_dir)
  234.       (
  235.          (message assign_msg)
  236.          (startup @app-name (prompt users_msg
  237.                                     "Assign Doopsi: \""
  238.                                     (tackon dest_dir "DOOPSI") "\""
  239.                             )
  240.                   (command (cat "assign Doopsi: \""
  241.                                 (tackon dest_dir "DOOPSI") "\"")
  242.                   )
  243.                   (help @startup-help)
  244.          )
  245.          (makeassign "Doopsi" (tackon dest_dir "DOOPSI"))
  246.       )
  247.    )
  248. )
  249.  
  250.  
  251. ;* epilogue
  252.  
  253. (if (= an_error 1)
  254.    (exit exitbad_msg)
  255.    (exit exitgood_msg)
  256. )
  257.