home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 6 / Sonderheft_6-96.iso / pd / disktools / afind / install / afind.install next >
Text File  |  1996-11-03  |  15KB  |  456 lines

  1. ; $VER: AFind.install 1.44 (12.07.96)
  2. ; Install script for AFind (Workbench 2.0 or higher)
  3. ;
  4. (COMPLETE 0)
  5. ;(USER 2)
  6. (SET #ApplicationName "AFind")
  7. (SET #ApplicationDir "sys:tools/")
  8. ;(SET #ApplicationDir "t:")
  9. (SET #ArchiveDir "/")
  10. (SET #Language -1)
  11. (SET #Documents -1)
  12. (SET #ApplicationKeyfile (CAT #ApplicationName ".key"))
  13.  
  14. ;=============================================================================
  15. ; German strings
  16.  
  17. (IF (= @language "deutsch")
  18. (
  19. (SET default_lang 2)
  20.  
  21. (SET #bad-kick "Sie benötigen Workbench 2.0 oder größer")
  22. (SET #bad-installer
  23. (CAT "Achtung! Es ist eine alte Version des Programmes 'Installer' "
  24.      "auf Ihrem Amiga!\n\nDie Installation benötigt mindestens Installer 42.9.\n\n"
  25.      "Bitte überprüfen Sie Ihre Konfiguration!\n"
  26.      "Wenn Sie fortfahren, wird eine Vollinstallation vorgenommen, das heißt\n"
  27.      "es werden alle Kataloge,Anleitungen und die OS2.0+ Version installiert.\n"
  28.      "%s ist auch dann voll einsatzfähig!"
  29. ))
  30.  
  31. (SET #App-InstallMsg
  32. (CAT "\n\%s Installationsskript.\n"
  33.         "Diese Skript installiert %s auf Ihrem Amiga.\n\n"
  34.         "Lesen Sie das Anleitungs-File für weitere Informationen\n"
  35.         " über den Vertrieb von %s.\n\n"
  36.         "%s © 1995-96 Guido Mersmann\n"
  37.         "All Rechte reserviert."
  38. ))
  39.  
  40. (SET #App-Where
  41. (CAT "Wo möchten Sie %s installieren ?\n"
  42.         "(Ein Verzeichnis wird angelegt)"
  43. ))
  44.  
  45. (SET #App-Update
  46. (CAT "\nEin %s-Verzeichnis existiert im ausgewählen"
  47.         " Verzeichnis. Wenn Sie fortfahren,"
  48.         " bestätigen Sie, daß Sie die alte %s-Installation"
  49.         " mit der neuesten Version updaten wollen.\n"
  50.         "Verschiedene %s-Dateien (z.B Prefs) werden falls nötig überschrieben!"
  51. ))
  52.  
  53. (SET #App-Main "Welche Version von %s möchten Sie installieren?")
  54. (SET #App-Main-help
  55. (CAT "Die OS2.0+ Version läuft unter allen Systemen ab OS2.0."
  56.      " Die OS2.1+ Version hat den Nutzen, daß sie weniger Resourcen"
  57.      " benutzt, wenn sich %s im Hintergrund befindet. Dazu MUß"
  58.      " die Locale.library eingebunden sein. Für die OS3.0+ gilt das selbe"
  59.      " wie für die OS2.1 Verison. Es werden OS3.0+ Routinen benutzt, die"
  60.      " weiteren Speicher sparen."
  61. ))
  62.  
  63. (SET #App-Language "Welche Sprachen sollen installiert werden ?")
  64.  
  65. (SET #App-Language-help
  66. (CAT "\nDer Amiga kann in vielen verschiedenen Sprachen"
  67.          " arbeiten. Um Plattenkapazität zu sparen können Sie"
  68.          " nur die Sprachen anwählen, die sie benötigen"
  69.          " Haken Sie also einfach die Sprachen ab, die Sie"
  70.          " Ihrem System zugänglich machen wollen."
  71.           @askoptions-help
  72. ))
  73.  
  74. (SET #App-Docs "Welche Anleitungs- und Informationsdateien wollen Sie installieren ?")
  75.  
  76. (SET #startup-prompt    "Es müssen zu S:User-Startup einige Eintragungen für %s hinzugefügt werden:\n\n%s")
  77.  
  78.  
  79. (SET #App-Exit "\n%s installiert !!")
  80.  
  81.  
  82. ))
  83.  
  84. ;=============================================================================
  85. ; English strings
  86.  
  87. (IF (<> @language "deutsch")
  88. (
  89. (SET default_lang 4)
  90.  
  91. (SET #bad-kick "You must have at least Workbench 2.0+")
  92. (SET #bad-installer
  93. (CAT "You have an old version of the program 'Installer' "
  94.      "on your Amiga!\n\nThe installation procedure needs at least Installer 42.9.\n\n"
  95.      "Please check your configuration!\n\n"
  96.      "If you proceed the whole archive will be installed.\n"
  97.      "%s will work without any restrictions!"
  98. ))
  99.  
  100. (SET #App-InstallMsg
  101. (CAT "\n\%s installation script.\n"
  102.         "This script installs %s on your Amiga.\n\n"
  103.         "Read the DOK-file for more information\n"
  104.         " on the distribution of %s.\n\n"
  105.         "%s © 1997-96 Guido Mersmann\n"
  106.         "All rights reserved."
  107. ))
  108.  
  109. (SET #App-Where
  110. (CAT "Where would you like to install %s ?\n"
  111.         "(A drawer will be created)"
  112. ))
  113.  
  114. (SET #App-Update
  115. (CAT "\nA %s drawer does already exist in the selected "
  116.         " directory. By selecting \"Proceed\", you"
  117.         " indicate that you want to update the %s"
  118.         " installation with the most recent version.\n"
  119.         "Several %s specific files will be overwritten!"
  120. ))
  121.  
  122. (SET #App-Main "Which %s version should be installed ?")
  123. (SET #App-Main-help
  124. (CAT "The OS2.0+ version should only be used on Systems with OS2."
  125.      " The OS2.1+ and the OS3.0+ version need less Memory. Locale is required!"
  126.      " Special OS3.0+ functions are used to save more memory."
  127. ))
  128.  
  129. (SET #App-Language "Which languages should be installed ?")
  130. (SET #App-Language-help
  131. (CAT "\nThe Amiga can be operated in many different"
  132.           " languages."
  133.           "To reduce the amount of space consumed by the"
  134.           " language files, you can select to have only the"
  135.           " files of specific languages copied.\n\n"
  136.           "Simply check the boxes of the languages you wish"
  137.           " to have available on your system.\n\n"
  138.           @askoptions-help
  139. ))
  140.  
  141. (SET #App-Docs "Which Amiga-guide files should be installed ?")
  142.  
  143. (SET #startup-prompt    "Some lines need to be added to S:User-Startup for %s\n\n%s")
  144.  
  145. (SET #App-Exit "\n%s installed !!")
  146.  
  147.  
  148. ))
  149. ;----------------------------------------------------------------------------
  150. ;----------------------------------------------------------------------------
  151. ;    P_Requirements
  152. ;----------------------------------------------------------------------------
  153. ;----------------------------------------------------------------------------
  154. (PROCEDURE P_Requirements
  155. ; Workbench 37 or better required
  156. (IF (< (/ (getversion) 65536) 37)
  157. (
  158.   (abort #bad-kick)
  159. )
  160. )
  161. ; Installer 42.9 or better required
  162. (if (< @installer-version 2752521)
  163.   (
  164. (user 2)
  165.     (message (#bad-installer #ApplicationName))
  166.     (welcome)
  167.  
  168. ;---- Simple Copy all ask
  169. (SET #ApplicationDir
  170.         (TACKON
  171.                 (ASKDIR
  172.                         (PROMPT (#App-Where #ApplicationName))
  173.                         (HELP @askdir-help)
  174.                         (default #ApplicationDir)
  175.                 )
  176.                 #ApplicationName
  177.         )
  178. )
  179. (MAKEDIR #ApplicationDir (INFOS))
  180.                    (COPYFILES
  181.     (SOURCE "/")
  182.     (DEST #ApplicationDir)
  183.     (HELP @copyfiles-help)
  184.     (OPTIONAL <force>)
  185.     (ALL)
  186.     (INFOS)
  187.                    )
  188. (STARTUP #ApplicationName
  189.      (SET #dummy (cat "Path add Path " #ApplicationDir))
  190.       (HELP @startup-help)
  191.       (PROMPT (#startup-prompt #ApplicationName #dummy))
  192.       (COMMAND #dummy)
  193. )
  194.     (exit (quiet))
  195.   )
  196. )
  197. ) ;PROCEDURE
  198. ;----------------------------------------------------------------------------
  199. ;----------------------------------------------------------------------------
  200. ;    Ask for Catalogs
  201. ;----------------------------------------------------------------------------
  202. ;----------------------------------------------------------------------------
  203. (PROCEDURE P_AskCatalogs #Language
  204.  
  205. (SET #Dummy     (ASKOPTIONS
  206.                 (PROMPT #App-Language)
  207.                 (HELP #App-Language-help)
  208.                 (CHOICES
  209.                         "English"
  210.                         "Deutsch")
  211.                 (DEFAULT #Language)
  212.         )
  213. )
  214. ) ;PROCEDURE
  215. ;----------------------------------------------------------------------------
  216. ;----------------------------------------------------------------------------
  217. ;    Copy Selected Catalogs
  218. ;----------------------------------------------------------------------------
  219. ;----------------------------------------------------------------------------
  220. (PROCEDURE P_CopyCatalogs #Language
  221. (SET n 0)
  222. (SET #DestinationRoot (TACKON #ApplicationDir "Catalogs"))
  223. (SET #SourceRoot (TACKON #ArchiveDir "Catalogs"))
  224. (MAKEDIR #DestinationRoot)
  225.  
  226. (while (< n 2)
  227.         (SET #Dummy (SELECT n "english" "deutsch"))
  228.         (
  229.                 (IF (IN #Language n)
  230.                 (
  231.     (MAKEDIR (TACKON #DestinationRoot #Dummy))
  232.                         (COPYFILES
  233.                                 (SOURCE (TACKON #SourceRoot #Dummy))
  234.                                 (DEST (TACKON #DestinationRoot #Dummy))
  235.                                 (HELP @copyfiles-help)
  236.                                 (ALL)
  237.                         )
  238.                 )
  239.                 )
  240.         )
  241. (SET n (+ n 1))
  242. )
  243. ) ;PROCEDURE
  244. ;----------------------------------------------------------------------------
  245. ;----------------------------------------------------------------------------
  246. ;    Ask for docs
  247. ;----------------------------------------------------------------------------
  248. ;----------------------------------------------------------------------------
  249. (PROCEDURE P_AskDocs #Documents
  250. (SET #Dummy             (ASKOPTIONS
  251.                         (PROMPT #App-Docs)
  252.                         (HELP @askoptions-help)
  253.                         (CHOICES
  254.                         "english"
  255.                         "deutsch"
  256.                         )
  257.                         (DEFAULT #Documents)
  258.                   )
  259. )
  260. ) ;PROCEDURE
  261. ;----------------------------------------------------------------------------
  262. ;----------------------------------------------------------------------------
  263. ;    Copy docs
  264. ;----------------------------------------------------------------------------
  265. ;----------------------------------------------------------------------------
  266. (PROCEDURE P_CopyDocs #Documents
  267. (SET n 0)
  268. (SET #DestinationRoot (TACKON #ApplicationDir "Docs"))
  269. (SET #SourceRoot (TACKON #ArchiveDir "Docs"))
  270. (MAKEDIR #DestinationRoot)
  271.  
  272. (while (< n 2)
  273.         (SET #Dummy (SELECT n
  274.         "english"
  275.         "deutsch"
  276.     )
  277.         )
  278.         (
  279.                 (IF (IN #Documents n)
  280.                 (
  281.     (MAKEDIR (TACKON #DestinationRoot #Dummy))
  282.                         (COPYFILES
  283.                                 (SOURCE (TACKON #SourceRoot #Dummy))
  284.                                 (DEST (TACKON #DestinationRoot #Dummy))
  285.                                 (HELP @copyfiles-help)
  286.                                 (INFOS)
  287.                                 (ALL)
  288.                         )
  289.                 )
  290.                 )
  291.         )
  292. (SET n (+ n 1))
  293. )
  294. ) ;PROCEDURE
  295. ;----------------------------------------------------------------------------
  296. ;----------------------------------------------------------------------------
  297. ;    Copy_Dir (Dir)
  298. ;----------------------------------------------------------------------------
  299. ;----------------------------------------------------------------------------
  300. (PROCEDURE P_CopyDir #Dummy
  301.  
  302. (SET #DestinationRoot (TACKON #ApplicationDir #Dummy))
  303. (SET #SourceRoot (TACKON #ArchiveDir #Dummy))
  304. (MAKEDIR #DestinationRoot)
  305.  
  306.                    (COPYFILES
  307.     (SOURCE #SourceRoot)
  308.     (DEST #DestinationRoot)
  309.     (HELP @copyfiles-help)
  310.     (OPTIONAL <force>)
  311.     (ALL)
  312.     (INFOS)
  313.                    )
  314. ) ;PROCEDURE
  315. ;----------------------------------------------------------------------------
  316. ;----------------------------------------------------------------------------
  317. ;    Copy_File (Name)
  318. ;----------------------------------------------------------------------------
  319. ;----------------------------------------------------------------------------
  320. (PROCEDURE P_CopyFile #Dummy
  321.                    (COPYFILES
  322.     (SOURCE (TACKON #ArchiveDir #Dummy))
  323.     (DEST #ApplicationDir)
  324.     (HELP @copyfiles-help)
  325.     (OPTIONAL <force>)
  326.     (ALL)
  327.     (INFOS)
  328.                    )
  329. ) ;PROCEDURE
  330. ;----------------------------------------------------------------------------
  331. ;----------------------------------------------------------------------------
  332. ;    GetApplicationDir
  333. ;----------------------------------------------------------------------------
  334. ;----------------------------------------------------------------------------
  335. (PROCEDURE P_GetApplicationDir #Dummy
  336.  
  337. (SET #ApplicationDir
  338.         (TACKON
  339.                 (ASKDIR
  340.                         (PROMPT (#App-Where #ApplicationName))
  341.                         (HELP @askdir-help)
  342.                         (default #Dummy)
  343.                 )
  344.                 #ApplicationName
  345.         )
  346. )
  347. ) ;PROCEDURE
  348. ;----------------------------------------------------------------------------
  349. ;----------------------------------------------------------------------------
  350. ;    P_Update
  351. ;----------------------------------------------------------------------------
  352. ;----------------------------------------------------------------------------
  353. (PROCEDURE P_Update
  354. (if (= (exists #ApplicationDir) 2)
  355.         (message (#App-Update #ApplicationName #ApplicationName #ApplicationName))
  356. )
  357. ) ;PROCEDURE
  358. ;----------------------------------------------------------------------------
  359. ;----------------------------------------------------------------------------
  360. ;    P_AskBinary
  361. ;----------------------------------------------------------------------------
  362. ;----------------------------------------------------------------------------
  363. (PROCEDURE P_AskBinary
  364. (set #Dummy (/ (getversion) 65536))
  365.  
  366. (if (= #Dummy 37) (set #Binary 0))
  367. (if (= #Dummy 38) (set #Binary 1))
  368. (if (> #Dummy 38) (set #Binary 2))
  369.  
  370. (set #Binary (askchoice
  371.     (prompt (#App-Main #ApplicationName))
  372.     (help (#App-Main-help #ApplicationName))
  373.     (choices
  374.     "OS2.0+"
  375.                            "OS2.1+"
  376.                            "OS3.0+"
  377.                         )
  378.     (default #Binary)
  379.             )
  380. )
  381. ) ;PROCEDURE
  382. ;----------------------------------------------------------------------------
  383. ;----------------------------------------------------------------------------
  384. ;    P_CopyBinary
  385. ;----------------------------------------------------------------------------
  386. ;----------------------------------------------------------------------------
  387. (PROCEDURE P_CopyBinary
  388. (set #Binary (Select #Binary #ApplicationName "Bin/OS21" "Bin/OS30"))
  389. (copyfiles
  390.         (source (tackon #ArchiveDir #Binary) (infos))
  391.         (dest #ApplicationDir)
  392.         (newname #ApplicationName)
  393.         (help @copyfiles-help)
  394.         (optional <force>)
  395. )
  396. ) ;PROCEDURE
  397. ;----------------------------------------------------------------------------
  398. ;----------------------------------------------------------------------------
  399. ;    P_KeyFile
  400. ;----------------------------------------------------------------------------
  401. ;----------------------------------------------------------------------------
  402. (PROCEDURE P_KeyFile
  403.  
  404. (SET #Dummy (tackon (tackon #ArchiveDir "Keyfile") #ApplicationKeyfile))
  405.  
  406. (if (<> (exists #Dummy (noreq)) 0) ((P_CopyDir "KeyFile"))
  407. )
  408. ) ;PROCEDURE
  409. ;----------------------------------------------------------------------------
  410. ;----------------------------------------------------------------------------
  411. ;    MAIN
  412. ;----------------------------------------------------------------------------
  413. ;----------------------------------------------------------------------------
  414. (P_Requirements)
  415. (message (#App-installmsg #ApplicationName #ApplicationName #ApplicationName #ApplicationName))
  416. (welcome)
  417.  
  418.  (SET #ApplicationDir (P_GetApplicationDir #ApplicationDir))
  419.  
  420. (COMPLETE 1)
  421.  (P_Update)
  422.  (SET #Binary (P_AskBinary))
  423. (COMPLETE 2)
  424.  (SET #Language (P_AskCatalogs #Language))
  425. (COMPLETE 3)
  426.  (SET #Documents (P_AskDocs #Documents))
  427. (COMPLETE 4)
  428.  
  429. ;***** Delete old Data and Prefs
  430. (MAKEDIR #ApplicationDir (INFOS))
  431. ;(DELETE (TACKON #ApplicationDir "AFind.prefs"))
  432. (COMPLETE 10)
  433.  (P_CopyBinary)
  434. (COMPLETE 20)
  435.  (P_CopyFile "AminetFind.info")
  436. (COMPLETE 30)
  437.  (P_CopyFile "AddIndex")
  438. (COMPLETE 40)
  439.  (P_CopyFile "AddIndexGUI")
  440. (COMPLETE 50)
  441.  (P_CopyCatalogs #Language)
  442. (COMPLETE 60)
  443.  (P_CopyDocs #Documents)
  444. (COMPLETE 70)
  445.  (P_Keyfile)
  446. (STARTUP #ApplicationName
  447.      (SET #dummy (cat "Path add Path " #ApplicationDir))
  448.       (HELP @startup-help)
  449.       (PROMPT (#startup-prompt #ApplicationName #dummy))
  450.       (COMMAND #dummy)
  451. )
  452.  
  453. (COMPLETE 100)
  454.  
  455. ;(exit #App-exit)
  456.