home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / disks / misc / zjtools / install < prev    next >
Text File  |  1996-10-27  |  16KB  |  401 lines

  1. ; $VER: ZJTools Install 1.1 (27.10.96)
  2.  
  3. (set zj-version "1.1")
  4.  
  5. (complete 0)
  6.  
  7. ;=============================================================================
  8. ; English strings
  9.  
  10. (if (= @language "english")
  11.     ((set #def-language      0)
  12.  
  13.      (set #title        (cat "\n"
  14.                              "\nZJTools " zj-version
  15.                              "\n"
  16.                              "\nA software package for Iomega Zip and Jaz drives."
  17.                              "\n"
  18.                              "\nCopyright © 1996, Oliver Hitz"))
  19.  
  20.      (set #cp                "Copying %s...")
  21.  
  22.      (set #select-level      "\nPlease select how the installation should proceed.")
  23.  
  24.      (set #mounted      (cat "\nIf there is a disk in your Zip or Jaz drive, this Installer script will automatically configure ZJTools for use with that drive."
  25.                              "\n"
  26.                              "\nIf there is currently a disk in your drive, select `Proceed', otherwise `Cancel' to end installation."))
  27.      (set #mounted-h    (cat "If a disk is in your drive, this Installer script will read the correct device name, unit and flags settings so no manual setup is required."
  28.                              "\nOf course this is not needed if you want to set up ZJTools by yourself."
  29.                              "\n"
  30.                              "\nPlease note that nothing is written to the disk!"))
  31.      (set #mounted-0         "Cancel")
  32.      (set #mounted-1         "Proceed")
  33.  
  34.      (set #dir               "Where do you want ZJTools to be installed. A new drawer will be created there automatically.")
  35.  
  36.      (set #makedir           "The drawer %s is created.")
  37.  
  38.      (set #catalogs          "Please select the set of catalogs you would like to install.")
  39.  
  40.      (set #components        "Please select what you would like to install.")
  41.      (set #comp-0            "ZJTool")
  42.      (set #comp-1            "ZJToolMUI")
  43.      (set #comp-2            "ZJWatch")
  44.      (set #comp-3            "Documentation")
  45.      (set #components-h (cat "At the moment there are three programs available:"
  46.                              "\nZJWatch: A handy commodity that pops up a requester when read protected disks are inserted."
  47.                              "\nZJTool: A command line driven utility that lets you access special features of your Zip and Jaz drives."
  48.                              "\nZJToolMUI: The same as ZJTool, but with a decent looking MUI interface."))
  49.  
  50.      (set #need-mui     (cat "\nmuimaster.library version 12 or higher could not be found on your system."
  51.                              "\nZJToolMUI will not work without this library."))
  52.  
  53.      (set #need-req     (cat "\nreqtools.library version 38 or higher could not be found on your system."
  54.                              "\nThe ZJWatch program will not work without this library."))
  55.  
  56.      (set #wbstartup    (cat "\nDo you want to copy ZJWatch to your WBStartup drawer?"
  57.                              "\nIt will then automatically be started at boot time."))
  58.      (set #wbstartup-h       "It is recommended that you select `Yes' here. ZJWatch will then automatically available after every boot up.")
  59.  
  60.      (set #docs              "Please select the documentation you would like to install.")
  61.  
  62.      (set #drive             "Please select the drive ZJTools should be set up for.")
  63.      (set #drive-h      (cat "Just select the your Zip or Jaz drive here. This Installer script will then automatically set up ZJTools for that drive. Of course you can always add more drives later on or modify your initial setup."
  64.                              "\n"
  65.                              "\nExample: If you want to use this software with your Zip drive that is usually called `ZIP:', select `ZIP:' from the list of drives."))
  66.      (set #drive-err         "\nCannot set up ZJTools to work with that drive.")
  67.  
  68.      (set #timeout           "\nPlease enter the inactivity spindown timeout in minutes.")
  69.      (set #timeout-h    (cat "Your drive features an automatic spindown after some time of inactivity."
  70.                              "\nThe timeout is set to 15 minutes on Zip drives and to 30 minutes on Jaz drives."
  71.                              "\nUsing ZJTools, you may adjust that timeout to your needs."))
  72.  
  73.      (set #change-path  (cat "\nTo be able to use `ZJTool', your S:User-Startup file needs to get modified."
  74.                              "\nDo you want to continue?"))
  75.  
  76.      (set #done              "\nInstallation of ZJTools done!")
  77.  
  78.      (set #wrong-kick        "\nSorry, ZJTools needs AmigaOS 2.0 or higher!")))
  79.  
  80. ;=============================================================================
  81. ; German strings
  82.  
  83. (if (= @language "deutsch")
  84.     ((set #def-language      1)
  85.  
  86.      (set #title        (cat "\n"
  87.                              "\nZJTools " zj-version
  88.                              "\n"
  89.                              "\nEin Software-Paket für Iomega Zip und Jaz Laufwerke."
  90.                              "\n"
  91.                              "\nCopyright © 1996, Oliver Hitz"))
  92.  
  93.      (set #cp                "Kopieren von %s...")
  94.  
  95.      (set #select-level      "\nBitte wählen Sie, wie die Installation vor sich gehen soll.")
  96.  
  97.      (set #mounted      (cat "\nSie sollten unbedingt eine angemeldete (gemountete) Disk in Ihrem Zip oder Jaz Laufwerk haben. Dieses Installer-Skript ist dann in der Lage, ZJTools automatisch richtig für den Betrieb bei Ihnen zu konfigurieren."
  98.                              "\n"
  99.                              "\nWenn sich eine Disk im Laufwerk befindet, wählen Sie `Weiter', ansonsten brechen Sie die Installation mit `Abbruch' ab und starten Sie den Amiga mit einer Disk im Laufwerk."))
  100.      (set #mounted-h    (cat "Die Voreinstellungsdatei `ENV:ZJTools.prefs' wird vom Installer-Skript automatisch angelegt. Dazu muss aber Ihr Laufwerk angemeldet sein."
  101.                              "\nSie können ZJTools natürlich auch von Hand konfigurieren."
  102.                              "\n"
  103.                              "\nDie Disk wird nur benötigt um die Device/Unit/Flags Informationen zu lesen. Auf der Disk wird nichts verändert!"))
  104.      (set #mounted-0         "Abbruch")
  105.      (set #mounted-1         "Weiter")
  106.  
  107.      (set #dir               "Wo möchten Sie ZJTools installieren? Eine neue Schublade wird automatisch erstellt.")
  108.  
  109.      (set #makedir           "Die Schublade %s wird erstellt.")
  110.  
  111.      (set #catalogs          "Bitte wählen Sie Ihre bevorzugte Sprache aus.")
  112.  
  113.      (set #components        "Bitte wählen Sie aus, welche Teile von ZJTools Sie installieren möchten.")
  114.      (set #comp-0            "ZJTool")
  115.      (set #comp-1            "ZJToolMUI")
  116.      (set #comp-2            "ZJWatch")
  117.      (set #comp-3            "Anleitung")
  118.      (set #components-h (cat "Im Moment besteht ZJTools im Wesentlichen aus drei Programmen:"
  119.                              "\nZJWatch: Ein nützliches Commodity das Ihr Laufwerk auf lesegeschützte Disks überwacht."
  120.                              "\nZJTool: Ein Kommandozeilen-gesteuertes Programm, das Sie alle speziellen Eigenschaften Ihres Zip und Jaz Laufwerkes kontrollieren lässt."
  121.                              "\nZJToolMUI: ZJTool mit einer mächtigen MUI-Oberfläche."))
  122.  
  123.      (set #need-mui     (cat "\nmuimaster.library Version 12 oder höher konnte auf Ihrem System nicht gefunden werden."
  124.                              "\nZJToolMUI funktioniert nicht ohne diese Library."))
  125.  
  126.      (set #need-req     (cat "\nreqtools.library Version 38 oder höher konnte auf Ihrem System nicht gefunden werden."
  127.                              "\nZJWatch funktioniert nicht ohne diese Library."))
  128.  
  129.      (set #wbstartup    (cat "\nMöchten Sie ZJWatch in Ihre WBStartup Schublade kopieren?"
  130.                              "\nZJWatch wird dann bei einem Neustart automatisch gestartet."))
  131.  
  132.      (set #wbstartup-h       "Es wird empfohlen, dass Sie hier `Ja' wählen.")
  133.  
  134.      (set #docs              "Welche Anleitung möchten Sie installieren.")
  135.  
  136.      (set #drive             "Bitte wählen Sie das Laufwerk, für welches Sie ZJTools konfigurieren möchten.")
  137.      (set #drive-h      (cat "Sie brauchen nur Ihr Zip oder Jaz Laufwerk auszuwählen. Das Skript wird dann automatisch Ihre Voreinstellungsdatei generieren und auf Ihrem Rechner installieren. Sie können diese Datei jederzeit selbst ändern."
  138.                              "\n"
  139.                              "\nBeispiel: Wenn Sie diese Software für Ihr Zip Laufwerk, das unter dem Namen `ZIP:' anzusprechen ist, konfigurieren möchten, so wählen Sie bitte `ZIP:' aus der Laufwerksliste."))
  140.      (set #drive-err         "\nZJTools kann nicht für dieses Laufwerk konfiguriert werden.")
  141.  
  142.      (set #timeout           "\nBitte geben Sie die Zeitspanne ein, nach der sich das Laufwerk automatisch in den Bereitschaftsmodus schaltet (in Minuten).")
  143.      (set #timeout-h    (cat "Ihr Laufwerk schaltet sich nach einer gewissen Zeit automatisch in einen Bereitschaftsmodus, wenn es keine Befehle erhält."
  144.                              "\nDiese Zeitspanne liegt normalerweise bei 15 Minuten für Zip Laufwerke und bei 30 Minuten für Jaz Laufwerke."
  145.                              "\nMit ZJTools können Sie diese Zeitspanne selber bestimmen."))
  146.  
  147.      (set #change-path  (cat "\nDamit `ZJTool' in der Shell ohne Pfadangabe benutzt werden kann, ist es nötig, dass die Datei `S:User-Startup' leicht verändert wird."
  148.                              "\nMöchten Sie weitermachen?"))
  149.  
  150.      (set #done              "\nDie Installation von ZJTools ist beendet.")
  151.  
  152.      (set #wrong-kick        "\nEntschuldigen Sie, ZJTools benötigt AmigaOS 2.0 oder höher!")))
  153.  
  154. ;=============================================================================
  155. ; Procedures
  156.  
  157. (procedure P_COPY src dst
  158.   (copyfiles (prompt (#cp src))
  159.              (help @copyfiles-help)
  160.              (source (cat src))
  161.              (dest (cat dst))
  162.              (infos)
  163.              (nogauge)
  164.              (confirm)))
  165.  
  166. (procedure P_COPYQUIET src dst
  167.   (run ("copy >NIL: %s %s" src dst)))
  168.  
  169. ;=============================================================================
  170. ; Main
  171.  
  172. (if (> (/ (getversion "exec.library" (resident)) 65536) 36)
  173.     (
  174.      ; Initialisation =======================================================
  175.  
  176.      (if (exists "MUI:" (noreq))
  177.          (set mui (> (/ (getversion "MUI:MUI") 65536) 11))
  178.          (set mui 0))
  179.  
  180.      (set reqtools (> (/ (getversion "LIBS:reqtools.library") 65536) 37))
  181.  
  182.      ; Welcome message ======================================================
  183.  
  184.      (message #title)
  185.      (welcome #select-level)
  186.      (complete 0)
  187.  
  188.      ; Ask if there is currently a disk in the drive ========================
  189.  
  190.      (if (= (askbool (prompt #mounted)
  191.                      (help #mounted-h)
  192.                      (choices #mounted-1 #mounted-0))
  193.             0)
  194.          (exit (quiet)))
  195.  
  196.      ; Ask where to install ZJTools =========================================
  197.  
  198.      (if (= (exists "SYS:Tools/" (noreq)) 2)
  199.          (set @default-dest (expandpath "SYS:Tools/"))
  200.          (set @default-dest (expandpath @default-dest)))
  201.  
  202.      (set @default-dest (askdir (prompt #dir)
  203.                                 (help @askdir-help)
  204.                                 (default @default-dest)))
  205.  
  206.      (set @default-dest (expandpath @default-dest))
  207.      (set destination (tackon @default-dest "ZJTools"))
  208.  
  209.      ; Create directory and copy drawer icon ================================
  210.  
  211.      (if (= (exists destination) 0)
  212.          ((makedir destination
  213.                    (prompt (#makedir destination))
  214.                    (help @makedir-help)
  215.                    (confirm))
  216.           (run ("copy >NIL: /ZJTools.info %s.info" destination))
  217.           (tooltype (dest destination)
  218.                     (noposition))
  219.           (set update 0))
  220.          (set update 1))
  221.  
  222.      (complete 15)
  223.  
  224.      ; Ask which components to install ======================================
  225.  
  226.      (if (= @user-level 2)
  227.          ((set to-install (askoptions (prompt #components)
  228.                                       (help #components-h)
  229.                                       (choices #comp-0 #comp-1 #comp-2 #comp-3))))
  230.          (set to-install -1))
  231.  
  232.      ; Ask language to install ==============================================
  233.  
  234.      (set cat-path-valid 0)
  235.      (set doc-name-valid 0)
  236.  
  237.      (if (exists "LOCALE:" (noreq))
  238.          ((set cat-number (askchoice (prompt #catalogs)
  239.                                      (help @askchoices-help)
  240.                                      (choices "English (builtin)" "Deutsch" "Français" "Italiano")
  241.                                      (default #def-language)))
  242.           (if (= cat-number 1)
  243.               ((set cat-path "deutsch")
  244.                (set cat-path-valid 1)
  245.                (set doc-name "ZJTools-Deutsch.guide")
  246.                (set doc-name-valid 1)))
  247.           (if (= cat-number 2)
  248.               ((set cat-path "français")
  249.                (set cat-path-valid 1)))
  250.           (if (= cat-number 2)
  251.               ((set cat-path "italiano")
  252.                (set cat-path-valid 1)))))
  253.  
  254.      ; Install each component ===============================================
  255.  
  256.      ; ZJTool
  257.  
  258.      (if (in to-install 0)
  259.          ((copyfiles (prompt (#cp "ZJTool"))
  260.                      (help @copyfiles-help)
  261.                      (source "ZJTool")
  262.                      (dest destination)
  263.                      (infos)
  264.                      (nogauge)
  265.                      (confirm))
  266.           (if cat-path-valid
  267.               (copyfiles (prompt (#cp "zjtool.catalog"))
  268.                          (help @copyfiles-help)
  269.                          (source ("Catalogs/%s/zjtool.catalog" cat-path))
  270.                          (dest ("LOCALE:Catalogs/%s/" cat-path))
  271.                          (infos)
  272.                          (nogauge)
  273.                          (confirm)))))
  274.  
  275.      (complete 30)
  276.  
  277.      ; ZJToolMUI
  278.  
  279.      (if (in to-install 1)
  280.          ((if mui
  281.               ((copyfiles (prompt (#cp "ZJToolMUI"))
  282.                           (help @copyfiles-help)
  283.                           (source "ZJToolMUI")
  284.                           (dest destination)
  285.                           (infos)
  286.                           (nogauge)
  287.                           (confirm))
  288.                (if cat-path-valid
  289.                    (copyfiles (prompt (#cp "zjtoolmui.catalog"))
  290.                               (help @copyfiles-help)
  291.                               (source ("Catalogs/%s/zjtoolmui.catalog" cat-path))
  292.                               (dest ("LOCALE:Catalogs/%s/" cat-path))
  293.                               (infos)
  294.                               (nogauge)
  295.                               (confirm))))
  296.               (message #need-mui))))
  297.  
  298.      (complete 45)
  299.  
  300.      ; ZJWatch: Install in WBStartup if already a version there or
  301.      ;          if userlevel=average and no version is in destination or
  302.      ;          if userlevel=expert and the user wants so.
  303.  
  304.      (if (in to-install 2)
  305.          (if reqtools
  306.              ((set zjwatch-path destination)
  307.               (if (or (exists "SYS:WBStartup/ZJWatch")
  308.                       (and (= @user-level 1)
  309.                            (not (exists (tackon destination "ZJWatch")))))
  310.                   (set zjwatch-path "SYS:WBStartup/")
  311.                   (if (= @user-level 2)
  312.                       (if (askbool (prompt #wbstartup)
  313.                                    (help #wbstartup-h)
  314.                                    (default 1))
  315.                           (set zjwatch-path "SYS:WBStartup/"))))
  316.               (copyfiles (prompt (#cp "ZJWatch"))
  317.                          (help @copyfiles-help)
  318.                          (source "ZJWatch")
  319.                          (dest zjwatch-path)
  320.                          (infos)
  321.                          (nogauge)
  322.                          (confirm))
  323.               (if cat-path-valid
  324.                   (copyfiles (prompt (#cp "zjwatch.catalog"))
  325.                              (help @copyfiles-help)
  326.                              (source ("Catalogs/%s/zjwatch.catalog" cat-path))
  327.                              (dest ("LOCALE:Catalogs/%s/" cat-path))
  328.                              (infos)
  329.                              (nogauge)
  330.                              (confirm)))
  331.               (tooltype (dest (tackon zjwatch-path "ZJWatch"))
  332.                         (settooltype "TOOL" (tackon destination "ZJToolMUI"))
  333.                         (settooltype "ICON" (tackon destination "Icons/Eject")))
  334.               (if (= zjwatch-path "SYS:WBStartup/")
  335.                   (tooltype (dest (tackon zjwatch-path "ZJWatch"))
  336.                             (noposition)))
  337.               (run ("copy >NIL: Icons %s ALL QUIET" (tackon destination "Icons"))))
  338.              (message #need-req)))
  339.  
  340.      (complete 60)
  341.  
  342.      ; Documentation
  343.  
  344.      (if (in to-install 3)
  345.          ((if (not doc-name-valid)
  346.               ((set doc-number (askchoice (prompt #docs)
  347.                                           (help @askchoices-help)
  348.                                           (choices "English" "Deutsch")))
  349.                (if (= doc-number 0)
  350.                    (set doc-name "ZJTools.guide"))
  351.                (if (= doc-number 1)
  352.                    (set doc-name "ZJTools-Deutsch.guide"))))
  353.           (copyfiles (prompt (#cp doc-name))
  354.                      (help @copyfiles-help)
  355.                      (source doc-name)
  356.                      (dest destination)
  357.                      (infos)
  358.                      (nogauge)
  359.                      (confirm))))
  360.  
  361.      (complete 75)
  362.  
  363.      ; Set up the preferences file ============================================
  364.  
  365.      (if (= (or (exists "ENV:ZJTools.prefs")
  366.                 (exists ("%s/ZJTools.prefs" destination))) 0)
  367.          (if (or (in to-install 1) (in to-install 2))
  368.              ((set drive (askdir (disk)
  369.                                  (prompt #drive)
  370.                                  (help #drive-h)
  371.                                  (default "")))
  372.               (if (run ("Misc/GetDevice >NIL: %s" drive))
  373.                   (message #drive-err)
  374.                   ((set timeout (asknumber (prompt #timeout)
  375.                                            (help #timeout-h)
  376.                                            (range 0 255)
  377.                                            (default 15)))
  378.                    (run ("Echo >ENV:ZJTools.prefs `Misc/GetDevice %s`,%ld" drive timeout))
  379.                    (run "Copy >NIL: ENV:ZJTools.prefs ENVARC: QUIET CLONE"))))))
  380.  
  381.      (complete 90)
  382.  
  383.      ; Change startup sequence ==============================================
  384.  
  385.      (startup "ZJTools" (prompt #change-path)
  386.                         (help @startup-help)
  387.                         (command ("PATH %s ADD" destination)))
  388.  
  389.      (complete 99)
  390.  
  391.      ; End ==================================================================
  392.  
  393.      (exit #done (quiet))
  394.     )
  395.  
  396.     ; Wrong system version
  397.  
  398.     (abort #wrong-kick)
  399. )
  400.  
  401.