home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 2 / MECOMP-CD-II.iso / amiga / anwender / callman / install < prev   
Encoding:
Text File  |  1997-09-18  |  16.7 KB  |  417 lines

  1. ; ****************************************************************************
  2. ; *                                                                          *
  3. ; *  'CallMan' Install-Script                                                *
  4. ; *  written 1997 by Alexander 'Sascha' Fichtner                             *
  5. ; *                                                                          *
  6. ; *  $VER: CallMan Installer 1.2 (17.09.97)                                  *
  7. ; *                                                                          *
  8. ; *  This installer script is freeware! :-)                                  *
  9. ; *  You may use it (or parts of it) in your own installer scripts...        *
  10. ; *                                                                          *
  11. ; *  You are NOT allowed to ask ANY monetary charge for it!                  *
  12. ; *                                                                          *
  13. ; *  Feel free to send any comments/bugreports to:                           *
  14. ; *                                                                          *
  15. ; *    fichtner@informatik.tu-muenchen.de                                    *
  16. ; *                                                                          *
  17. ; ****************************************************************************
  18.  
  19. (if (= @language "english")
  20.     (
  21.         (set #default_language 1)
  22.         (set #welcome "\n\n\nWelcome to\n\nCallMan\n\n1.2 (17.09.1997)\n\n© Copyright 1997 Alexander 'Sascha' Fichtner" )
  23.         (set #requirements "\n\nRequirements:\n\n- OS 3.0\n- MUI 3.3+\n- screen with at least a size of 640x256\n- a modem" )
  24.         (set #installmode "Would you like to install CallMan from scratch or un-install an older version?")
  25.         (set #installmode_help "Choose 'Install' to install CallMan on your system.\n\nChoose 'Un-install', to remove an already installed version of CallMan from your system." )
  26.         (set #installmode_install "Install" )
  27.         (set #installmode_uninstall "Un-install" )
  28.         (set #default_destination "Where do you wish to install CallMan? The directory 'CallMan' will be created if it is not there." )
  29.         (set #manual "The manual (in AmigaGuide format) is available in different languages. Which version(s) would you like to install?" )
  30.         (set #rates "There are different rates files for the different countries and telephone companies. Which if these rates files would you like to install?" )
  31.         (set #catalogs "Which language catalogs would you like to install?" )
  32.         (set #catalogs_where "Where do you wish to install the language catalogs?" )
  33.         (set #catalogs_locale_full "Not enough free diskspace on LOCALE: ! Copy catalog files to PROGDIR:Catalogs instead?" )
  34.         (set #catalogs_no_locale_assign "Can't find assign LOCALE: ! Copy catalog files to PROGDIR:Catalogs instead?" )
  35.         (set #install "\n\n\n\n\nI'm starting the installation now." )
  36.         (set #not_enough_diskspace "There might be not enough diskspace available on " #dest_dir "..." )
  37.         (set #install_anyway "Install anyway..." )
  38.         (set #abort "Abort installation..." )
  39.         (set #install_abort "Aborted by user..." )
  40.         (set #uninstall_dir "Please specify the 'CallMan' directory." )
  41.         (set #really_uninstall "Do you REALLY want to uninstall CallMan?" )
  42.     )
  43. )
  44.  
  45. (if (= @language "deutsch")
  46.     (
  47.         (set #default_language 2)
  48.         (set #welcome "\n\n\nHerzlich willkommen zu\n\nCallMan\n\n1.2 (17.09.1997)\n\n© Copyright 1997 Alexander 'Sascha' Fichtner" )
  49.         (set #requirements "\n\nSystemvoraussetzungen:\n\n- OS 3.0\n- MUI 3.3+\n- einen Screen mit mindestens 640x256 Screengröße\n- ein Modem" )
  50.         (set #installmode "Wollen Sie CallMan neu installieren oder eine bereits installierte Version wieder entfernen?")
  51.         (set #installmode_help "Wählen Sie 'Installieren', um CallMan in Ihrem System neu zu installieren.\n\nWählen Sie 'Deinstallieren', um eine bereits installierte Version von CallMan so weit wie möglich wieder zu entfernen." )
  52.         (set #installmode_install "Installieren" )
  53.         (set #installmode_uninstall "Deinstallieren" )
  54.         (set #default_destination "Wo möchten Sie CallMan installieren? Falls noch nicht vorhanden, wird dort das Verzeichnis 'CallMan' angelegt." )
  55.         (set #manual "Die Anleitung (im AmigaGuide-Format) liegt in mehreren Sprachen vor. Welche Version(en) möchten Sie installieren?" )
  56.         (set #rates "Es existieren unterschiedliche Gebührendateien für die verschiedenen Länder und Telefongesellschaften. Welche der folgenden Dateien sollen installiert werden?" )
  57.         (set #catalogs "Welche Sprachkataloge möchten Sie installieren?" )
  58.         (set #catalogs_where "Wohin sollen die Sprachkataloge kopiert werden?" )
  59.         (set #catalogs_locale_full "Speicherplatz in LOCALE: reicht nicht aus! Sollen die Katalogdateien stattdessen doch nach PROGDIR:Catalogs kopiert werden?" )
  60.         (set #catalogs_no_locale_assign "Kann das Assign LOCALE: nicht finden! Sollen die Katalogdateien stattdessen doch nach PROGDIR:Catalogs kopiert werden?" )
  61.         (set #install "\n\n\n\n\nIch beginne nun mit der eigentlichen Installation." )
  62.         (set #not_enough_diskspace "Voraussichtlich nicht genug Speicher frei auf " #dest_dir "..." )
  63.         (set #install_anyway "Trotzdem installieren..." )
  64.         (set #abort "Installation abbrechen..." )
  65.         (set #install_abort "Abbruch durch Benutzer..." )
  66.         (set #uninstall_dir "Bitte wählen Sie das Verzeichnis 'CallMan' aus." )
  67.         (set #really_uninstall "Wollen Sie CallMan WIRKLICH deinstallieren?" )
  68.     )
  69. )
  70.  
  71.  
  72. ; ****************************************************************************
  73. ;  install procedure
  74. ; ****************************************************************************
  75.  
  76. (procedure p_install
  77.  
  78.     (set #cm_diskspace_main    0)
  79.     (set #cm_diskspace_catalog 0)
  80.  
  81.     (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "CallMan"           )))
  82.     (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "CallMan.info"      )))
  83.     (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "CM_Converter"      )))
  84.     (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "CM_Converter.info" )))
  85.  
  86.     ; ********************
  87.     ;  choose destination
  88.     ; ********************
  89.     (set #dest_dir
  90.         (askdir (prompt #default_destination )
  91.             (help @askdir-help)
  92.             (default @default-dest)
  93.         )
  94.     )
  95.     (set #install_dir (tackon #dest_dir "CallMan"))
  96.  
  97.     ; ***************
  98.     ;  choose guides
  99.     ; ***************
  100.     (set #cm_guides
  101.         (askoptions
  102.         (prompt #manual)
  103.         (help "")
  104.         (choices " English" " Deutsch")
  105.         (default #default_language)
  106.         )
  107.     )
  108.     (if (IN #cm_guides 0)
  109.         ( ; then
  110.             (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "Docs/CallMan_E.guide"      )))
  111.             (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "Docs/CallMan_E.guide.info" )))
  112.             )
  113.     )
  114.     (if (IN #cm_guides 1)
  115.         ( ; then
  116.             (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "Docs/CallMan_D.guide"      )))
  117.             (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "Docs/CallMan_D.guide.info" )))
  118.         )
  119.     )
  120.     (set #guides_dir (tackon #install_dir "Docs"))
  121.  
  122.     ; ********************
  123.     ;  choose rates files
  124.     ; ********************
  125.     (set #ratesfiles
  126.         (askoptions
  127.         (prompt #rates)
  128.         (help "")
  129.         (choices " Deutsche TELEKOM" )
  130.         (default -1)
  131.         )
  132.     )
  133.     (if (IN #ratesfiles 0) (set #cm_diskspace_main (+ #cm_diskspace_main (getsize "Rates/DeutscheTELEKOM.rates" ))))
  134.     (set #rates_dir (tackon #install_dir "Rates"))
  135.  
  136.     ; *****************
  137.     ;  choose catalogs
  138.     ; *****************
  139.     (set #cm_language
  140.         (askoptions
  141.         (prompt #catalogs)
  142.         (help "")
  143.         (choices " English (built-in)" " Deutsch")
  144.         (default #default_language)
  145.         )
  146.     )
  147.     (if (<> #cm_language 1)
  148.         ( ; then
  149.             (if (IN #cm_language 1) (set #cm_diskspace_catalog (+ #cm_diskspace_catalog (getsize "Catalogs/deutsch/CallMan.catalog"      ))))
  150.             (if (IN #cm_language 1) (set #cm_diskspace_catalog (+ #cm_diskspace_catalog (getsize "Catalogs/deutsch/CM_Converter.catalog" ))))
  151.             ; ****************************
  152.             ;  choose catalog destination
  153.             ; ****************************
  154.             (set #catalog_dest
  155.                 (askchoice
  156.                 (prompt #catalogs_where)
  157.                 (help "")
  158.                 (choices "LOCALE:Catalogs" "PROGDIR:Catalogs")
  159.                 (default 1)
  160.                 )
  161.             )
  162.             (if (= #catalog_dest 0)
  163.                 (
  164.                     (set #locale_path (getassign "LOCALE"))
  165.                     (if (= #locale_path "")
  166.                         ( ; then
  167.                             (set #bool
  168.                                 (askbool
  169.                                 (prompt #catalogs_no_locale_assign )
  170.                                 (help "")
  171.                                 (default 1)
  172.                                 )
  173.                             )
  174.                             (if (= #bool 1)
  175.                                 (set #catalog_dest 1)
  176.                                 (set #catalog_dest 3)
  177.                             )
  178.                         )
  179.  
  180.                         ( ; else
  181.                             (set #free_disk_space_catalog #locale_path )
  182.                             (if (< #free_disk_space_catalog #cm_disk_space_catalog)
  183.                                 (
  184.                                     (set #bool
  185.                                         (askbool
  186.                                         (prompt #catalogs_locale_full )
  187.                                         (help "")
  188.                                         (default 1)
  189.                                         )
  190.                                     )
  191.                                     (if (= #bool 1)
  192.                                         (set #catalog_dest 1)
  193.                                         (set #catalog_dest 3)
  194.                                     )
  195.                                 )
  196.                             )
  197.                         )
  198.                     )
  199.                 )
  200.             )
  201.  
  202.             (if (= #catalog_dest 1)
  203.                 (
  204.                     (set #cm_diskspace_main (+ #cm_diskspace_main #cm_diskspace_catalog))
  205.                 )
  206.             )
  207.         )
  208.     )
  209.     (set #catalogs_dir (tackon #install_dir "Catalogs"))
  210.  
  211.     ; ***************
  212.     ;  install files
  213.     ; ***************
  214.     (message #install)
  215.     (set #install_bool 1)
  216.     (if (<> (getdevice #dest_dir) "RAM" )
  217.         ( ; then
  218.             (set #free_disk_space_main (getdiskspace #dest_dir ))
  219.             (if (< #free_disk_space_main #cm_diskspace_main)
  220.                 ( ; then
  221.                     (set #install_bool 0)
  222.                     (set #bool
  223.                         (askbool
  224.                         (prompt #not_enough_diskspace )
  225.                         (help "" )
  226.                         (default 1)
  227.                         (choices #install_anyway #abort )
  228.                         )
  229.                     )
  230.                     (if (= #bool 0) (exit #install_abort (quiet)) )
  231.                     (if (= #bool 1) (set #install_bool 1) )
  232.                 )
  233.             )
  234.         )
  235.     )
  236.     (if (= #install_bool 1)
  237.         ( ; then
  238.             (complete 0)
  239.             (makedir #install_dir (infos) )
  240.             (copylib (source "CallMan"     ) (dest #install_dir) (infos) )
  241.             (copylib (source "CM_Converter") (dest #install_dir) (infos) )
  242.             (copylib (source "Install"     ) (dest #install_dir) (infos) )
  243.  
  244.             (complete 25)
  245.             (if (<> #cm_guides 0)
  246.                 ( ; then
  247.                     (makedir #guides_dir (infos) )
  248.                     (if (IN #cm_guides 0) (copylib (source "Docs/CallMan_E.guide") (dest #guides_dir) (infos) ))
  249.                     (if (IN #cm_guides 1) (copylib (source "Docs/CallMan_D.guide") (dest #guides_dir) (infos) ))
  250.                 )
  251.             )
  252.  
  253.             (complete 50)
  254.             (if (<> #ratesfiles 0)
  255.                 ( ; then
  256.                     (makedir #rates_dir )
  257.                     (if (IN #ratesfiles 0) (copylib (source "Rates/DeutscheTELEKOM.rates") (dest #rates_dir) (infos) ))
  258.                 )
  259.             )
  260.  
  261.             (complete 75)
  262.             (if (= #catalog_dest 0)
  263.                 ( ; then
  264.                     (if (IN #cm_language 1) (copylib (source "Catalogs/deutsch/CallMan.catalog"     ) (dest "LOCALE:Catalogs/deutsch") ) )
  265.                     (if (IN #cm_language 1) (copylib (source "Catalogs/deutsch/CM_Converter.catalog") (dest "LOCALE:Catalogs/deutsch") ) )
  266.                 )
  267.                 ( ; else
  268.                     (makedir #catalogs_dir )
  269.                     (if (IN #cm_language 1) (copylib (source "Catalogs/deutsch/CallMan.catalog"     ) (dest (tackon #catalogs_dir "deutsch")) ) )
  270.                     (if (IN #cm_language 1) (copylib (source "Catalogs/deutsch/CM_Converter.catalog") (dest (tackon #catalogs_dir "deutsch")) ) )
  271.                 )
  272.             )
  273.  
  274.         )
  275.     )
  276.     (complete 100)
  277. )
  278.  
  279.  
  280. ; ****************************************************************************
  281. ;  deinstall procedure
  282. ; ****************************************************************************
  283.  
  284. (procedure p_uninstall
  285.  
  286.     (if (= @user-level 0) (user 1))
  287.  
  288.     ; ********************
  289.     ;  choose CallMan dir
  290.     ; ********************
  291.     (set #script_dir (pathonly @icon))
  292.     (set #uninstall_dir
  293.         (askdir (prompt #uninstall_dir )
  294.             (help @askdir-help)
  295.             (default #script_dir )
  296.         )
  297.     )
  298.  
  299.     ; ****************
  300.     ;  security check
  301.     ; ****************
  302.     (set #bool
  303.         (askbool
  304.             (prompt #really_uninstall )
  305.             (help "" )
  306.             (default 1)
  307.         )
  308.     )
  309.     (if (= #bool 0) (exit #install_abort (quiet)) )
  310.  
  311.     ; *****************
  312.     ;  delete catalogs
  313.     ; *****************
  314.     (if (exists (tackon #uninstall_dir "Catalogs"))
  315.         ( ; then
  316.             (set #catalogs_dir (tackon #uninstall_dir "Catalogs" ))
  317.             (foreach #catalogs_dir "#?"
  318.                 (
  319.                     (delete (tackon #catalogs_dir (tackon @each-name "CallMan.catalog"      ) ) )
  320.                     (delete (tackon #catalogs_dir (tackon @each-name "CM_Converter.catalog" ) ) )
  321.                     (delete (tackon #catalogs_dir @each-name ) )
  322.                 )
  323.             )
  324.             (delete #catalogs_dir )
  325.         )
  326.         ( ; else
  327.             (set #catalogs_dir "LOCALE:Catalogs" )
  328.             (foreach #catalogs_dir "#?"
  329.                 (
  330.                     (delete (tackon #catalogs_dir (tackon @each-name "CallMan.catalog"      ) ) )
  331.                     (delete (tackon #catalogs_dir (tackon @each-name "CM_Converter.catalog" ) ) )
  332.                 )
  333.             )
  334.         )
  335.     )
  336.  
  337.     ; ********************
  338.     ;  delete rates files
  339.     ; ********************
  340.     (set #rates_dir (tackon #uninstall_dir "Rates" ))
  341.     (delete (tackon #rates_dir "DeutscheTELEKOM.rates") )
  342.     (delete #rates_dir)
  343.  
  344.     ; ***************
  345.     ;  delete guides
  346.     ; ***************
  347.     (set #guides_dir      (tackon #uninstall_dir "Docs"      ))
  348.     (set #guides_dir.info (tackon #uninstall_dir "Docs.info" ))
  349.     (if (exists #guides_dir)
  350.         (
  351.             (foreach #guides_dir "CallMan#?.guide#?"
  352.                 (
  353.                     (delete (tackon #guides_dir @each-name) )
  354.                 )
  355.             )
  356.         )
  357.     )
  358.     (delete #guides_dir      )
  359.     (delete #guides_dir.info )
  360.  
  361.     ; ****************
  362.     ;  delete CallMan
  363.     ; ****************
  364.     (set #Install      (tackon #uninstall_dir "Install"           ))
  365.     (set #Install.info (tackon #uninstall_dir "Install.info"      ))
  366.     (set #Convert      (tackon #uninstall_dir "CM_Converter"      ))
  367.     (set #Convert.info (tackon #uninstall_dir "CM_Converter.info" ))
  368.     (set #CallMan      (tackon #uninstall_dir "CallMan"           ))
  369.     (set #CallMan.info (tackon #uninstall_dir "CallMan.info"      ))
  370.     (delete #Install      )
  371.     (delete #Install.info )
  372.     (delete #Convert      )
  373.     (delete #Convert.info )
  374.     (delete #CallMan      )
  375.     (delete #CallMan.info )
  376.  
  377.     ; **************************
  378.     ;  remove CallMan directory
  379.     ; **************************
  380.     (delete #uninstall_dir )
  381. )
  382.  
  383.  
  384. ; ****************************************************************************
  385. ;  MAIN
  386. ; ****************************************************************************
  387.  
  388. (message #welcome)
  389. (message #requirements)
  390.  
  391. ; ************************************
  392. ;  choose mode (install or deinstall)
  393. ; ************************************
  394. (set #mode
  395.     (askchoice
  396.     (prompt #installmode )
  397.     (help #installmode_help )
  398.     (choices #installmode_install #installmode_uninstall )
  399.     (default 0)
  400.     )
  401. )
  402. (welcome)
  403.  
  404. (if (= #mode 0)
  405.     ( ; then
  406.         (p_install)
  407.     )
  408. )
  409.  
  410. (if (= #mode 1)
  411.     ( ; then
  412.         (p_uninstall)
  413.     )
  414. )
  415.  
  416.  
  417.