home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / bazy / v2.1 / comic.install < prev    next >
Text File  |  1997-06-08  |  18KB  |  507 lines

  1. ;
  2. ;    Installationsskript zur Comicverwaltung
  3. ;
  4. ;        Andreas Zottmann, 16.7.94
  5. ;
  6. ;       14.4.95 : makedir comdat eingefügt
  7. ;     8.6.97 : Änderungen für V2.1
  8. ;
  9. ; $Id: Comic.install 1.3 1997/06/08 17:41:11 andreas Exp $
  10. ;
  11. (welcome "Comic-Verwaltung Installation")
  12.  
  13. (if
  14.     (=
  15.         (askchoice
  16.             (prompt "\n What language do you want to use ?\n\n"
  17.                     "Welche Sprache wünschen Sie ?\n")
  18.         (help "\n Select the language you want to use in the program.\n\n"
  19.               "Wählen Sie die Sprache, die sie im Programm verwenden "
  20.               "wollen.")
  21.         (choices "english" "deutsch")
  22.         (default 1)
  23.     )
  24.     1
  25.     )
  26.     (set @language "deutsch")
  27.     (set @language "english")
  28. )
  29. (debug @language)
  30. (set #englisch ( = @language "english") )
  31.  
  32. (if #englisch
  33.     (
  34.         ; Betriebsystemversion testen
  35.  
  36.         (set #OS (/ (getversion ) 65536 ) )
  37.         (if  (< #OS 36)
  38.              (
  39.                (set #Antwort
  40.                   (askbool
  41.                       (prompt "OS 2.0 or more is needed.\n"
  42.                               "Do you want to install the program inspite\n"
  43.                               "of that ?\n"
  44.                       )
  45.                       (choices "Yes" "No")
  46.                       (default 1)
  47.                       (help
  48.                          "The program needs OS 2.0 or higher, but the number\n"
  49.                          "of your operating system is too small, so you\n"
  50.                          "can't use the program.\n"
  51.                          "You should abort the installation.\n"
  52.                       )
  53.                   )
  54.                )
  55.                (if (= 0 #Antwort)
  56.                  (   ; abbrechen
  57.                    (abort    "Installation aborted because OS 2.0 needed.")
  58.                  )
  59.                )
  60.              )
  61.         )
  62.         (set #dir
  63.             (askdir
  64.                 (prompt "Select a directory for the program. A drawer\ncomic is created.")
  65.                 (help   "Select a directory / drawer in which the program\n"
  66.                         "and the documentation shall be installed.\n"
  67.             "If you have installed an older version choose\n"
  68.             "the same directory.\n"
  69.                 )
  70.                 (default "work:")
  71.             )
  72.         )
  73.         (set #dir (tackon #dir "comic"))
  74.         (set @default-dir #dir)
  75.         (set @default-dest #dir)
  76.         (set #altesDir @execute-dir)
  77.  
  78.     ;unwriteprotect old files
  79.     (protect (tackon #dir ".Product-Info") "+wd" )
  80.     (protect (tackon #dir "comic") "+wd")
  81.     (protect (tackon #dir "comic.info") "+wd")
  82.     (protect (tackon #dir "Comic.e.guide") "+wd")
  83.     (protect (tackon #dir "Comic.e.guide.info") "+wd")
  84.     (protect (tackon #dir "Instcomic") "+wd")
  85.     (protect (tackon #dir "Instcomic.info") "+wd")
  86.     (protect (tackon #dir "comp/Voreinstellung") "+wd")
  87.     (protect (tackon #dir "comp/Titel") "+wd")
  88.  
  89.     (if (AND (exists (tackon #dir "comp/Voreinstellung"))
  90.              (exists (tackon #dir "comp/Titel"))
  91.         )
  92.         ( (set #Antwort
  93.                 (askbool
  94.                     (prompt "The needed files 'Voreinstellung' and "
  95.                 "'Titel' exist already.\n"
  96.                 "Do you want to use "
  97.                 "them or install new files ?"
  98.                     )
  99.                     (choices "use old files" "install new files")
  100.                     (default 1)    ; alte Dateien
  101.                     (help "If you have used the 'Comic-Manager-Demo', these "
  102.               "files were created for the demo. If you want to "
  103.               "use your data from the demo you should select "
  104.               "'use old files', but then it's not possible "
  105.               "to change the number of conditions and the price "
  106.               "unit. This is possible, if you choose "
  107.               "'install new files', but your old files are removed.\n"
  108.               "If you have installed the non Demo Version 2.0 you "
  109.               "must use the old files !\n" 
  110.                     )
  111.                 )
  112.               )
  113.             )
  114.         (
  115.         (set #Antwort 0)
  116.             )
  117.         )
  118.     (if (= 1 #Antwort)    ; alte Dateien verwenden
  119.         (
  120.             ; comp und comdat nicht kopieren
  121.             ; InstComic braucht nicht gestartet zu werden
  122.         (set Muster "~(comp|comdat|InstComic#?)")
  123.         ; konvertiere alte Daten
  124.             (debug "Konvertierungsprogramm wird gestartet")
  125.                 ; Konvertierungsprogramm starten
  126.                 (copyfiles
  127.          (prompt "copy 'convertVor'")
  128.          (source "convertVor")
  129.          (dest   #dir)
  130.          (optional fail force)
  131.          )
  132.                 (set @execute-dir #dir)
  133.                 (run "convertVor")
  134.                 ; convertVor löschen
  135.         (delete (tackon #dir "convertVor"))
  136.         ; rename
  137.         (delete (tackon #dir "comp/Voreinstellung.old"))
  138.         (rename (tackon #dir "comp/Voreinstellung") 
  139.             (tackon #dir "comp/Voreinstellung.old") 
  140.             (prompt "rename Voreinstellung")
  141.             )
  142.         (rename (tackon #dir "comp/Voreinstellung.neu")
  143.             (tackon #dir "comp/Voreinstellung")
  144.             (prompt "rename Voreinstellung.neu"))
  145.         )
  146.         (
  147.         (set Muster "#?")
  148.         ; eventuell existierende Dateien umbenennen
  149.         (delete (tackon #dir "comp/Voreinstellung.old"))
  150.         (delete (tackon #dir "comp/Titel.old"))
  151.         (rename (tackon #dir "comp/Voreinstellung")
  152.             (tackon #dir "comp/Voreinstellung.old")
  153.             (prompt "rename Voreinstellung"))
  154.         (rename (tackon #dir "comp/Titel")
  155.             (tackon #dir "comp/Titel.old") 
  156.             (prompt "rename Titel"))
  157.             )
  158.         )
  159.         (copyfiles
  160.             (prompt "copy 'english'")
  161.             (source "english")
  162.         (pattern Muster)
  163.             (dest   #dir)
  164.             (infos)
  165.         (optional fail force)
  166.         )
  167.     (copyfiles
  168.      (prompt "copy .Product-Info")
  169.      (source ".Product-Info")
  170.      (dest #dir)
  171.      (optional fail force)
  172.     )
  173.     
  174.         ; falls #dir/comdat nicht existiert : anlegen
  175.         (if (NOT (exists (tackon #dir "comdat")))
  176.             (makedir (tackon #dir "comdat")
  177.                      (prompt "making directory comdat")
  178.             )
  179.         )
  180.  
  181.         (debug #Antwort)
  182.     (if (= 0 #Antwort)    ; neue Dateien anlegen
  183.         (
  184.         (message
  185.          "Now the installation program Instcomic is started. It lets "
  186.          "you choose two important parameters :\n\n"
  187.          " a) the number of conditions\n\n"
  188.          " b) the price unit          \n\n"
  189.          "Please read the help info if you install the Comic-Manager "
  190.          "the first time"
  191.          (help
  192.           "parameters :\n"
  193.           " a) the number of conditions\n\n"
  194.           "When you use Comic-Manager you have to assign a condition "
  195.           "to each of your numbers. The condition is a digit from "
  196.           "0 to 9 which determines the quality of the comic book. "
  197.           "0 is the best condition. You have to choose the number of "
  198.           "conditions that you want. You can't change this value "
  199.           "later, so you should be very careful, what you choose. "
  200.           "I suggest that you first write a list for yourself "
  201.           "with criteria a number must fullfill to be in a certain "
  202.           "condition. With this list you can decide how many "
  203.           "conditions you want. \n"
  204.           "The maximal possible number of conditions is 10, the "
  205.           "minimal is 1. In the later case no conditions will be "
  206.           "used, i.e. no information about the condition of a number "
  207.           "is stored.\n\n"
  208.           " b) the price unit\n\n"
  209.           "You can choose a unit from 0.01 to 100.0. When you use "
  210.           "prices in the Comic-Manager, they will be rounded to this "
  211.           "unit. If you choose for example the unit 0.50 only prices "
  212.           "like 0.00, 0.50, 1.00, 1.50 ... are possible, with the "
  213.           "unit 0.10   0.00, 0.10, 0.20, 0.30 ... would be "
  214.           "possible.\n"
  215.           "This unit also determines the maximal price. I suggest to "
  216.           "choose a unit of 0.10 or 0.50. The higher values should "
  217.           "be used in countries, where the unit of the currency has "
  218.           "a small value.\n\n"
  219.           "Warning ! Be very careful what you choose because you "
  220.           "can't change this values."
  221.           )
  222.          (all)
  223.         )
  224.             (debug "Instcomic wird in " #dir " gestartet")
  225.                 ; Installationsprogramm starten
  226.                 (set @execute-dir #dir)
  227.                 (run "Instcomic")
  228.                 ; InstComic löschen
  229.                 (delete (tackon #dir "Instcomic")
  230.                     (prompt "delete installation program 'Instcomic'")
  231.                     (help   "'Instcomic' is a program that creates some "
  232.                             "files which are needed in Comic-Manager.\n\n"
  233.                             "You don't need this program later, so it can "
  234.                             "be deleted."
  235.                     )
  236.                     (confirm)
  237.                 )
  238.                 (if (NOT (exists (tackon #dir "Instcomic")))
  239.                     (    ; .info auch löschen
  240.                         (delete (tackon #dir "Instcomic.info"))
  241.                     )
  242.                 )
  243.             )
  244.         )
  245.         (if (exists (tackon #dir "comicDemo"))
  246.             (    ; Demo Version loeschen
  247.                 (delete (tackon #dir "comicDemo"))
  248.             )
  249.         )
  250.         (if (exists (tackon #dir "comicDemo.info"))
  251.             (delete (tackon #dir "comicDemo.info"))
  252.         )
  253.  
  254.         ; zurückspringen
  255.         (set @execute-dir #altesDir)
  256.  
  257.     )
  258.     (    ; deutsch
  259.         ; Betriebsystemversion testen
  260.  
  261.         (set #OS (/ (getversion ) 65536 ) )
  262.         (if  (< #OS 36)
  263.              (
  264.                (set #Antwort
  265.                   (askbool
  266.                       (prompt "Es wird mindestens OS 2.0 benötigt\n"
  267.                               "Wollen Sie das Programm trotzdem installieren ?"
  268.                       )
  269.                       (choices "Ja" "Nein")
  270.                       (default 1)
  271.                       (help
  272.                           "Das Programm benötigt OS 2.0 oder höher.\n"
  273.                           "Ihre Betriebssystemversion ist zu gering, so daß\n"
  274.                           "Sie das Programm nicht verwenden können.\n"
  275.                           "Sie sollten es also nicht installieren.\n"
  276.                       )
  277.                   )
  278.                )
  279.                (if (= 0 #Antwort)
  280.                    (   ; abbrechen
  281.                        (abort   "Installation wurde abgebrochen wegen\n"
  282.                                 "zu niedriger Betriegssystemversion.\n"
  283.                        )
  284.                    )
  285.                )
  286.              )
  287.         )
  288.         (set #dir
  289.             (askdir
  290.                 (prompt "Verzeichnis für das Programm wählen.\n Ein Verzeichnis comic wird erstellt")
  291.                 (help   "\n Wählen Sie bitte ein Verzeichnis, in dem "
  292.                         "das Programm und die Dokumentation "
  293.                         "installiert werden sollen. \n"
  294.             "Wenn Sie bereits eine ältere Version installiert "
  295.             "haben, so wählen Sie bitte deren Verzeichnis.\n"
  296.                 )
  297.                 (default "work:")
  298.             )
  299.         )
  300.         (set #dir (tackon #dir "comic"))
  301.         (set @default-dir #dir)
  302.         (set @default-dest #dir)
  303.         (set #altesDir @execute-dir)
  304.     ;unwriteprotect old files
  305.     (protect (tackon #dir ".Product-Info") "+wd")
  306.     (protect (tackon #dir "comic") "+wd")
  307.     (protect (tackon #dir "comic.info") "+wd")
  308.     (protect (tackon #dir "Comic.guide") "+wd")
  309.     (protect (tackon #dir "Comic.guide.info") "+wd")
  310.     (protect (tackon #dir "Instcomic") "+wd")
  311.     (protect (tackon #dir "Instcomic.info") "+wd")
  312.     (protect (tackon #dir "comp/Voreinstellung") "+wd")
  313.     (protect (tackon #dir "comp/Titel") "+wd")
  314.  
  315.     (if (AND (exists (tackon #dir "comp/Voreinstellung"))
  316.              (exists (tackon #dir "comp/Titel"))
  317.         )
  318.         ( (set #Antwort
  319.                 (askbool
  320.                     (prompt "Die benötigten Dateien 'Voreinstellung' und "
  321.                 "'Titel' existieren bereits. Wollen Sie diese "
  322.                 "verwenden oder neue installieren ?"
  323.                     )
  324.                     (choices "verwende alte Dateien"
  325.                      "installiere neue Dateien"
  326.             )
  327.                     (default 1)    ; alte Dateien
  328.                     (help "Wenn Sie die Demo Version der 'Comic-Verwaltung' "
  329.               "verwendet haben, so wurden die existierenden Dateien "
  330.               "von diesem Programm verwendet. Wenn Sie Ihre "
  331.               "bisherigen Daten weiterverwenden wollen, so sollten "
  332.               "Sie 'verwende alte Dateien' wählen. Wenn Sie "
  333.               "stattdessen 'installiere neue Dateien' wählen, "
  334.               "so haben Sie die Möglichkeit die Anzahl der Zustände "
  335.               "und die Preiseinheit zu ändern, allerdings gehen "
  336.               "dabei Ihre bisherigen Daten verloren."
  337.               "( Sie können sie natürlich vorher ausdrucken, und "
  338.               "nachher wieder eingeben. )\n"
  339.               "Wenn Sie die Vollversion 2.0 installiert haben, so "
  340.               "verwenden Sie die alten Dateien weiter !\n" 
  341.                     )
  342.                 )
  343.               )
  344.             )
  345.         (
  346.         (set #Antwort 0)
  347.             )
  348.         )
  349.     (if (= 1 #Antwort)    ; alte Dateien verwenden
  350.         (
  351.             ; comp und comdat nicht kopieren
  352.             ; InstComic braucht nicht gestartet zu werden
  353.         (set Muster "~(comp|comdat|InstComic#?)")
  354.         ; konvertiere alte Daten
  355.             (debug "Konvertierungsprogramm wird gestartet")
  356.                 ; Konvertierungsprogramm starten
  357.                 (copyfiles
  358.          (prompt "copy 'convertVor'")
  359.          (source "convertVor")
  360.          (dest   #dir)
  361.          (optional fail force)
  362.          )
  363.                 (set @execute-dir #dir)
  364.                 (run "convertVor")
  365.                 ; convertVor löschen
  366.         (delete (tackon #dir "convertVor"))
  367.         ; rename
  368.         (delete (tackon #dir "comp/Voreinstellung.old"))
  369.         (rename (tackon #dir "comp/Voreinstellung") 
  370.             (tackon #dir "comp/Voreinstellung.old") 
  371.             (prompt "rename Voreinstellung")
  372.             )
  373.         (rename (tackon #dir "comp/Voreinstellung.neu")
  374.             (tackon #dir "comp/Voreinstellung")
  375.             (prompt "rename Voreinstellung.neu"))
  376.             )
  377.         (
  378.         (set Muster "#?")
  379.         ; eventuell existierende Dateien umbenennen
  380.         (delete (tackon #dir "comp/Voreinstellung.old"))
  381.         (delete (tackon #dir "comp/Titel.old"))
  382.         (rename (tackon #dir "comp/Voreinstellung")
  383.             (tackon #dir "comp/Voreinstellung.old")
  384.             (prompt "rename Voreinstellung"))
  385.         (rename (tackon #dir "comp/Titel")
  386.             (tackon #dir "comp/Titel.old") 
  387.             (prompt "rename Titel"))
  388.             )
  389.         )
  390.  
  391.         (copyfiles
  392.             (prompt "copy 'deutsch'")
  393.             (source "deutsch")
  394.         (pattern Muster)
  395.             (dest   #dir)
  396.             (infos)
  397.         (optional fail force)
  398.         )
  399.     (copyfiles
  400.      (prompt "copy .Product-Info")
  401.      (source ".Product-Info")
  402.      (dest #dir)
  403.      (optional fail force)
  404.     )
  405.         ; falls #dir/comdat nicht existiert : anlegen
  406.         (if (NOT (exists (tackon #dir "comdat")))
  407.             (makedir (tackon #dir "comdat")
  408.                      (prompt "Lege Verzeichnis comdat an")
  409.             )
  410.         )
  411.  
  412.         (set #altesDir @execute-dir)
  413.         (debug #Antwort)
  414.     (if (= 0 #Antwort)    ; neue Dateien anlegen
  415.         (
  416.         (message "Es wird jetzt das Installationsprogramm InstComic "
  417.          "gestartet. Während der Installation haben Sie die "
  418.          "Möglichkeit zwei wichtige Parameter einzustellen.\n\n"
  419.          "Die Parameter sind : \n"
  420.            " a) die Anzahl der Zustände\n"
  421.             " b) die Preiseinheit       \n"
  422.          "Wenn Sie die Comic-Verwaltung zum ersten mal installieren "
  423.          "lesen Sie bitte den Hilfe Text."
  424.          (help
  425.           "a) die Anzahl der Zustände\n\n"
  426.           "Bei der Comic-Verwaltung müssen Sie jedem Heft, das Sie "
  427.           "eingeben, einen Zustand zuweisen, d.h. Sie müssen die "
  428.           "Qualität des Hefts beurteilen. Der Bereich von 'sehr "
  429.           "guter Zustand' bis 'nicht mehr sammelwürdig' wird dabei "
  430.           "durch die Zahlen 0, 1, 2, ... dargestellt. \n"
  431.           "Bei der Installation müssen Sie angeben, wieviele "
  432.           "Zustände Sie unterscheiden wollen. Da dieser Wert später "
  433.           "nicht mehr geändert werden kann empfehle ich Ihnen, daß "
  434.           "Sie sich zuerst die Kriterien überlegen, nach denen Sie "
  435.           "Ihre Hefte beurteilen wollen, und diese aufschreiben. "
  436.           "(Falls Sie einen Comic- oder Roman-Preiskatalog besitzen, "
  437.           "so können Sie darin u.U. entsprechende Kriterien finden.) "
  438.           "Mit dieser Liste können Sie dann entscheiden, wieviele "
  439.           "Zustände sie wünschen. Sie können maximal 10 Zustände "
  440.           "wählen und minimal einen. In diesem Fall "
  441.           "wird ohne Zustände gearbeitet, d.h. es wird keine "
  442.           "Information über den Zustand eines Hefts gespeichert.\n\n"
  443.           " b) die Preiseinheit\n\n"
  444.           "Hier können Sie als Einheit einen Wert von 0.01 bis 100.0 "
  445.           "eingeben. Wenn Sie dann in der Comic-Verwaltung Preise "
  446.           "eingeben, so wird immer auf diese Einheit gerundet, d.h. "
  447.           "wenn Sie die Einheit 0.50 wählen, so werden nur die "
  448.           "Preise 0.00, 0.50, 1.00, 1.50 ... zugelassen, mit der "
  449.           "Einheit 0.10 wären es 0.00, 0.10, 0.20, ... . Allerdings "
  450.           "wird durch diese Einheit auch der maximal mögliche Preis "
  451.           "festgelegt.\n"
  452.           "Ich empfehle als Einheit einen Wert von 0.10 oder 0.50.\n"
  453.           "Die höheren Werte sind für Währungen gedacht, bei denen "
  454.           "eine Einheit weniger wert ist.\n\n"
  455.           "Achtung ! Überlegen Sie sich Ihre Eingaben sehr genau, \n"
  456.           "da sie später nicht mehr geändert werden können.\n"
  457.           )
  458.          (all))
  459.             (debug "Instcomic wird in " #dir " gestartet")
  460.                 ; Installationsprogramm starten
  461.                 (set @execute-dir #dir)
  462.                 (run "Instcomic")
  463.                 ; InstComic löschen
  464.  
  465.                 (delete (tackon #dir "Instcomic")
  466.                 (prompt "lösche Installationsprogramm 'Instcomic'")
  467.                 (help   "'Instcomic' ist ein Programm, daß einige Dateien "
  468.                         "anlegt, die die Comic-Verwaltung benötigt.\n\n"
  469.                         "Dieses Programm wird nach der Installation nicht "
  470.                         "mehr benötigt, so daß es gelöscht werden kann."
  471.                 )
  472.                     (confirm)
  473.                 )
  474.                 (if (NOT (exists (tackon #dir "Instcomic")))
  475.                     (    ; .info auch löschen
  476.                         (delete (tackon #dir "Instcomic.info"))
  477.                     )
  478.                 )
  479.             )
  480.         )
  481.         (if (exists (tackon #dir "comicDemo"))
  482.             (    ; Demo Version loeschen
  483.                 (delete (tackon #dir "comicDemo"))
  484.             )
  485.         )
  486.         (if (exists (tackon #dir "comicDemo.info"))
  487.             (delete (tackon #dir "comicDemo.info"))
  488.         )
  489.  
  490.         ; zurückspringen
  491.         (set @execute-dir #altesDir)
  492.     )
  493. )
  494.  
  495. (if (= @user-level 0)
  496.     (set #Meldung
  497.         ("Die Comic-Verwaltung wurde auf work: installiert."
  498.          "Comic-Verwaltung (german) is installed to "
  499.          "work: . If you want the english version don't use 'novice' "
  500.          "for installation."
  501.         )
  502.     )
  503. )
  504.  
  505. (exit #Meldung)
  506.  
  507.