home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 3 / CD_Magazyn_EXEC_nr_3.iso / Recent / util / misc / DelfInit.lha / DelfInit / Install < prev    next >
Encoding:
Text File  |  2000-07-19  |  10.9 KB  |  280 lines

  1. ;-----------------------------------------------------------------------------
  2. ; TITLE        : Install
  3. ; VERSION      : 1.0
  4. ; DATE         : 28.08.1999
  5. ; DESCRIPTION  : Installer script for DelfInit
  6. ; INPUT        : -
  7. ; OUTPUT       : -
  8. ;-----------------------------------------------------------------------------
  9. ; MODIFICATIONS:
  10. ; 19.07.2000 Modification
  11. ;  Installation texts updated
  12. ;-----------------------------------------------------------------------------
  13. ; LIMITATIONS AND BUGS
  14. ; 28.08.1999 Limitation
  15. ;  Doesn't install DelfInit command call to the user-startup file
  16. ;-----------------------------------------------------------------------------
  17.  
  18. ; $VER: Install 1.0 (28.08.1999)
  19.  
  20. ;-----------------------------------------------------------------------------
  21. ; VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIA
  22. ;-----------------------------------------------------------------------------
  23. (set #config_ok 1)                       ; Default: configuration is ok
  24. (set #cpu "???(20|30|40|60)")            ; Required CPU
  25. (set #installer_ver 43)                  ; Minimum Installer version
  26. (set #installer_rev 3)                   ; Minimum Installer revision
  27. (set #os_ver 40)                         ; Minimum OS version
  28. (set #os_rev 10)                         ; Minimum OS revision
  29. (set #appsize 1000000)                   ; Required diskspace for application
  30.                                          ; (bytes)
  31. (set #configcheckmask %001)              ; Configuration check mask:
  32.                                          ; bit0 (right)  = cpu
  33.                                          ; bit1 (middle) = os version
  34.                                          ; bit2 (left)   = disk space
  35. (set #application "DelfInit")            ; Application
  36.  
  37. ; Default language (English)
  38. (set #string1 ("\nInstaller version %ld.%ld required.\nPlease check your configuration." #installer_ver #installer_rev))
  39. (set #string2 ("\n%s\n\nCopyright © 1999-2000 Janne Peräaho.\nAll Rights Reserved." #application))
  40. (set #string3 ("\n%s has now been installed.\nRead DelfInit.guide for instructions how to autoinitialize Delfina." #application))
  41. (set #string4 "\nAt least 68020 CPU, Installer version 43.3 and delfina.library required.\n\nPlease check your configuration.")
  42. (set #string5 "\nSelect components to be installed.")
  43. (set #string50 "\nSOFTWARE COMPONENTS\n\nDelfInit package consists of binary executable (DelfInit) and Amiga guide documentation (DelfInit.guide).\n\nIn this section you may select the prefered software components to be installed.")
  44. (set #string51 "DelfInit      (about 12 kB)")
  45. (set #string52 "Documentation (about 16 kB)")
  46. (set #string60 "\nSelect target directory for DelfInit (Delfina/bin directory recommended).")
  47. (set #string61 "\nINSTALLING DELFINIT\n\nDelfInit command will be copied to the selected directory.")
  48. (set #string62 "C:Delfina/bin/")
  49. (set #string63 "\nSelect target directory for DelfInit documentation (Delfina/Docs directory recommended).")
  50. (set #string64 "\nINSTALLING DELFINIT DOCUMENTATION\n\nDelfInit.guide and it's icon will be copied to the selected directory.")
  51. (set #string65 "C:Delfina/Docs")
  52. (set #string70 "\nInstalling DelfInit...")
  53. (set #string71 "\nINSTALLING DELFINIT\n\nDelfInit command will be copied into the target directory.")
  54. (set #string72 "DelfInit")
  55. (set #string73 "#?")
  56. (set #string74 "\nInstalling DelfInit documentation...")
  57. (set #string75 "\nINSTALLING DOCUMENTATION\n\nDelfInit.guide and DelfInit.guide.info will be copied into the target directory.")
  58. (set #string76 "")
  59. (set #string77 "DelfInit(.guide|.guide.info)")
  60.  
  61. ; Finnish language
  62. (if (= @language "suomi")
  63.    (
  64.       (set #string1 ("\nAsennukseen tarvitaan Installer-ohjelman versio %ld.%ld." #installer_ver #installer_rev))
  65.       (set #string2 ("\n%s\n\nOhjelmiston oikeudet © 1999-2000 omistaa Janne Peräaho.\nKaikki oikeudet pidätetään." #application))
  66.       (set #string3 ("\n%s on nyt asennettu.\nJos haluat aktivoida Delfinan automaattisesti jokaisen käynnistyksen yhteydessä, lue asennusohjeet DelfInit-dokumentaatiosta (DelfInit.guide)." #application))
  67.       (set #string4 "\nDelfInit vaatii vähintään 68020 CPU:n, Installer (versio 43.3) -ohjelman ja delfina-kirjaston.")
  68.       (set #string5 "\nValitse ne ohjelmiston osat, jotka haluat asentaa.")
  69.       (set #string50 "\nOHJELMISTON OSAT\n\nDelfInit-paketti koostuu ajokelpoisesta binääritiedostosta (DelfInit) ja Amiga guide -formaatissa olevasta dokumentaatiosta (DelfInit.guide).\n\nVoit valita haluamasi ohjelmiston osat, jotka asennetaan.")
  70.       (set #string51 "DelfInit      (noin 12 kt)")
  71.       (set #string52 "Dokumentaatio (noin 16 kt)")
  72.       (set #string60 "\nValitse kohdehakemisto DelfInit-ohjelmalle (suositus: Delfina/bin-hakemisto).")
  73.       (set #string61 "\nDELFINIT:N ASENNUS\n\nDelfInit-komento kopioidaan valittuun hakemistoon.")
  74.       (set #string62 "C:Delfina/bin/")
  75.       (set #string63 "\nValitse kohdehakemisto DelfInit-dokumentaatiolle (suositus: Delfina/Docs-hakemisto).")
  76.       (set #string64 "\nDELFINIT-DOKUMENTAATION ASENNUS\n\nDelfInit.guide ja sen ikoni kopioidaan valittuun hakemistoon.")
  77.       (set #string65 "C:Delfina/Docs")
  78.       (set #string70 "\nDelfInit:n asennus...")
  79.       (set #string71 "\nDELFINIT:N ASENNUS\n\nDelfInit-komento kopioidaan kohdehakemistoon.")
  80.       (set #string72 "DelfInit")
  81.       (set #string73 "#?")
  82.       (set #string74 "\nDelfInit-dokumentaation asennus...")
  83.       (set #string75 "\nDOKUMENTAATION ASENNUS\n\nDelfInit.guide ja DelfInit.guide.info kopioidaan kohdehakemistoon.")
  84.       (set #string76 "")
  85.       (set #string77 "DelfInit(.guide|.guide.info)")
  86.    )
  87. ); if
  88.  
  89. ;-----------------------------------------------------------------------------
  90. ; SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUB
  91. ;-----------------------------------------------------------------------------
  92. ;-----------------------------------------------------------------------------
  93. ; TITLE        : p_DecodeVersion
  94. ; VERSION      : 0.10
  95. ; DATE         : 30.08.1998
  96. ; DESCRIPTION  : Get version and revision from raw version number
  97. ; INPUT        : #version - raw version number
  98. ; OUTPUT       : #ver     - version number
  99. ;                #rev     - revision number
  100. ;-----------------------------------------------------------------------------
  101. ; MODIFICATIONS: -
  102. ;-----------------------------------------------------------------------------
  103. (procedure p_DecodeVersion #version
  104.    (set #ver (/ #version 65536))
  105.    (set #rev (- #version (* #ver 65536)))
  106. )
  107.  
  108. ;-----------------------------------------------------------------------------
  109. ; TITLE        : p_EncodeVersion
  110. ; VERSION      : 0.10
  111. ; DATE         : 30.08.1998
  112. ; DESCRIPTION  : Create raw version number from version and revision number
  113. ; INPUT        : #ver     - version number
  114. ;                #rev     - revision number
  115. ; OUTPUT       : #version - raw version number
  116. ;-----------------------------------------------------------------------------
  117. ; MODIFICATIONS: -
  118. ;-----------------------------------------------------------------------------
  119. (procedure p_EncodeVersion #ver #rev
  120.    (set #version (+ (* #ver 65536) #rev))
  121. )
  122.  
  123. ;-----------------------------------------------------------------------------
  124. ; TITLE        : p_CheckConfiguration
  125. ; VERSION      : 0.10
  126. ; DATE         : 30.08.1998
  127. ; DESCRIPTION  : Check if requirements match with current configuration
  128. ; INPUT        : -
  129. ; OUTPUT       : #config_ok - 0=not ok, 1=ok
  130. ;-----------------------------------------------------------------------------
  131. ; MODIFICATIONS: -
  132. ;-----------------------------------------------------------------------------
  133. (procedure p_CheckConfiguration
  134.  
  135.    ; Variables
  136.    (set #config_ok 1)
  137.  
  138.    ; Check CPU
  139.    (if (in #configcheckmask 0)
  140.       (
  141.          (if (not (patmatch #cpu (database "cpu")))
  142.             (
  143.                (set #config_ok 0)
  144.             )
  145.          ); if
  146.       )
  147.    ); if
  148.  
  149.    ; Check OS version
  150.    (if (in #configcheckmask 1)
  151.       (
  152.          (p_EncodeVersion #os_ver #os_rev)
  153.          (if (< #version (getversion))
  154.             (set #config_ok 0)
  155.          ); if
  156.       )
  157.    ); if
  158.  
  159.    ; Check diskspace
  160.    (if (in #configcheckmask 2)
  161.       (
  162.          (set #availdspace (getdiskspace @default-dest))
  163.          ; Information not available
  164.          (if (not (< #availdspace 0))
  165.             ; Not enough room
  166.             (if (< #availdspace #appsize)
  167.                (set #config_ok 0)
  168.             ); if
  169.          ); if
  170.       )
  171.    ); if
  172.  
  173. ); p_CheckConfiguration
  174.  
  175. ;-----------------------------------------------------------------------------
  176. ; TITLE        : p_GetDestination
  177. ; VERSION      : 0.10
  178. ; DATE         : 30.08.1998
  179. ; DESCRIPTION  : Get destination directory
  180. ; INPUT        : -
  181. ; OUTPUT       : @default-dest
  182. ;-----------------------------------------------------------------------------
  183. ; MODIFICATIONS: -
  184. ;-----------------------------------------------------------------------------
  185. (procedure p_GetDestination #d1string #d2string #d3string
  186.  
  187.    (set @default-dest
  188.       (askdir
  189.          (prompt #d1string)
  190.          (help #d2string)
  191.          (default #d3string)
  192.          (disk)
  193.       ); askdir
  194.    )
  195. ); p_GetDestination
  196.  
  197. ;-----------------------------------------------------------------------------
  198. ; TITLE        : p_CopyFiles
  199. ; VERSION      : 0.10
  200. ; DATE         : 30.08.1998
  201. ; DESCRIPTION  : Copy files
  202. ; INPUT        : -
  203. ; OUTPUT       : -
  204. ;-----------------------------------------------------------------------------
  205. ; MODIFICATIONS: -
  206. ;-----------------------------------------------------------------------------
  207. (procedure p_CopyFiles #c1string #c2string #c3string #c4string
  208.  
  209.    (copyfiles
  210.       (prompt #c1string)
  211.       (help #c2string)
  212.       (source #c3string)
  213.       (dest @default-dest)
  214.       (pattern #c4string)
  215.       (optional "force")
  216.    ); copyfiles
  217.  
  218. ); p_CopyFiles
  219.  
  220. ;-----------------------------------------------------------------------------
  221. ; MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN
  222. ;-----------------------------------------------------------------------------
  223. ; Welcome message
  224. (welcome #string2)
  225.  
  226. ; Check Installer version
  227. (p_EncodeVersion #installer_ver #installer_rev)
  228. (if (< @installer-version #version)
  229.    (
  230.       (exit #string1 (quiet))
  231.    )
  232. ); if
  233.  
  234. ; Ask options
  235. (set #installoptions
  236.    (askoptions
  237.       (prompt #string5)
  238.       (help #string50)
  239.       (choices #string51 #string52)
  240.       (default %11)
  241.    ); askoptions
  242. )
  243.  
  244. ; First option (#string51)
  245. (if (in #installoptions 0)
  246.    (
  247.       ; Get destination directory
  248.       (p_GetDestination #string60 #string61 #string62)
  249.  
  250.       ; Check configuration
  251.       (p_CheckConfiguration)
  252.       (if (< #config_ok 1)
  253.          (exit #string4 (quiet))
  254.       ); if
  255.  
  256.       ; Copy files
  257.       (p_CopyFiles #string70 #string71 #string72 #string73)
  258.    )
  259. ); if
  260.  
  261. ; Second option (#string52)
  262. (if (in #installoptions 1)
  263.    (
  264.       ; Get destination directory
  265.       (p_GetDestination #string63 #string64 #string65)
  266.  
  267.       ; Check configuration
  268.       (p_CheckConfiguration)
  269.       (if (< #config_ok 1)
  270.          (exit #string4 (quiet))
  271.       ); if
  272.  
  273.       ; Copy files
  274.       (p_CopyFiles #string74 #string75 #string76 #string77)
  275.    )
  276. ); if
  277.  
  278. ; All done
  279. (exit #string3 (quiet))
  280.