home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 14 / MA_Cover_14.iso / hobby / mccontrol / install / mccontrol.install < prev   
Encoding:
Text File  |  2000-03-02  |  26.4 KB  |  718 lines

  1. ; $VER: MCControl.install 1.28 (23.02.00)
  2. ; Install script for MCControl (Workbench 2.0 or higher)
  3. ;
  4. (COMPLETE 0)
  5. ;(USER 2)
  6. (SET #ApplicationName "MCControl")
  7. (SET #ApplicationDir "sys:tools")
  8. (SET #ApplicationDir1 "sys:utilities")
  9. (SET #ApplicationDir2 "work:tools")
  10. (SET #ApplicationDir3 "tools:")
  11. (SET #ApplicationDir4 "work:utilities")
  12. (SET #ArchiveDir "/")
  13. (SET #Language -1)
  14. (SET #Documents -1)
  15. (SET #ApplicationKeyfile (CAT #ApplicationName ".key"))
  16. ;=============================================================================
  17. ; English strings
  18.  
  19. (SET default_lang 1)
  20.  
  21. (SET #bad-kick "You must have at least Workbench 2.0+")
  22. (SET #bad-installer
  23. (CAT "You have an old version of the program 'Installer' "
  24.      "on your Amiga!\n\nThe installation procedure needs at least Installer 42.9.\n\n"
  25.      "Please check your configuration!\n"
  26. ))
  27.  
  28. (SET #App-InstallMsg
  29. (CAT "\n\n%s Installation Script.\n\n"
  30.         "This script installs %s on your Amiga.\n\n"
  31.         "Read the guide file for more information\n"
  32.         " on the distribution of %s.\n\n"
  33.         "%s © 1995-2000 Guido Mersmann\n"
  34.         "All rights reserved."
  35. ))
  36. (SET #App-MainMode "Please choose mode:")
  37.  
  38. (SET #App-Where
  39. (CAT "Where would you like to install %s ?\n"
  40.         "(A drawer will be created)"
  41. ))
  42.  
  43. (SET #App-Update
  44. (CAT "\n\nA %s drawer does already exist in the selected "
  45.         " directory.\n\n By selecting \"Proceed\", you"
  46.         " indicate that you want to update the %s"
  47.         " installation with the most recent version.\n\n"
  48.         "Several %s specific files will be overwritten!"
  49. ))
  50.  
  51. (SET #App-Main "Which %s version should be installed ?")
  52. (SET #App-Main-help
  53. (CAT "The OS2.0+ version should only be used on Systems with OS2."
  54.      " The OS2.1+ and the OS3.0+ version need less Memory. Locale is required!"
  55.      " Special OS3.0+ functions are used to save more memory."
  56. ))
  57.  
  58. (SET #App-Language "Which languages should be installed ?")
  59. (SET #App-Language-help
  60. (CAT "\nThe Amiga can be operated in many different"
  61.           " languages."
  62.           "To reduce the amount of space consumed by the"
  63.           " language files, you can select to have only the"
  64.           " files of specific languages copied.\n\n"
  65.           "Simply check the boxes of the languages you wish"
  66.           " to have available on your system.\n\n"
  67.           @askoptions-help
  68. ))
  69.  
  70. (SET #App-Help "Which Amiga-guide files should be installed ?")
  71.  
  72. (SET #App-Exit "\n\n%s installed !!\n\n%s can be found in your \"%s\" drawer (or partiton).")
  73. ;--------- DEINSTALLATION STRINGS
  74. (SET #App-DeInstallWhere "Where is the location of %s ?\n")
  75. (SET #App-Install "Install")
  76. (SET #App-DeInstall "Deinstall")
  77. (SET #bad-DeInstall "There is no %s installation at the specified position!")
  78. (SET #StartupRemove-prompt "\nRemove %s lines within your user-startup?")
  79. (SET #Deinstall-Done "\n%s is now deinstalled.")
  80. ;=============================================================================
  81. ; German strings
  82.  
  83. (IF (= @language "deutsch")
  84. (
  85. (SET default_lang 2)
  86.  
  87. (SET #bad-kick "Sie benötigen Workbench 2.0 oder größer")
  88. (SET #bad-installer
  89. (CAT "Achtung! Es ist eine alte Version des Programmes 'Installer' "
  90.      "auf Ihrem Amiga!\n\nDie Installation benötigt mindestens Installer 42.9.\n\n"
  91.      "Bitte überprüfen Sie Ihre Konfiguration!\n"
  92. ))
  93.  
  94. (SET #App-InstallMsg
  95. (CAT "\n%s Installationsskript.\n\n"
  96.         "Dieses Skript installiert oder deinstalliert\n"
  97.         "%s auf Ihrem Amiga.\n\n"
  98.         "Lesen Sie die Anleitungsdatei für weitere Informationen"
  99.         " über den Vertrieb von %s.\n\n"
  100.         "%s © 1999-2000 Guido Mersmann\n"
  101.         "Alle Rechte reserviert."
  102. ))
  103. (SET #App-MainMode "Wählen Sie den gewüschten Vorgang!")
  104.  
  105. (SET #App-Where
  106. (CAT "Wo möchten Sie %s installieren ?\n"
  107.         "(Ein Verzeichnis wird angelegt)"
  108. ))
  109.  
  110. (SET #App-Update
  111. (CAT "\nEin %s-Verzeichnis existiert im ausgewählen"
  112.         " Verzeichnis.\n\n Wenn Sie fortfahren,"
  113.         " bestätigen Sie, daß Sie die alte %s-Installation"
  114.         " mit der neuesten Version überschreiben wollen.\n\n"
  115.         "Verschiedene %s-Dateien (z.B überflüssige Dateien) werden falls nötig überschrieben!"
  116. ))
  117.  
  118. (SET #App-Main "Welche Version von %s möchten Sie installieren?")
  119. (SET #App-Main-help
  120. (CAT "Die OS2.0+ Version läuft unter allen Systemen ab OS2.0."
  121.      " Die OS2.1+ Version hat den Nutzen, daß sie weniger Resourcen"
  122.      " benutzt, wenn sich %s im Hintergrund befindet. Dazu MUß"
  123.      " die Locale.library eingebunden sein. Für die OS3.0+ gilt das Selbe"
  124.      " wie für die OS2.1 Verison. Es werden OS3.0+ Routinen benutzt, die"
  125.      " weiteren Speicher sparen."
  126. ))
  127.  
  128. (SET #App-Language "Welche Sprachen sollen installiert werden ?")
  129.  
  130. (SET #App-Language-help
  131. (CAT "\nDer Amiga kann in vielen verschiedenen Sprachen"
  132.          " arbeiten. Um Plattenkapazität zu sparen können Sie"
  133.          " nur die Sprachen anwählen, die sie benötigen"
  134.          " Haken Sie also einfach die Sprachen ab, die Sie"
  135.          " Ihrem System zugänglich machen wollen."
  136.           @askoptions-help
  137. ))
  138.  
  139. (SET #App-Help "Welche Anleitungs- und Informationsdateien wollen Sie installieren ?")
  140.  
  141. (SET #App-Exit "\n\n%s installiert!!\n\nSie finden %s im Verzeichnis \"%s\"")
  142. ;------- DEINSTALL STRINGS
  143. (SET #App-DeinstallWhere "Wo liegt %s auf Ihrer Platte ?\n")
  144. (SET #App-Install "%s Installieren")
  145. (SET #App-DeInstall "%s Deinstallieren")
  146. (SET #bad-DeInstall "Es gibt keine %s Installation an der angegeben Position")
  147. (SET #StartupRemove-prompt "\n\nDie zu %s gehörenden Einträge in der User-startup werden gelöscht!")))
  148. (SET #Deinstall-Done "\n%s ist jetzt deinstalliert!")
  149. ;=============================================================================
  150. ; français strings
  151.  
  152. (IF (= @language "français")
  153. (
  154. (SET default_lang 4)
  155.  
  156. (SET #bad-kick "Vous devez avoir le Workbench 2.0 au moins")
  157. (SET #bad-installer
  158. (CAT "Vous avez une ancienne version du programme 'Installer' "
  159.      "sur votre Amiga!\n\nLa procédure d'installation a besoin d'Installer 42.9 ou supérieur.\n\n"
  160.      "Veuillez vérifier votre configuration!\n"
  161. ))
  162.  
  163. (SET #App-InstallMsg
  164. (CAT "\n\nScript d'installation pour %s.\n\n"
  165.         "Ce script installe %s sur votre Amiga.\n\n"
  166.         "Lisez le guide pour de plus amples informations\n"
  167.         " sur cette distribution de %s.\n\n"
  168.         "%s © 1995-2000 Guido Mersmann\n"
  169.         "Tous droits réservés."
  170. ))
  171. (SET #App-MainMode "Veuillez choisir le mode:")
  172.  
  173. (SET #App-Where
  174. (CAT "Où voulez-vous installer %s ?\n"
  175.         "(Un tiroir sera crée)"
  176. ))
  177.  
  178. (SET #App-Update
  179. (CAT "\n\nUn tiroir %s existe déja dans le répertoire "
  180.         " sélectionné.\n\n En sélectionnant \"Continuer\", vous"
  181.         " indiquez que vous voulez mettre à jour l'installation"
  182.         " de %s par la version la plus récente.\n\n"
  183.         "Plusieurs fichiers spécifiques à %s vont être mis à jour!"
  184. ))
  185.  
  186. (SET #App-Main "Quelle version de %s doit être installée ?")
  187. (SET #App-Main-help
  188. (CAT "La version OS2.0+ ne devrait être utilisée que sur un système tournant sous AmigaOS 2."
  189.      " Les versions OS2.1+ et OS3.0+ utilisent moins de mémoire. Le système de localisation est nécéssaire!"
  190.      " Des fonction spéciales de l'OS3.0+ sont utilisées pour gagner plus de mémoire."
  191. ))
  192.  
  193. (SET #App-Language "Quelles langues doivent être installées ?")
  194. (SET #App-Language-help
  195. (CAT "\nL'Amiga peut être utilisé dans beaucoup de langues"
  196.           " différentes."
  197.           "Pour réduire la place utilisée par les fichiers de"
  198.           " localisation, vous pouvez choisir de n'avoir"
  199.           " que certaines langues spécifiques installées.\n\n"
  200.           "Sélectionnez simplement les cases à cocher correspondant aux"
  201.           " langues que vous voulez sur votre système.\n\n"
  202.           @askoptions-help
  203. ))
  204.  
  205. (SET #App-Help "Quels fichiers d'aide doivent être installés ?")
  206.  
  207. (SET #App-Exit "\n\n%s est installé !!\n\n%s se trouve dans le tiroir (ou la partition) \"%s\".")
  208. ;--------- DEINSTALLATION STRINGS
  209. (SET #App-DeInstallWhere "Où est situé %s ?\n")
  210. (SET #App-Install "Installer")
  211. (SET #App-DeInstall "Désinstaller")
  212. (SET #bad-DeInstall "Il n'y a aucune installation de %s à l'emplacement spécifié!")
  213. (SET #StartupRemove-prompt "\nSuppression des lignes relatives à %s dans votre user-startup?")
  214. (SET #Deinstall-Done "\n%s est maintenant désinstallé.")
  215. ;---------
  216. ))
  217. ;=============================================================================
  218. ; Español strings
  219.  
  220. (IF (= @language "español")
  221. (
  222. (SET default_lang 8)
  223.  
  224. (SET #bad-kick "Necesitas al menos Workbench 2.0+")
  225. (SET #bad-installer
  226. (CAT "Tienes una versión antigua del 'Installer' "
  227.      "en tu Amiga!\n\nEl proceso de instalación requiere al menos el Installer 42.9.\n\n"
  228.      "Revisa tu configuración!\n"
  229. ))
  230.  
  231. (SET #App-InstallMsg
  232. (CAT "\n\nGuión de instalación de %s .\n\n"
  233.         "Este script instala %s en tu Amiga.\n\n"
  234.         "Lee el amigaguide para más información\n"
  235.         " sobre la distribución de %s.\n\n"
  236.         "%s © 1995-2000 Guido Mersmann\n"
  237.         "Todos los derechos reservados."
  238. ))
  239. (SET #App-MainMode "Elige uno de los modos:")
  240.  
  241. (SET #App-Where
  242. (CAT "¿ Dónde quieres instalar %s ?\n"
  243.         "(Un cajón será creado)"
  244. ))
  245.  
  246. (SET #App-Update
  247. (CAT "\n\nYa existe un cajón %s en ese"
  248.         " directorio.\n\n Si seleccionas \"Seguir\","
  249.         " actualizarás la instalación %s"
  250.         " con la versión más reciente.\n\n"
  251.         "!Algunos ficheros específicos de %s serán sobreescritos¡"
  252. ))
  253.  
  254. (SET #App-Main "¿ Qué versión de %s quieres instalar ?")
  255. (SET #App-Main-help
  256. (CAT "La versión OS2.0+ sólo debería funcionar bajo sistemas con OS2."
  257.      " Las versiones OS2.1+ y OS3.0+ requieren menos Memoria. Necesitas Locale!"
  258.      " Algunas funciones del OS3.0+ reducen el consumo de memoria."
  259. ))
  260.  
  261. (SET #App-Language "¿ Qué lenguajes quieres instalar ?")
  262. (SET #App-Language-help
  263. (CAT "\nRl Amiga puede trabajar en numerosos lenguajes"
  264.           " diferentes."
  265.           "Parar reducir la cantidad de espacio necesaria para los"
  266.           " ficheros de lenguaje, puedes copiar sólo"
  267.           " los lenguajes específicos.\n\n"
  268.           "Marca las cajas de los lenguajes que quieras"
  269.           " tener disponibles en tu sistema.\n\n"
  270.           @askoptions-help
  271. ))
  272.  
  273. (SET #App-Help "¿Qué Amiga-guides queres instalar ?")
  274.  
  275. (SET #App-Exit "\n\n%s instalado !!\n\n%s está en el cajón \"%s\" (o partición).")
  276. ;--------- DEINSTALLATION STRINGS
  277. (SET #App-DeInstallWhere "¿ En qué directorio está %s ?\n")
  278. (SET #App-Install "Instalar")
  279. (SET #App-DeInstall "Desinstalar")
  280. (SET #bad-DeInstall "No hay instalación de %s en el lugar indicado")
  281. (SET #StartupRemove-prompt "\n¿ Elimino las líneas %s de tu fichero user-startup ?")
  282. (SET #Deinstall-Done "\n%s ha sido desinstalado.")
  283. ;---------
  284. ))
  285. ;----------------------------------------------------------------------------
  286. ;----------------------------------------------------------------------------
  287. ;       P_Requirements
  288. ;----------------------------------------------------------------------------
  289. ;----------------------------------------------------------------------------
  290. (PROCEDURE P_Requirements
  291. ; Workbench 37 or better required
  292. (IF (< (/ (getversion) 65536) 37)
  293. (
  294.   (abort #bad-kick)
  295. )
  296. )
  297. ; Installer 42.9 or better required
  298. (if (< @installer-version 2752521)
  299. (
  300. (abort #bad-installer)
  301. )
  302. ) ;if
  303. ) ;PROCDURE
  304. ;----------------------------------------------------------------------------
  305. ;----------------------------------------------------------------------------
  306. ;       P_DeInstall
  307. ;----------------------------------------------------------------------------
  308. ;----------------------------------------------------------------------------
  309. (PROCEDURE P_DeInstall #InstallerMode
  310.  
  311. (SET #Dummy             (ASKCHOICE
  312.                         (PROMPT #App-MainMode)
  313.                         (HELP @askchoice-help)
  314.                         (CHOICES
  315.                                 (#App-Install #ApplicationName)
  316.                                 (#App-Deinstall #ApplicationName)
  317.                         )
  318.                         ;(DEFAULT #Documents)
  319.                         )
  320. )
  321. ) ;PROCDURE
  322. ;----------------------------------------------------------------------------
  323. ;----------------------------------------------------------------------------
  324. ;       GetApplicationDir
  325. ;----------------------------------------------------------------------------
  326. ;----------------------------------------------------------------------------
  327. (PROCEDURE P_GetApplicationDir
  328. (SET #Dummy #ApplicationDir)
  329. (if (= (exists (TACKON #ApplicationDir1 #ApplicationName) (NOREQ)) 2) (SET #Dummy #ApplicationDir1))
  330. (if (= (exists (TACKON #ApplicationDir2 #ApplicationName) (NOREQ)) 2) (SET #Dummy #ApplicationDir2))
  331. (if (= (exists (TACKON #ApplicationDir3 #ApplicationName) (NOREQ)) 2) (SET #Dummy #ApplicationDir3))
  332. (if (= (exists (TACKON #ApplicationDir4 #ApplicationName) (NOREQ)) 2) (SET #Dummy #ApplicationDir4))
  333.  
  334. (SET #ApplicationDir
  335.         (TACKON
  336.                 (ASKDIR
  337.                         (PROMPT (#App-Where #ApplicationName))
  338.                         (HELP @askdir-help)
  339.                         (default #Dummy)
  340.                 )
  341.                 #ApplicationName
  342.         )
  343. )
  344. (SET @default-dest #ApplicationDir)
  345. ) ;PROCEDURE
  346. ;----------------------------------------------------------------------------
  347. ;----------------------------------------------------------------------------
  348. ;       GetDeinstallDir
  349. ;----------------------------------------------------------------------------
  350. ;----------------------------------------------------------------------------
  351. (PROCEDURE P_GetDeInstallDir
  352. (SET #Dummy #ApplicationDir)
  353. (if (= (exists (TACKON #ApplicationDir1 #ApplicationName) (NOREQ)) 2) (SET #Dummy #ApplicationDir1))
  354. (if (= (exists (TACKON #ApplicationDir2 #ApplicationName) (NOREQ)) 2) (SET #Dummy #ApplicationDir2))
  355. (if (= (exists (TACKON #ApplicationDir3 #ApplicationName) (NOREQ)) 2) (SET #Dummy #ApplicationDir3))
  356. (if (= (exists (TACKON #ApplicationDir4 #ApplicationName) (NOREQ)) 2) (SET #Dummy #ApplicationDir4))
  357.  
  358. (SET #ApplicationDir
  359.                 (ASKDIR
  360.                         (PROMPT (#App-DeInstallWhere #ApplicationName))
  361.                         (HELP @askdir-help)
  362.                         (default #Dummy)
  363.                 )
  364. )
  365.          (SET #Dummy (EXISTS (TACKON #Applicationdir #ApplicationName)))
  366.  
  367.         (Select #Dummy
  368.          (abort (#bad-DeInstall #ApplicationName))
  369.          (SET #Applicationdir #Applicationdir)
  370.          (SET #Applicationdir (TACKON #Applicationdir #ApplicationName))
  371.         ) ;Select
  372. (SET @default-dest #ApplicationDir)
  373.  
  374. ) ;PROCEDURE
  375. ;----------------------------------------------------------------------------
  376. ;----------------------------------------------------------------------------
  377. ;       Ask for Catalogs
  378. ;----------------------------------------------------------------------------
  379. ;----------------------------------------------------------------------------
  380. (PROCEDURE P_AskCatalogs #Language
  381.  
  382. (SET #Dummy     (ASKOPTIONS
  383.                 (PROMPT #App-Language)
  384.                 (HELP #App-Language-help)
  385.                 (CHOICES
  386.                         "English"
  387.                         "Deutsch"
  388.                         "Français"
  389.                         "Español")
  390.                 (DEFAULT default_lang)
  391.         )
  392. )
  393. ) ;PROCEDURE
  394. ;----------------------------------------------------------------------------
  395. ;----------------------------------------------------------------------------
  396. ;       Copy Selected Catalogs
  397. ;----------------------------------------------------------------------------
  398. ;----------------------------------------------------------------------------
  399. (PROCEDURE P_CopyCatalogs #Language
  400. (SET n 0)
  401. (SET #DestinationRoot (TACKON #ApplicationDir "Catalogs"))
  402. (SET #SourceRoot (TACKON #ArchiveDir "Catalogs"))
  403. (MAKEDIR #DestinationRoot)
  404.  
  405. (while (< n 4)
  406.         (SET #Dummy (SELECT n "english" "deutsch" "français" "español"))
  407.         (
  408.                 (IF (IN #Language n)
  409.                 (
  410.         (MAKEDIR (TACKON #DestinationRoot #Dummy))
  411.                         (COPYFILES
  412.                                 (SOURCE (TACKON #SourceRoot #Dummy))
  413.                                 (DEST (TACKON #DestinationRoot #Dummy))
  414.                                 (HELP @copyfiles-help)
  415.                                 (ALL)
  416.                         )
  417.                 )
  418.                 )
  419.         )
  420. (SET n (+ n 1))
  421. )
  422. ) ;PROCEDURE
  423. ;----------------------------------------------------------------------------
  424. ;----------------------------------------------------------------------------
  425. ;       Ask for Help
  426. ;----------------------------------------------------------------------------
  427. ;----------------------------------------------------------------------------
  428. (PROCEDURE P_AskHelp #Documents
  429. (SET #Dummy             (ASKOPTIONS
  430.                         (PROMPT #App-Help)
  431.                         (HELP @askoptions-help)
  432.                         (CHOICES
  433.                                 "english"
  434.                                 "deutsch"
  435.                         )
  436.                         (DEFAULT default_lang)
  437.                   )
  438. )
  439. ) ;PROCEDURE
  440. ;----------------------------------------------------------------------------
  441. ;----------------------------------------------------------------------------
  442. ;       Copy Help
  443. ;----------------------------------------------------------------------------
  444. ;----------------------------------------------------------------------------
  445. (PROCEDURE P_CopyHelp #Documents
  446. (SET n 0)
  447. (SET #DestinationRoot (TACKON #ApplicationDir "Help"))
  448. (SET #SourceRoot (TACKON #ArchiveDir "Help"))
  449. (MAKEDIR #DestinationRoot)
  450.  
  451. (while (< n 2)
  452.         (SET #Dummy (SELECT n
  453.                 "english"
  454.                 "deutsch"
  455.         )
  456.         )
  457.         (
  458.                 (IF (IN #Documents n)
  459.                 (
  460.         (MAKEDIR (TACKON #DestinationRoot #Dummy))
  461.                         (COPYFILES
  462.                                 (SOURCE (TACKON #SourceRoot #Dummy))
  463.                                 (DEST (TACKON #DestinationRoot #Dummy))
  464.                                 (HELP @copyfiles-help)
  465.                                 (INFOS)
  466.                                 (ALL)
  467.                         )
  468.                 )
  469.                 )
  470.         )
  471. (SET n (+ n 1))
  472. )
  473. ) ;PROCEDURE
  474. ;----------------------------------------------------------------------------
  475. ;----------------------------------------------------------------------------
  476. ;       Copy_Dir (Dir)
  477. ;----------------------------------------------------------------------------
  478. ;----------------------------------------------------------------------------
  479. (PROCEDURE P_CopyDir #Dummy
  480.  
  481. (SET #DestinationRoot (TACKON #ApplicationDir #Dummy))
  482. (SET #SourceRoot (TACKON #ArchiveDir #Dummy))
  483. (MAKEDIR #DestinationRoot)
  484.  
  485.                    (COPYFILES
  486.         (SOURCE #SourceRoot)
  487.         (DEST #DestinationRoot)
  488.         (HELP @copyfiles-help)
  489.         (OPTIONAL <force>)
  490.         (ALL)
  491.         (INFOS)
  492.                    )
  493. ) ;PROCEDURE
  494. ;----------------------------------------------------------------------------
  495. ;----------------------------------------------------------------------------
  496. ;       Copy_File (Name)
  497. ;----------------------------------------------------------------------------
  498. ;----------------------------------------------------------------------------
  499. (PROCEDURE P_CopyFile #Dummy
  500.  
  501. (if (<> (exists (TACKON #ArchiveDir #Dummy) (noreq)) 0) 
  502. (
  503.                    (COPYFILES
  504.         (SOURCE (TACKON #ArchiveDir #Dummy))
  505.         (DEST #ApplicationDir)
  506.         (HELP @copyfiles-help)
  507.         (OPTIONAL <force>)
  508.         (ALL)
  509.         (INFOS)
  510.                    )
  511. )
  512. ) ;If
  513. ) ;PROCEDURE
  514. ;----------------------------------------------------------------------------
  515. ;----------------------------------------------------------------------------
  516. ;       P_Update
  517. ;----------------------------------------------------------------------------
  518. ;----------------------------------------------------------------------------
  519. (PROCEDURE P_Update
  520. (if (= (exists #ApplicationDir) 2)
  521.         (message (#App-Update #ApplicationName #ApplicationName #ApplicationName))
  522. )
  523. ) ;PROCEDURE
  524. ;----------------------------------------------------------------------------
  525. ;----------------------------------------------------------------------------
  526. ;       P_AskBinary
  527. ;----------------------------------------------------------------------------
  528. ;----------------------------------------------------------------------------
  529. (PROCEDURE P_AskBinary
  530. (set #Dummy (/ (getversion) 65536))
  531.  
  532. (if (= #Dummy 37) (set #Binary 0))
  533. (if (= #Dummy 38) (set #Binary 1))
  534. (if (>= #Dummy 39) (set #Binary 2))
  535.  
  536. (set #Binary (askchoice
  537.         (prompt (#App-Main #ApplicationName))
  538.         (help (#App-Main-help #ApplicationName))
  539.         (choices
  540.         "OS2.0+"
  541.                         "OS2.1+"
  542.                         "OS3.0+"
  543.                         )
  544.         (default #Binary)
  545.             )
  546. )
  547. ) ;PROCEDURE
  548. ;----------------------------------------------------------------------------
  549. ;----------------------------------------------------------------------------
  550. ;       P_CopyBinary
  551. ;----------------------------------------------------------------------------
  552. ;----------------------------------------------------------------------------
  553. (PROCEDURE P_CopyBinary #Dummy
  554.  
  555. (set #BinaryName (SELECT #Binary #Dummy (CAT "Bin/" #Dummy "_OS21") (CAT "Bin/" #Dummy "_OS30")))
  556. (copyfiles
  557.         (source (tackon #ArchiveDir #BinaryName) (infos))
  558.         (dest #ApplicationDir)
  559.         (newname #Dummy)
  560.         (help @copyfiles-help)
  561.         (optional <force>)
  562. )
  563. ) ;PROCEDURE
  564. ;----------------------------------------------------------------------------
  565. ;----------------------------------------------------------------------------
  566. ;       P_KeyFile
  567. ;----------------------------------------------------------------------------
  568. ;----------------------------------------------------------------------------
  569. (PROCEDURE P_KeyFile
  570.  
  571. (SET #Dummy (tackon (tackon #ArchiveDir "Keyfile") #ApplicationKeyfile))
  572.  
  573. (if (<> (exists #Dummy (noreq)) 0) ((P_CopyDir "KeyFile"))
  574. )
  575. ) ;PROCEDURE
  576. ;----------------------------------------------------------------------------
  577. ;----------------------------------------------------------------------------
  578. ;       P_CopyArchiveIcon
  579. ;----------------------------------------------------------------------------
  580. ;----------------------------------------------------------------------------
  581. (PROCEDURE P_CopyArchiveIcon
  582.                    (COPYFILES
  583.         (SOURCE (CAT (CAT (TACKON #ArchiveDir "/") #ApplicationName) ".info"))
  584.         (DEST (TACKON #ApplicationDir "/"))
  585.         (HELP @copyfiles-help)
  586.                    )
  587. ) ;PROCEDURE
  588. ;----------------------------------------------------------------------------
  589. ;----------------------------------------------------------------------------
  590. ;       P_AskBool
  591. ;----------------------------------------------------------------------------
  592. ;----------------------------------------------------------------------------
  593. (PROCEDURE P_AskBool #dummy
  594.  (SET #dummy (ASKBOOL      (prompt #dummy)
  595.            (help @askbool-help)
  596.            (default 1)
  597.              )
  598.  )
  599. ) ;PROCEDURE
  600. ;----------------------------------------------------------------------------
  601. ;----------------------------------------------------------------------------
  602. ;       MAIN
  603. ;----------------------------------------------------------------------------
  604. ;----------------------------------------------------------------------------
  605. (P_Requirements)
  606. (message (#App-installmsg #ApplicationName #ApplicationName #ApplicationName #ApplicationName))
  607. (SET #InstallerMode (P_DeInstall))
  608. (welcome)
  609. ;-----------------------------------------------
  610. (IF (= #InstallerMode "0")
  611. (
  612. ;-----------------------------------------------
  613.  (SET #ApplicationDir (P_GetApplicationDir))
  614.  
  615. (COMPLETE 1)
  616.  (P_Update)
  617.  (SET #Binary (P_AskBinary))
  618. (COMPLETE 2)
  619.  (SET #Language (P_AskCatalogs #Language))
  620. (COMPLETE 3)
  621.  (SET #Documents (P_AskHelp #Documents))
  622. (COMPLETE 4)
  623.  
  624. ;***** Delete old Data and Prefs
  625. (DELETE (TACKON #ApplicationDir "Docs") (optional FORCE) (ALL))
  626. (DELETE (TACKON #ApplicationDir "Docs.info" (optional FORCE) ))
  627.  
  628. (DELETE (TACKON #ApplicationDir "Help") (optional FORCE) (ALL))
  629. (DELETE (TACKON #ApplicationDir "Help.info" (optional FORCE) ))
  630. ;***** Create empty Drawers
  631. (MAKEDIR #ApplicationDir)
  632. (MAKEDIR (TACKON #ApplicationDir "Prefs"))
  633. (MAKEDIR (TACKON #ApplicationDir "SaveGames"))
  634.  
  635. (COMPLETE 10)
  636. (DELETE (TACKON #ApplicationDir "bin") (optional FORCE) (ALL))
  637.  (P_CopyBinary #ApplicationName)
  638. (COMPLETE 20)
  639. (DELETE (TACKON #ApplicationDir "catalogs") (optional FORCE) (ALL))
  640.  (P_CopyCatalogs #Language)
  641. (COMPLETE 30)
  642. (DELETE (TACKON #ApplicationDir "Help") (optional FORCE) (ALL))
  643.  (P_CopyHelp #Documents)
  644. (COMPLETE 40)
  645.  (P_CopyDir "Modules")
  646. (COMPLETE 50)
  647.  (P_CopyDir "MemoryCards")
  648. (COMPLETE 60)
  649.  (P_CopyDir "DefaultCards")
  650. (COMPLETE 70)
  651.  (P_CopyDir "Patches")
  652.  (P_CopyDir "Help/Pictures")
  653.  (P_Keyfile)
  654. (COMPLETE 80)
  655.  (P_CopyArchiveIcon)
  656.  (P_CopyFile "MCControl.info")
  657.  (P_CopyFile "Help.info")
  658.  (P_CopyFile "Warning")
  659.  
  660. (COMPLETE 90)
  661. ;-----
  662. (DELETE (TACKON #ApplicationDir "Modules.info"))
  663. (DELETE (TACKON #ApplicationDir "MemoryCards.info"))
  664. (DELETE (TACKON #ApplicationDir "DefaultCards.info"))
  665. (DELETE (TACKON #ApplicationDir "Patches.info"))
  666.  
  667. (DELETE (TACKON #ApplicationDir "Prefs.info"))
  668. (DELETE (TACKON #ApplicationDir "SaveGames.info"))
  669. (run "c:avail Flush")
  670. (COMPLETE 100)
  671. (message (#App-exit #ApplicationName #ApplicationName #ApplicationDir))
  672. (exit (QUIET))
  673. ;-----------------------------------------------
  674. )) ;IF #InstallerMode = 0
  675. ;-----------  Deinstallation -------------------
  676. (IF (= #InstallerMode "1") (
  677.  
  678. (SET #ApplicationDir (P_GetDeInstallDir))
  679.  
  680. (COMPLETE 20)
  681. (DELETE (TACKON #ApplicationDir "Modules") (optional FORCE) (ALL))
  682. (DELETE (TACKON #ApplicationDir "DefaultCards") (optional FORCE) (ALL))
  683. (DELETE (TACKON #ApplicationDir "Patches") (optional FORCE) (ALL))
  684. (COMPLETE 30)
  685. (DELETE (TACKON #ApplicationDir "Help") (optional FORCE) (ALL))
  686. (DELETE (TACKON #ApplicationDir "Help.info" (optional FORCE) ))
  687. (COMPLETE 40)
  688. (DELETE (TACKON #ApplicationDir "Install") (optional FORCE) (ALL))
  689. (DELETE (TACKON #ApplicationDir "Install.info" (optional FORCE) ))
  690. (COMPLETE 50)
  691. (DELETE (TACKON #ApplicationDir "Catalogs") (optional FORCE) (ALL))
  692. (COMPLETE 60)
  693. (DELETE (TACKON #ApplicationDir "Bin") (optional FORCE) (ALL))
  694. (COMPLETE 70)
  695. (DELETE (TACKON #ApplicationDir "Prefs") (optional FORCE) (ALL))
  696. (COMPLETE 80)
  697. (DELETE (TACKON #ApplicationDir "MCControl") (optional FORCE))
  698. (DELETE (TACKON #ApplicationDir "MCControl.info" (optional FORCE) ))
  699. (DELETE (TACKON #ApplicationDir "Warning") (optional FORCE))
  700. (DELETE (TACKON #ApplicationDir "Warning.info" (optional FORCE) ))
  701. (COMPLETE 90)
  702. (DELETE (TACKON #ApplicationDir "MemoryCards/example.mcd") (optional FORCE))
  703.  
  704. (DELETE (TACKON #ApplicationDir "MemoryCards"))
  705. (DELETE (TACKON #ApplicationDir "SaveGames"))
  706. (DELETE #ApplicationDir)
  707. (DELETE (CAT #ApplicationDir ".info"))
  708.  
  709. (COMPLETE 100)
  710.  
  711. (Message (#Deinstall-Done #ApplicationName))
  712. (exit (QUIET))
  713.  
  714. ;-----------------------------------------------
  715. )) ;IF #InstallerMode = 1
  716. ;-----------------------------------------------
  717.  
  718.