home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Sound / Misc / ALGMUS20.LZX / AlgoMusic / Install < prev    next >
Encoding:
Text File  |  1997-04-19  |  11.2 KB  |  306 lines

  1. ; AlgoMusic Install Utility
  2. ; (C) 1997 by Thomas Schürger
  3. ; REMEMBER THAT ALGOMUSIC IS >GIFTWARE<!!
  4.  
  5. ; $VER: AlgoMusicInstall 2.0 (18.4.97)
  6. ;
  7. ; Script will auto-detect 68020/030 and 68040/060
  8.  
  9. ; Do not allow Novice User (when running from Shell)
  10.  
  11. (if (= @user-level 0)
  12.     (set @user-level 1)
  13. )
  14.  
  15. ; Get AlgoMusic version of the version present in install directory
  16.  
  17. (set #algoverlong (getversion "AlgoMusic"))
  18.  
  19. (if #algoverlong
  20.   (
  21.     (set #algoversion (/ #algoverlong 65536 ))
  22.     (set #algorevision (- #algoverlong (* #algoversion 65536 )))
  23.   )
  24.  
  25.   (
  26.     (set #algoversion "x")
  27.     (set #algorevision "x")
  28.   )
  29. )
  30.  
  31. (set #versionstring (cat #algoversion "." #algorevision))
  32.  
  33. ; Set texts to language (locale)
  34. ; Set to German if available, English otherwise
  35.  
  36. (if (not (patmatch "(68000|68010)" (database "cpu")))
  37.    (if (not (patmatch "(68020|68030)" (database "cpu")))
  38.      (
  39.      set #cputype "68040/060"
  40.      )
  41.  
  42.      (
  43.      set #cputype "68020/030"
  44.      )
  45.    )
  46.  
  47.    (
  48.    set #cputype "68000"
  49.    )
  50. )
  51.  
  52. (if (= @language "deutsch")
  53.   (
  54.    (set #installerversion  "Sie haben eine veraltete Version des Installers installiert.\n\nDie neue Version unterstützt u.a. neue Features. Sie ist z.B. im Aminet erhältlich.\n\nBitte installieren Sie diese demnächst!")
  55.    (set #welcometext       (cat "Willkommen zum Installationsprogramm für AlgoMusic V" #versionstring ", dem ultimativen Programm für algorithmische Musik auf Ihrem Amiga.\n\nEinfache und intuitive Installation ist garantiert."))
  56.    (set #wrongosversion    "Sie benötigen mindestens Amiga OS 2.0 (V36) für AlgoMusic.\n\nBitte unterstützen Sie den Amiga und rüsten Sie auf das jeweils neueste Betriebssystem auf.\n\nEs ist dringendst anzuraten und lohnt sich!")
  57.    (set #algomusicexists   "Sie haben im angegebenen Pfad AlgoMusic bereits installiert. Soll dieses Verzeichnis in \"AlgoMusic.old\" umbenannt werden und AlgoMusic ins angegebene Verzeichnis installiert werden oder möchten Sie die vorhandene Version überschreiben (dabei gehen auch alle Samples usw. verloren)?")
  58.    (set #existsrename      "Umbenennen")
  59.    (set #existsoverwrite   "Überschreiben")
  60.    (set #destinationprompt (cat "Wählen Sie das Verzeichnis, in das AlgoMusic " #cputype " installiert werden soll. Ein neues Verzeichnis namens \"AlgoMusic\" wird dort erstellt."))
  61.    (set #copyingtext       "Kopiere benötigte Dateien in das Verzeichnis\n\n\"%s\"")
  62.    (set #prefsrenamed      "Sie hatten bereits Voreinstellungen für AlgoMusic in Ihrem ENVARC: Verzeichnis. \"AlgoMusic.prefs\" wurde dort in \"AlgoMusic.prefs.old\" umbenannt.\n\nVergleichen Sie am besten nach durchgeführter Installation beide Files und sehen Sie nach, was Sie in die neuen Prefs übernehmen möchten.")
  63.    (set #seehistoryprompt  "Möchten Sie sich das History-File von AlgoMusic ansehen?")
  64.    (set #seehistoryhelp    "AlgoMusic hat bei jeder neuen Version eine Reihe von neuen Features und Bugfixes. Lesen Sie sich am besten durch, was bei dieser Version verbessert und ergänzt wurde.")
  65.    (set #addpathprompt     "Das AlgoMusic-Verzeichnis sollte in den Systempfad mit aufgenommen werden. Soll dies automatisch in der User-Startup für Sie erledigt werden oder wollen Sie es selber durchführen?")
  66.    (set #userstartup       "Die folgenden Zeilen werden an Ihre User-Startup angehängt:\n\n")
  67.    (set #userstartupauto   "Automatisch")
  68.    (set #userstartupmanu   "Selber")
  69.    (set #giftware          "Bitte denken Sie daran, daß AlgoMusic GIFTWARE ist.\n\nSie müssen bei Gefallen dem Autor ein kleines Geschenk schicken. Lesen Sie dazu auch im Guide nach!\n\n\n\nViel Spaß,\n\nThomas Schürger")
  70.    (set #delold            "AlgoMusic ist installiert. Wenn Sie von der neuen Version überzeugt sind, können Sie nach kurzer Zeit das Verzeichnis \"%s\" löschen.")
  71.   )
  72.  
  73.   ( 
  74.    (set #installerversion  "You've got an old version of the Installer installed.\n\nThe new version has lots of new features and improvements. It's available on Aminet, for example.\n\nPlease install it as soon as possible!")
  75.    (set #welcometext       (cat "Welcome to the installation utility for AlgoMusic V" #versionstring ", the ultimate program for algorithmic music on your Amiga.\n\nEasy and intuitive installation is guaranteed."))
  76.    (set #wrongosversion    "AlgoMusic requires at least Amiga OS 2.0 (V36).\n\nPlease support your beloved computer by installing the newest Amiga operating system available.\n\nIt's worth it for sure!")
  77.    (set #algomusicexists   "You've already got AlgoMusic installed in the path specified. Would you like to rename the existing directory to \"AlgoMusic.old\" and install the new version or would you like to overwrite the old version (all samples etc. will be lost)?")
  78.    (set #existsrename      "Rename")
  79.    (set #existsoverwrite   "Overwrite")
  80.    (set #destinationprompt "Select a destination for AlgoMusic. A new drawer called \"AlgoMusic\" will be created there.")
  81.    (set #copyingtext       "Copying required files to:\n\n\"%s\"")
  82.    (set #prefsrenamed      "You already had preferences for AlgoMusic in your ENVARC: directory. \"AlgoMusic.prefs\" has been renamed to \"AlgoMusic.prefs.old\".\n\nPlease compare both files and decide which of the old preferences you would like to transfer to the new prefs-file after the installation has been completed.")
  83.    (set #seehistoryprompt  "Would you like to see the history of AlgoMusic?")
  84.    (set #seehistoryhelp    "AlgoMusic has a lot of new features and bugfixes with each version. You may want to see what has been changed and improved in this version.")
  85.    (set #addpathprompt     "You should include the AlgoMusic-directory in your system path. Would you like this to be done automatically or would you like to do it by hand?")
  86.    (set #userstartup       "The following lines will be appended to your user-startup:\n\n")
  87.    (set #userstartupauto   "Automatically")
  88.    (set #userstartupmanu   "By hand")
  89.    (set #giftware          "Remember that AlgoMusic is GIFTWARE.\n\nYou are asked to send me a gift if you like this program. Read the guide for further information!\n\n\n\nHave fun!\n\nThomas Schürger")
  90.    (set #delold            "AlgoMusic is now installed. If you are convinced by the new version, you can delete the directory \"%s\" after a while.")
  91.   )
  92. )
  93.  
  94. ; Welcome the user
  95.  
  96. (welcome #welcometext)
  97.  
  98. ; Get Amiga OS version
  99.  
  100. (set #osversion (/ (getversion "exec.library" (resident)) 65536 ))
  101.  
  102. (if (< #osversion 36 )
  103.   (exit #wrongosversion (quiet))
  104. )
  105.  
  106. ; Remind user if having installed an old Installer
  107.  
  108. (if (= @installer-version "")
  109.   (message #installerversion)
  110. )
  111.  
  112. (complete 0)
  113.  
  114. ; Select appropriate destination directory
  115.  
  116. (run "which AlgoMusic >env:AlgoMusic.temp")
  117. (set #contents (getenv "AlgoMusic.temp"))
  118.  
  119. (set #destdir (askdir
  120.                  (prompt #destinationprompt)
  121.                  (default 
  122.                     (if (strlen #contents)
  123.                        (pathonly (pathonly #contents))
  124.                        (expandpath (if (exists "AlgoMusic:" (noreq))
  125.                                            "AlgoMusic:/"
  126.                                       (if (exists "Music:" (noreq))
  127.                                            "Music:"
  128.                                       (if (exists "Sound:" (noreq))
  129.                                            "Sound:"
  130.                                       (if (exists "Work:Work/Music" (noreq))
  131.                                            "Work:Work/Music"
  132.                                       (if (exists "Work:Work" (noreq))
  133.                                            "Work:Work"
  134.                                       (if (exists "Work:" (noreq))
  135.                                            "Work:" "SYS:"
  136.                                       )))))))
  137.                     )
  138.                  (newpath)
  139.                  (help @askdir-help)
  140.             )
  141.          )
  142. )
  143.  
  144. (set #fulldestdir (tackon #destdir "AlgoMusic"))
  145. (set #fullolddir  (tackon #destdir "AlgoMusic.old"))
  146. (set @default-dest #fulldestdir)
  147.  
  148. (complete 10)
  149.  
  150. (set renamed 0)
  151.  
  152. ; Check if AlgoMusic already exists in selected directory
  153.  
  154. (if (exists #fulldestdir)
  155.    (
  156.       (if (askbool
  157.              (prompt #algomusicexists)
  158.              (default 1)
  159.              (choices #existsrename #existsoverwrite)
  160.              (help @askbool-help)
  161.           )
  162.  
  163.           (
  164.              (run (cat "Delete " #fullolddir " ALL QUIET"))
  165.              (rename #fulldestdir #fullolddir)
  166.              (set #renamed 1)
  167.           )
  168.           (
  169.              (run (cat "Delete " #fulldestdir " ALL QUIET"))
  170.              (run (cat "Delete " #fullolddir " ALL QUIET"))
  171.           )
  172.        )
  173.     )
  174. )
  175.  
  176. (makedir #fulldestdir (infos))
  177.  
  178. (complete 20)
  179.  
  180. (working (#copyingtext #fulldestdir))
  181.  
  182. (copyfiles
  183.    (source "")
  184.    (dest #fulldestdir)   
  185.    (all)
  186.    (optional (nogauge))
  187. )
  188.  
  189. (complete 80)
  190.  
  191. ; Check if AlgoMusic preferences already exist
  192.  
  193. (if (exists "ENVARC:AlgoMusic.prefs"))
  194.    (
  195.    (delete "ENVARC:AlgoMusic.prefs.old")
  196.    (rename "ENVARC:AlgoMusic.prefs" "ENVARC:AlgoMusic.prefs.old")
  197.    (message #prefsrenamed)
  198.    )
  199.  
  200. (copyfiles
  201.    (source "AlgoMusic.prefs")
  202.    (dest "ENVARC:")
  203.    (nogauge)
  204. )
  205.  
  206. (if (exists "ENV:AlgoMusic.prefs"))
  207.    (
  208.    (delete "ENV:AlgoMusic.prefs.old")
  209.    (rename "ENV:AlgoMusic.prefs" "ENV:AlgoMusic.prefs.old")
  210.    )
  211.  
  212. (copyfiles
  213.    (source "AlgoMusic.prefs")
  214.    (dest "ENV:")
  215.    (nogauge)
  216. )
  217.  
  218. (delete (tackon #fulldestdir "Install"))
  219. (delete (tackon #fulldestdir "Install.info"))
  220. (delete (tackon #fulldestdir "AlgoMusic.prefs"))
  221.  
  222. (if (= #cputype "68020/030")
  223.    (
  224.    (delete (tackon #fulldestdir "AlgoMusic"))
  225.    (delete (tackon #fulldestdir "AlgoMusic.040"))
  226.    (rename (tackon #fulldestdir "AlgoMusic.020") (tackon #fulldestdir "AlgoMusic"))
  227.    )
  228.  
  229.   (if (= #cputype "68040/060")
  230.      (
  231.      (delete (tackon #fulldestdir "AlgoMusic"))
  232.      (delete (tackon #fulldestdir "AlgoMusic.020"))
  233.      (rename (tackon #fulldestdir "AlgoMusic.040") (tackon #fulldestdir "AlgoMusic"))
  234.      )
  235.  
  236.      (
  237.      (delete (tackon #fulldestdir "AlgoMusic.020"))
  238.      (delete (tackon #fulldestdir "AlgoMusic.040"))
  239.      )
  240.   )
  241. )
  242.  
  243. (set #uschanges (cat "Path \"" #Fulldestdir "\" ADD"))
  244.  
  245. (complete 85)
  246.  
  247. ; Ask if user wants to automatically set Path to AlgoMusic or not
  248.  
  249. (if (askbool
  250.        (prompt #addpathprompt)
  251.        (default 1)
  252.        (help @askbool-help)
  253.        (choices #userstartupauto #userstartupmanu)
  254.     )
  255.  
  256.     (
  257.        (startup "AlgoMusic"
  258.           (command #uschanges)
  259.           (prompt (cat #userstartup ";BEGIN AlgoMusic\n" #uschanges "\n;END AlgoMusic"))
  260.           (help @startup-help)
  261.        )
  262.     )
  263. )       
  264.  
  265. (complete 90)
  266.  
  267. (if #renamed
  268.     (message (#delold #fullolddir))
  269. )
  270.  
  271. (complete 95)
  272.  
  273. ; Ask if user wants to see the history guide of AlgoMusic
  274.  
  275. (if (OR (exists "C:AmigaGuide" (noreq)) (exists "SYS:System/Utilities/AmigaGuide" (noreq)))
  276.   (if (askbool
  277.          (default 1)
  278.          (prompt #seehistoryprompt)
  279.          (help #seehistoryhelp)
  280.       )
  281.       (Run "amigaguide AlgoMusic.guide DOC History")
  282.   )
  283. (if (OR (exists "C:MultiView" (noreq)) (exists "SYS:System/Utilities/Multiview" (noreq)))
  284.   (if (askbool
  285.          (default 1)
  286.          (prompt #seehistoryprompt)
  287.          (help #seehistoryhelp)
  288.       )
  289.       (Run "Multiview AlgoMusic.guide")
  290.   )
  291. (if (OR (exists "C:More" (noreq)) (exists "SYS:System/Utilities/More" (noreq)))
  292.   (if (askbool
  293.          (default 1)
  294.          (prompt #seehistoryprompt)
  295.          (help #seehistoryhelp)
  296.       )
  297.       (Run "More AlgoMusic.guide")
  298.   )
  299. )))
  300.  
  301. (complete 100)
  302.  
  303. ; Present the cute Giftware message
  304.  
  305. (message #giftware)
  306.