home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / TextEditors&Viewers / Ced / CYGNUSED3,5.DMS / in.adf / Install-CED < prev    next >
Encoding:
Text File  |  1993-07-07  |  26.5 KB  |  1,051 lines

  1. ; ************************************************
  2. ; *
  3. ; * $VER: Install-CED v3.5.0 (02.07.93)
  4. ; *
  5. ; * This is the installation script for CygnusSoft's/ASDG's CygnusEd Professional 3.5
  6. ; *
  7. ; * Copyright © 1989-1993 CygnusSoft Software and ASDG, Incorporated  All Rights Reserved
  8. ; *
  9. ; ************************************************
  10.  
  11.  
  12. ; ****************************
  13. ; * Set up some global variables.
  14. ; ****************************
  15. ;
  16. (set ProductName        "CygnusEd Professional")    ; product name
  17. (set ProductBaseName        "CED")                ; product base name
  18. (set ActivatorName        "ED")                ; product activator name
  19. (set VersionNum            "3.5")                ; product version number
  20.  
  21. (set OSVersion            (/ (getversion) 65536))
  22. (set WBVersion            (/ (getversion "version.library" (resident)) 65536))
  23. (set TotalFiles            0)
  24. (set AccumFiles            0)
  25. (set PctDone            0)
  26. (set DisplayReadMe        0)
  27.  
  28. (set Disk1Name            "CygnusED")            ; actual name of disk 1
  29.  
  30. (set DiskInstall        Disk1Name)            ; installation (main) disk
  31. (set DiskCED            Disk1Name)            ; CED/ED program disk
  32. (set DiskMetaMac        Disk1Name)            ; MetaMac program disk
  33. (set DiskRecoverCEDFiles    Disk1Name)            ; RecoverCEDFiles program disk
  34. (set DiskENV            Disk1Name)            ; ENV:CED default files
  35. (set DiskCEDScripts        Disk1Name)            ; CED ARexx scripts disk
  36. (set DiskCatalogs        Disk1Name)            ; Locale catalogs disk
  37.  
  38.  
  39.  
  40.  
  41. (procedure setPkgOpts
  42. ;
  43. ; ****************************
  44. ; * Ask the user which parts of the package should be installed.
  45. ; ****************************
  46. ;
  47.     (
  48.     (set PkgOpts
  49.         (askoptions
  50.             (prompt
  51.                 ("Select the parts of the %s package you want to install " ProductName)
  52.                 "at this time."
  53.             )
  54.             (help
  55.                 "This part of the installation procedure lets you select the "
  56.                 ("parts of the %s package you want to install at this time.\n" ProductName)
  57.                 "\n"
  58.                 ("*** %s (%s and %s)\n" ProductName ProductBaseName ActivatorName)
  59.                 ("This option lets you install the main programs, %s and " ProductBaseName)
  60.                 ("%s (the %s Activator).\n" ActivatorName ProductBaseName)
  61.                 "\n"
  62.                 ("*** MetaMac (The %s Macro Editor)\n" ProductBaseName)
  63.                 ("This option lets you install the macro editor for %s.  " ProductBaseName)
  64.                 "If you have macro definitions which you would like to examine "
  65.                 ("or modify from outside of %s, then you should install this program.\n" ProductBaseName)
  66.                 "\n"
  67.                 "*** RecoverCEDFiles\n"
  68.                 "This option lets you install the utility which can recover text "
  69.                 ("files that you might have been working on in %s at the time of a " ProductBaseName)
  70.                 "system crash.  This is a very useful utility which you should "
  71.                 "install.\n"
  72.                 "\n"
  73.                 "*** ARexx Scripts\n"
  74.                 "This option lets you install some ARexx scripts for "
  75.                 ("%s. These may come in handy if you " ProductBaseName)
  76.                 "plan to control the programs through ARexx.\n"
  77.                 "\n"
  78.                 "*** ReadMe\n"
  79.                 "This option lets you install the ReadMe file from disk 1 "
  80.                 "onto your floppy or hard disk to use as a reference.\n"
  81.                 "\n"
  82.                 @askoptions-help
  83.             )
  84.             (choices
  85.                 ; bit position 0 -- todo & 1
  86.                 ;
  87.                 ("%s (%s and %s)" ProductName ProductBaseName ActivatorName)
  88.  
  89.                 ; bit position 1 -- todo & 2
  90.                 ;
  91.                 ("MetaMac (The %s Macro Editor)" ProductBaseName)
  92.  
  93.                 ; bit position 2 -- todo & 4
  94.                 ;
  95.                 "RecoverCEDFiles"
  96.  
  97.                 ; bit position 3 -- todo & 8
  98.                 ;
  99.                 "ARexx Scripts"
  100.  
  101.                 ; bit position 4 -- todo & 16
  102.                 ;
  103.                 "ReadMe"
  104.             )
  105.         )
  106.     )
  107.     )
  108. )
  109.  
  110.  
  111. (procedure setDirPath
  112. ;
  113. ; ****************************
  114. ; * Ask the user for a directory name.
  115. ; ****************************
  116. ;
  117. ; these variables must be defined before calling this procedure:
  118. ;    setDirPathWhy
  119. ;    setDirPathHelp
  120. ;    DirPath
  121. ;
  122. ; this procedure returns the selected directory in DirPath
  123. ;
  124.     (
  125.     (set moveon    FALSE)
  126.     (while (NOT moveon)
  127.         (
  128.         (set DirPath
  129.             (askdir
  130.                 (prompt    ("Please select the directory %s" setDirPathWhy)
  131.                 )
  132.                 (help    setDirPathHelp
  133.                     "\n"
  134.                     @askdir-help
  135.                 )
  136.                 (default DirPath)
  137.             )
  138.         )
  139.  
  140.         (if (= (exists DirPath) 0)
  141.             (makedir DirPath)
  142.             (set moveon    TRUE)
  143.         )
  144.         )
  145.     )
  146.     )
  147. )
  148.  
  149.  
  150. (procedure copyLibFile
  151. ;
  152. ; ****************************
  153. ; * Copy the specific library file to the LIBS: directory.
  154. ; ****************************
  155. ;
  156. ; these variables must be defined before calling this procedure:
  157. ;
  158. ;    copyLibFileName
  159. ;    copyLibFileHelp
  160. ;    DirPath
  161. ;
  162.     (
  163.     (if (= (exists (tackon DirPath copyLibFileName)) 1)
  164.         (
  165.         (protect (tackon DirPath copyLibFileName) "+rwed")
  166.         )
  167.     )
  168.     (copylib
  169.         (prompt    ("Copying %s to %s" copyLibFileName DirPath))
  170.         (help    copyLibFileHelp
  171.             "\n"
  172.             "If you already have a copy of this library in the selected destination directory, the library "
  173.             "included on the distribution disk will be compared to the one you "
  174.             "already have. If your current library is an old version, the newer "
  175.             "version will be installed.\n"
  176.             "\n"
  177.             @copylib-help
  178.         )
  179.         (source copyLibFileName)
  180.         (dest DirPath)
  181.         (confirm)
  182.     )
  183.     )
  184. )
  185.  
  186.  
  187. (procedure deleteIfExists
  188. ;
  189. ; ****************************
  190. ; * Delete the given file, if it exists.
  191. ; ****************************
  192. ;
  193. ; these variables must be defined before calling this procedure:
  194. ;
  195. ;    deleteFileName
  196. ;
  197.     (
  198.     (if (= (exists deleteFileName) 1)
  199.         (
  200.         (protect deleteFileName "+rwed")
  201.         (delete deleteFileName)
  202.         )
  203.     )
  204.     )
  205. )
  206.  
  207.  
  208. (procedure renameIfExists
  209. ;
  210. ; ****************************
  211. ; * Rename the given file, if it exists.
  212. ; ****************************
  213. ;
  214. ; these variables must be defined before calling this procedure:
  215. ;
  216. ;    origFileName
  217. ;    renameFileName
  218. ;
  219.     (
  220.     (if (= (exists origFileName) 1)
  221.         (
  222.         (protect origFileName "+rwed")
  223.         (rename origFileName deleteFileName)
  224.         )
  225.     )
  226.     )
  227. )
  228.  
  229.  
  230. (procedure incrementMeter
  231. ;
  232. ; ****************************
  233. ; * Increment the progress meter indicator.
  234. ; ****************************
  235. ;
  236. ;    addToMeter
  237. ;
  238.     (
  239.     (set PctDone    (/ (* AccumFiles 100) TotalFiles))
  240.     (set AccumFiles    (+ AccumFiles addToMeter))
  241.     (complete PctDone)
  242.     )
  243. )
  244.  
  245.  
  246. ; ****************************
  247. ; * Remove old CED files routine
  248. ; ****************************
  249. ;
  250. (procedure removeOldCEDFiles
  251.     (
  252.     ; Look in SYS:Utilities...
  253.     ;
  254.     (set deleteFileName    "SYS:Utilities/CED")
  255.     (deleteIfExists)
  256.     (set deleteFileName    "SYS:Utilities/CED.info")
  257.     (deleteIfExists)
  258.     (set deleteFileName    "SYS:Utilities/ED")
  259.     (deleteIfExists)
  260.     (set deleteFileName    "SYS:Utilities/ED.info")
  261.     (deleteIfExists)
  262.     (set deleteFileName    "SYS:Utilities/RecoverCEDFiles")
  263.     (deleteIfExists)
  264.     (set deleteFileName    "SYS:Utilities/RecoverCEDFiles.info")
  265.     (deleteIfExists)
  266.  
  267.     ; Look in SYS:System...
  268.     ;
  269.     (set deleteFileName    "SYS:System/CED")
  270.     (deleteIfExists)
  271.     (set deleteFileName    "SYS:System/CED.info")
  272.     (deleteIfExists)
  273.     (set deleteFileName    "SYS:System/ED")
  274.     (deleteIfExists)
  275.     (set deleteFileName    "SYS:System/ED.info")
  276.     (deleteIfExists)
  277.     (set deleteFileName    "SYS:System/RecoverCEDFiles")
  278.     (deleteIfExists)
  279.     (set deleteFileName    "SYS:System/RecoverCEDFiles.info")
  280.     (deleteIfExists)
  281.  
  282.     ; Look in C:...
  283.     ;
  284.     (set deleteFileName    "C:CED")
  285.     (deleteIfExists)
  286.     (set deleteFileName    "C:CED.info")
  287.     (deleteIfExists)
  288.     ;
  289.     ; We will let the CEDInstall procedure handle the deletion of the ED program.
  290.     ;
  291.     ; (set deleteFileName    "C:ED")
  292.     ; (deleteIfExists)
  293.     ; (set deleteFileName    "C:ED.info")
  294.     ; (deleteIfExists)
  295.     (set deleteFileName    "C:RecoverCEDFiles")
  296.     (deleteIfExists)
  297.     (set deleteFileName    "C:RecoverCEDFiles.info")
  298.     (deleteIfExists)
  299.     )
  300. )
  301.  
  302.  
  303. ; ****************************
  304. ; * CED Installation routine
  305. ; ****************************
  306. ;
  307. (procedure CEDInstall
  308.     (
  309.     ; ****************************
  310.     ; * Install the Program
  311.     ; ****************************
  312.     ;
  313.     (makeassign "CEDINSTALL" CEDDir)
  314.  
  315.     (set addToMeter    2)
  316.     (incrementMeter)
  317.  
  318.     (set deleteFileName    (tackon "CEDINSTALL:" "CED"))
  319.     (deleteIfExists)
  320.     (copyfiles
  321.         (prompt    ("Installing %s..." ProductBaseName))
  322.         (help    "")
  323.         (source    ("%s:%s/%s" DiskInstall ProductBaseName ProductBaseName))
  324.         (dest    "CEDINSTALL:")
  325.     )
  326.  
  327.     (set deleteFileName    (tackon "CEDINSTALL:" "CED.info"))
  328.     (deleteIfExists)
  329.     (if (>= OSVersion 36)
  330.         (set ProductIconVer    "2.0")
  331.         (set ProductIconVer    "1.3")
  332.     )
  333.     (copyfiles
  334.         (prompt    "")
  335.         (help    "")
  336.         (source    ("%s:%s/%s%s.info" DiskInstall ProductBaseName ProductBaseName  ProductIconVer))
  337.         (dest    "CEDINSTALL:")
  338.     )
  339.     (rename ("CEDINSTALL:%s%s.info" ProductBaseName ProductIconVer) ("CEDINSTALL:%s.info" ProductBaseName))
  340.  
  341.  
  342.     ; ****************************
  343.     ; * Install the Activator
  344.     ; ****************************
  345.     ;
  346.     (set addToMeter    2)
  347.     (incrementMeter)
  348.  
  349.     (if (= 1 (exists "C:ED"))
  350.         (if (AND (= 1 removeOldED) (AND (= 1 backupOldED) (= (expandpath "C:") (expandpath "CEDINSTALL:"))))
  351.             (
  352.             ; This is a simple (dumb) check.  Basically, we check the
  353.             ; file size of the currently installed 'Ed'.  If it is
  354.             ; greater than 10,000 bytes, we can assume it is Commodore's
  355.             ; 'Ed' program.  Otherwise, we will assume it is an old
  356.             ; copy of CygnusEd's ED activator program.
  357.             ;
  358.             (if (> (getsize "C:Ed") 10000)
  359.                 (
  360.                 ; rename the Commodore Ed program to Ed.CBM
  361.                 ;
  362.                 (set origFileName "C:Ed")
  363.                 (set renameFileName "C:Ed.CBM")
  364.                 (renameIfExists)
  365.                 )
  366.                 (
  367.                 ; delete the old CygnusEd ED program
  368.                 ;
  369.                 (set deleteFileName    (tackon "CEDINSTALL:" "ED"))
  370.                 (deleteIfExists)
  371.                 (set deleteFileName    (tackon "CEDINSTALL:" "ED.info"))
  372.                 (deleteIfExists)
  373.                 )
  374.             )
  375.             )
  376.         )
  377.     )
  378.  
  379.     (copyfiles
  380.         (prompt    ("Installing %s..." ActivatorName))
  381.         (help    "")
  382.         (source    ("%s:%s/%s" DiskInstall ProductBaseName ActivatorName))
  383.         (dest    "CEDINSTALL:")
  384.     )
  385.  
  386.     (set deleteFileName    (tackon "CEDINSTALL:" "ED.info"))
  387.     (deleteIfExists)
  388.     (if (>= OSVersion 36)
  389.         (set ProductIconVer    "2.0")
  390.         (set ProductIconVer    "1.3")
  391.     )
  392.     (copyfiles
  393.         (prompt    "")
  394.         (help    "")
  395.         (source    ("%s:%s/%s%s.info" DiskInstall ProductBaseName ActivatorName ProductIconVer))
  396.         (dest    "CEDINSTALL:")
  397.     )
  398.     (rename ("CEDINSTALL:%s%s.info" ActivatorName ProductIconVer) ("CEDINSTALL:%s.info" ActivatorName))
  399.  
  400.  
  401.     ; ****************************
  402.     ; * Install the default icon, in both ENVARC: and ENV:
  403.     ; ****************************
  404.     ;
  405.     (if (<> (getassign "ENVARC" "a") "")
  406.         (
  407.         (set ENVCEDDir    ("ENVARC:%s" ProductBaseName))
  408.         (onerror
  409.             (abort    ("The %s directory could not be created. " ENVCEDDir)
  410.                 "This might be because your destination disk or drawer "
  411.                 "has no room or is write protected.  This installation "
  412.                 "cannot continue."
  413.             )
  414.         )
  415.         (if (= (exists ENVCEDDir) 0)
  416.             (makedir ENVCEDDir)
  417.         )
  418.         (onerror
  419.             (cleanUp)
  420.         )
  421.  
  422.         (makeassign "CEDINSTALL" ENVCEDDir)
  423.  
  424.         (set addToMeter    1)                ; ENVARC:CED default file
  425.         (incrementMeter)
  426.  
  427.         (copyfiles
  428.             (prompt    ("Installing ENVARC:%s default icon..." ProductBaseName))
  429.             (help    "")
  430.             (source    ("%s:%s/def_CEDFile.info" DiskENV ProductBaseName))
  431.             (dest    "CEDINSTALL:")
  432.             (infos)
  433.         )
  434.         )
  435.     )
  436.  
  437.     (if (<> (getassign "ENV" "a") "")
  438.         (
  439.         (set ENVCEDDir    ("ENV:%s" ProductBaseName))
  440.         (onerror
  441.             (abort    ("The %s directory could not be created. " ENVCEDDir)
  442.                 "This might be because your destination disk or drawer "
  443.                 "has no room or is write protected.  This installation "
  444.                 "cannot continue."
  445.             )
  446.         )
  447.         (if (= (exists ENVCEDDir) 0)
  448.             (makedir ENVCEDDir)
  449.         )
  450.         (onerror
  451.             (cleanUp)
  452.         )
  453.  
  454.         (makeassign "CEDINSTALL" ENVCEDDir)
  455.  
  456.         (set addToMeter    1)                ; ENV:CED default file
  457.         (incrementMeter)
  458.  
  459.         (copyfiles
  460.             (prompt    ("Installing ENV:%s default icon..." ProductBaseName))
  461.             (help    "")
  462.             (source    ("%s:%s/def_CEDFile.info" DiskENV ProductBaseName))
  463.             (dest    "CEDINSTALL:")
  464.             (infos)
  465.         )
  466.         )
  467.     )
  468.     )
  469. )
  470.  
  471.  
  472. ; ****************************
  473. ; * MetaMac Installation routine
  474. ; ****************************
  475. ;
  476. (procedure MetaMacInstall
  477.     (
  478.     (makeassign "CEDINSTALL" MetaMacDir)
  479.  
  480.     (set addToMeter    2)                    ; 1 program + 1 icon
  481.     (incrementMeter)
  482.  
  483.     (set deleteFileName    (tackon "CEDINSTALL:" "MetaMac"))
  484.     (deleteIfExists)
  485.     (copyfiles
  486.         (prompt    "Installing MetaMac utility...")
  487.         (help    "")
  488.         (source    ("%s:%s/MetaMac" DiskMetaMac ProductBaseName))
  489.         (dest    "CEDINSTALL:")
  490.     )
  491.  
  492.     (set deleteFileName    (tackon "CEDINSTALL:" "MetaMac.info"))
  493.     (deleteIfExists)
  494.     (if (>= OSVersion 36)
  495.         (set ProductIconVer    "2.0")
  496.         (set ProductIconVer    "1.3")
  497.     )
  498.     (copyfiles
  499.         (prompt    "")
  500.         (help    "")
  501.         (source    ("%s:%s/MetaMac%s.info" DiskMetaMac ProductBaseName ProductIconVer))
  502.         (dest    "CEDINSTALL:")
  503.     )
  504.     (rename ("CEDINSTALL:MetaMac%s.info" ProductIconVer) "CEDINSTALL:MetaMac.info")
  505.     )
  506. )
  507.  
  508.  
  509. ; ****************************
  510. ; * RecoverCEDFiles Installation routine
  511. ; ****************************
  512. ;
  513. (procedure RecoverCEDFilesInstall
  514.     (
  515.     (makeassign "CEDINSTALL" RecoverCEDFilesDir)
  516.  
  517.     (set addToMeter    2)                    ; 1 program + 1 icon
  518.     (incrementMeter)
  519.  
  520.     (set deleteFileName    (tackon "CEDINSTALL:" "RecoverCEDFiles"))
  521.     (deleteIfExists)
  522.     (copyfiles
  523.         (prompt    "Installing RecoverCEDFiles utility...")
  524.         (help    "")
  525.         (source    ("%s:%s/RecoverCEDFiles" DiskRecoverCEDFiles ProductBaseName))
  526.         (dest    "CEDINSTALL:")
  527.     )
  528.  
  529.     (set deleteFileName    (tackon "CEDINSTALL:" "RecoverCEDFiles.info"))
  530.     (deleteIfExists)
  531.     (if (>= OSVersion 36)
  532.         (set ProductIconVer    "2.0")
  533.         (set ProductIconVer    "1.3")
  534.     )
  535.     (copyfiles
  536.         (prompt    "")
  537.         (help    "")
  538.         (source    ("%s:%s/RecoverCEDFiles%s.info" DiskRecoverCEDFiles ProductBaseName ProductIconVer))
  539.         (dest    "CEDINSTALL:")
  540.     )
  541.     (rename ("CEDINSTALL:RecoverCEDFiles%s.info" ProductIconVer) "CEDINSTALL:RecoverCEDFiles.info")
  542.     )
  543. )
  544.  
  545.  
  546. ; ****************************
  547. ; * ARexxScript Installation routine
  548. ; ****************************
  549. ;
  550. (procedure ARexxScriptInstall
  551.     (
  552.     (makeassign "CEDINSTALL" CEDScriptDir)
  553.  
  554.     (set addToMeter    1)                    ; 1 operation
  555.     (incrementMeter)
  556.  
  557.     (copyfiles
  558.         (prompt    ("Installing %s ARexx Scripts..." ProductBaseName))
  559.         (help    "")
  560.         (source    ("%s:CEDScripts" DiskCEDScripts))
  561.         (dest    "CEDINSTALL:")
  562.         (all)
  563.     )
  564.     )
  565. )
  566.  
  567.  
  568. ; ****************************
  569. ; * ReadMe Installation routine
  570. ; ****************************
  571. ;
  572. (procedure ReadMeInstall
  573.     (
  574.     (makeassign "CEDINSTALL" ReadMeDir)
  575.  
  576.     (set addToMeter    2)                    ; ReadMe + icon
  577.     (incrementMeter)
  578.  
  579.     (copyfiles
  580.         (prompt        "Installing ReadMe file...")
  581.         (help        "")
  582.         (source        ("%s:ReadMe" DiskInstall))
  583.         (dest        "CEDINSTALL:")
  584.         (newname    ("ReadMe_%s_%s" ProductBaseName VersionNum))
  585.         (infos)
  586.     )
  587.  
  588.     (if (= (exists ("CEDINSTALL:ReadMe_%s_%s.info" ProductBaseName VersionNum)) 1)
  589.         (
  590.         (if (>= OSVersion 39)
  591.             (set ReadMeTool        "MultiView")
  592.             (set ReadMeTool        "More")
  593.         )
  594.  
  595.         (tooltype
  596.             (prompt        "")
  597.             (help        "")
  598.             (dest        ("CEDINSTALL:ReadMe_%s_%s" ProductBaseName VersionNum))
  599.             (setdefaulttool    ReadMeTool)
  600.             (noposition)
  601.         )
  602.         )
  603.     )
  604.     )
  605. )
  606.  
  607.  
  608. ; ****************************
  609. ; * Locale Installation routine
  610. ; ****************************
  611. ;
  612. (procedure LocaleInstall
  613.     (
  614.     (set addToMeter    1)                ; 1 set of locale files
  615.     (incrementMeter)
  616.  
  617.     (if (= (getassign "LOCALE" "a") "")
  618.         (
  619.         ; no LOCALE: assigned -- we cannot continue
  620.         ;
  621.         (message
  622.             "\nYou do not seem to have LOCALE: assigned to the directory "
  623.             "where the localization files are stored.\n"
  624.             "\n"
  625.             "Please install the system software localization files before "
  626.             "retrying this installation.\n"
  627.             "\n\n"
  628.             "Press either the Proceed or Abort Install button to abort "
  629.             "this installation.\n")
  630.         (cleanUp)
  631.         )
  632.         (
  633.         ; LOCALE: was found
  634.         ;
  635.         (if (<> (exists "LOCALE:Catalogs") 2)
  636.             (
  637.             (makedir "LOCALE:Catalogs")
  638.             (if (<> (exists "LOCALE:Catalogs") 2)
  639.                 (
  640.                 (message
  641.                     "\nThe directory:\n\nLOCALE:Catalogs\n\n"
  642.                     "could not be created.  This installation "
  643.                     "requires this directory be present to "
  644.                     "install the selected locale support files.\n"
  645.                     "\n"
  646.                     "This installation cannot continue.\n")
  647.                 (cleanUp)
  648.                 )
  649.             )
  650.             )
  651.         )
  652.  
  653.         (set LanguageToDo    0)
  654.         (set LanguageMax    1)
  655.         (while (< LanguageToDo LanguageMax)
  656.             (
  657.             (set LanguageDesc (select LanguageToDo
  658.                     "Deutsch"
  659.                     ""))
  660.  
  661.             (if (IN LanguageID LanguageToDo)
  662.                 (
  663.                 (copyfiles
  664.                     (prompt    ("Installing %s catalogs..." LanguageDesc))
  665.                     (help    "")
  666.                     (source    ("%s:Catalogs/%s" DiskCatalogs LanguageDesc))
  667.                     (dest    ("LOCALE:Catalogs/%s" LanguageDesc))
  668.                     (all)
  669.                 )
  670.                 )
  671.             )
  672.  
  673.             (set LanguageToDo    (+ LanguageToDo 1))
  674.             )
  675.         )
  676.         )
  677.     )
  678.     )
  679. )
  680.  
  681.  
  682. ; ****************************
  683. ; * General CleanUp routine
  684. ; ****************************
  685. ;
  686. (procedure cleanUp
  687.     (
  688.     ; ****************************
  689.     ; * remove temporary assignment
  690.     ; ****************************
  691.     ;
  692.     (makeassign "CEDINSTALL")
  693.  
  694.  
  695.     ; ****************************
  696.     ; * exit the program.
  697.     ; ****************************
  698.     ;
  699.  
  700.     (if (= DisplayReadMe 1)
  701.         (
  702.         (if (= serializeAfterInstall 1)
  703.             (
  704.             (message
  705.                 ("Once the Proceed button is pressed, %s will be run so that you may serialize it.\n" ProductName)
  706.                 "\n"
  707.                 ("This panel will stay up until %s is serialized or until it exits because of an error in serializing the program.\n" ProductName)
  708.                 "\n\n"
  709.                 ("Press the Proceed button to serialize %s, or Abort Install to exit before serialization can begin.\n" ProductName))
  710.             (execute ("RAM:startCED \"%s\"" CEDDir))
  711.             )
  712.         )
  713.  
  714.         (if (< OSVersion 37)
  715.             (run ("c:run %s:C/More %s:ReadMe" DiskInstall DiskInstall))
  716.             (if (>= OSVersion 39)
  717.                 (run ("run SYS:Utilities/MultiView %s:ReadMe" DiskInstall))
  718.                 (run ("run %s:C/More %s:ReadMe" DiskInstall DiskInstall))
  719.             )
  720.         )
  721.  
  722.         (set deleteFileName    "RAM:startCED")
  723.         (deleteIfExists)
  724.         )
  725.     )
  726.  
  727.     (complete 100)
  728.  
  729.     (if (= DisplayReadMe 1)
  730.         (exit)
  731.         (exit (quiet))
  732.     )
  733.     )
  734. )
  735.  
  736.  
  737. ; *************************************************************************
  738. ; *                         ACTUAL START OF SCRIPT
  739. ; *
  740. ; * Ask all questions for the user now, do all of the work later.
  741. ; *************************************************************************
  742. ;
  743.  
  744. (onerror
  745.     (cleanUp)
  746. )
  747.  
  748. ; ****************************
  749. ; * set the default destination to SYS:Utilities.
  750. ; ****************************
  751. ;
  752. (set @default-dest    "C:")
  753. (set defaultUtilDir    "SYS:Utilities")
  754. (set defaultScriptDir    "REXX:")
  755.  
  756. (setPkgOpts)
  757.  
  758.  
  759. ; ****************************
  760. ; * if (PkgOpts & 0) or (PkgOpts & 2), ask the user which locale files to install,
  761. ; * but don't actually do it yet.
  762. ; ****************************
  763. ;
  764. ;+++(message ("WB %ld / OS %ld" WBVersion OSVersion))
  765.  
  766. (if (AND (OR (IN PkgOpts 0) (IN PkgOpts 2)) (>= WBVersion 38))
  767.     (
  768.     (set LanguageID 0)                ; default language is 0 (English)
  769.  
  770.     (set TotalFiles        (+ TotalFiles 1))    ; 1 set of locale files
  771.  
  772.     (set LanguageID
  773.         (askoptions
  774.             (prompt    ("Besides English, select the preferred languages in which you might possibly run the %s programs." ProductName))
  775.             (help    "You should select all the possible languages you want menu and requester text to be displayed in.  "
  776.                 "At this time, the only alternative to English is Deutsch (i.e., German translation).\n"
  777.                 "\n"
  778.                 "*** Deutsch\n"
  779.                 "This should be selected if you want the German versions of menus and requester text.\n"
  780.                 "\n"
  781.                 @askchoice-help
  782.             )
  783.             (choices
  784.                 ; bit position 0 -- todo & 1
  785.                 ;
  786.                 "Deutsch"
  787.             )
  788.             (default LanguageID)
  789.         )
  790.     )
  791.     ;+++(message ("LanguageID = %ld" LanguageID))
  792.     )
  793.     (set LanguageID 0)
  794. )
  795.  
  796.  
  797. ; ****************************
  798. ; * if (PkgOpts & 0), ask the user where to install ProductBaseName
  799. ; * but don't actually do it yet.
  800. ; ****************************
  801. ;
  802. (if (IN PkgOpts 0)                        ; if bit position 0 is on
  803.     (
  804.     (set continueOn        0)
  805.     (set DirPath        @default-dest)
  806.     (while (<> continueOn 1)
  807.         (
  808.         (set setDirPathWhy    ("where you want to install %s (%s and %s programs)." ProductName ProductBaseName ActivatorName))
  809.         (set setDirPathHelp     "For Workbench users, you should place these programs in a directory that can be accessed from the Workbench screen.  For CLI/Shell users, you can place them in your C: directory (or any other directory in your search path).\n")
  810.         (set DirPath        DirPath)
  811.         (setDirPath)
  812.  
  813.         (if (= 1 (askbool
  814.                 (prompt    ("\n%s and %s (the %s Activator) will be installed in the following directory:\n\n%s\n\n\nIs this correct?" ProductBaseName ActivatorName ProductBaseName DirPath))
  815.                 (help    ("This panel displays what you have told the Installer is the directory where %s and %s will be installed. " ProductBaseName ActivatorName)
  816.                     "It is so that you know exactly where the files will be placed.\n"
  817.                     "\n"
  818.                     "To select a different directory, press the No button.  Otherwise, press the "
  819.                     "Yes button to proceed with the installation process.\n")))
  820.             (set continueOn        1)
  821.         )
  822.         )
  823.     )
  824.  
  825.     (set CEDDir        DirPath)
  826.     (set @default-dest    CEDDir)
  827.  
  828.     (set TotalFiles        (+ TotalFiles 2))        ; CED + icon
  829.     (set TotalFiles        (+ TotalFiles 2))        ; ED + icon
  830.     (set TotalFiles        (+ TotalFiles 1))        ; ENVARC:CED default file
  831.     (set TotalFiles        (+ TotalFiles 1))        ; ENV:CED default file
  832.  
  833.     (if (AND (= (expandpath "C:") (expandpath CEDDir)) (= 1 (exists "C:Ed")))
  834.         (if (= @user-level 2)
  835.             (
  836.             (set backupOldED (askbool
  837.                 (prompt    "\nDo you want to backup the \"ED\" program which is currently installed in your C: directory?")
  838.                 (help    ("The %s program that comes with the %s package has the same name as " ActivatorName ProductName)
  839.                     "Commodore's \"Ed\" editor.  To avoid overwriting this file, you can choose to rename it.\n"
  840.                     "\n"
  841.                     "The installation will try to determine if the old version is Commodore's \"Ed\" program "
  842.                     "(in which case it will be renamed to \"Ed.CBM\") or if it is an old copy of the "
  843.                     ("%s program that comes as part of the %s package (in which case it will be overwritten).\n" ActivatorName ProductName))))
  844.             )
  845.             (set backupOldED 1)
  846.         )
  847.     )
  848.  
  849.     (if (= @user-level 2)
  850.         (
  851.         (set serializeAfterInstall (askbool
  852.             (prompt        ("\n\nDo you want to serialize the %s program after installing it?" ProductName))
  853.             (help        ("The %s program needs to be serialized before it can be run.\n" ProductName)
  854.                     "\n"
  855.                     @askbool-help)
  856.             (default    1)))
  857.         )
  858.         (set serializeAfterInstall 1)
  859.     )
  860.  
  861.     (onerror
  862.         (cleanUp)
  863.     )
  864.     )
  865. )
  866.  
  867.  
  868. ; ****************************
  869. ; * if (PkgOpts & 1), ask the user where to install MetaMac,
  870. ; * but don't actually do it yet.
  871. ; ****************************
  872. ;
  873. (if (IN PkgOpts 1)                        ; if bit position 1 is on
  874.     (
  875.     (set setDirPathWhy    "where you want to install the MetaMac utility.")
  876.     (set setDirPathHelp    ("The MetaMac utility can either be installed in the same directory as %s, or where you normally keep your utility programs.\n" ProductBaseName))
  877.     (set DirPath        defaultUtilDir)
  878.     (setDirPath)
  879.     (set MetaMacDir        DirPath)
  880.     (set defaultUtilDir    DirPath)
  881.  
  882.     (set TotalFiles    (+ TotalFiles 2))            ; 1 program + 1 icon
  883.     )
  884. )
  885.  
  886.  
  887. ; ****************************
  888. ; * if (PkgOpts & 2), ask the user where to install RecoverCEDFiles,
  889. ; * but don't actually do it yet.
  890. ; ****************************
  891. ;
  892. (if (IN PkgOpts 2)                        ; if bit position 2 is on
  893.     (
  894.     (set setDirPathWhy    "where you want to install the RecoverCEDFiles utility.")
  895.     (set setDirPathHelp    ("The RecoverCEDFiles utility can either be installed in the same directory as %s, or where you normally keep your utility programs.\n" ProductBaseName))
  896.     (set DirPath        defaultUtilDir)
  897.     (setDirPath)
  898.     (set RecoverCEDFilesDir    DirPath)
  899.     (set defaultUtilDir    DirPath)
  900.  
  901.     (set TotalFiles    (+ TotalFiles 2))            ; 1 program + 1 icon
  902.     )
  903. )
  904.  
  905.  
  906. ; ****************************
  907. ; * if (PkgOpts & 3), ask the user where to install the ARexx scripts,
  908. ; * but don't actually do it yet.
  909. ; ****************************
  910. ;
  911. (if (IN PkgOpts 3)                        ; if bit position 3 is on
  912.     (
  913.     (set setDirPathWhy    ("where you want to install the %s ARexx scripts." ProductBaseName))
  914.     (set setDirPathHelp    ("You must select a directory into which the %s ARexx scripts will be installed.  We suggest REXX: so that the function and keypad key macros will be available to you.\n" ProductBaseName))
  915.     (set DirPath        defaultScriptDir)
  916.     (setDirPath)
  917.     (set CEDScriptDir    DirPath)
  918.     (set defaultScriptDir    DirPath)
  919.  
  920.     (set TotalFiles    (+ TotalFiles 1))            ; 1 operation
  921.     )
  922. )
  923.  
  924.  
  925. ; ****************************
  926. ; * if (PkgOpts & 4), ask the user where to install the package's ReadMe file
  927. ; * from disk 1.
  928. ; ****************************
  929. ;
  930. (if (IN PkgOpts 4)                        ; if bit position 4 is on
  931.     (
  932.     (set setDirPathWhy    "where you want to install the ReadMe file.")
  933.     (set setDirPathHelp    "Although the ReadMe file will be displayed at the end of the installation process, you should install it onto your floppy or hard disk for future reference.  There is a lot of important information in the ReadMe which for one reason or another was left out of the manual and addendum.\n")
  934.     (set DirPath        @default-dest)
  935.     (setDirPath)
  936.  
  937.     (set ReadMeDir        DirPath)
  938.  
  939.     (set TotalFiles (+ TotalFiles 2))            ; ReadMe + icon
  940.     )
  941. )
  942.  
  943.  
  944. (if (= 1 (askbool
  945.     (prompt    ("\nAre you upgrading from a previous version of %s?\n" ProductName))
  946.     (help    ("If you have an old version of %s installed in your system, select the \"Yes\" button.  Otherwise, select the \"No\" button.\n" ProductName))))
  947.     (
  948.     (set removeOldCED (askbool
  949.         (prompt    ("\nShould the old versions of the %s programs be removed before installing the new version?\n" ProductName))
  950.         (help    "This installation procedure will try to remove all old copies of the "
  951.             ("%s programs from your floppy or hard drive directories.  The " ProductName)
  952.             "purpose of this is to avoid any conflicts that may arise using "
  953.             ("different versions of the %s programs with each other.\n" ProductName))))
  954.     )
  955.     (
  956.     (set removeOldCED 0)
  957.     )
  958. )
  959.  
  960.  
  961. (if (< OSVersion 36)
  962.     (set TotalFiles (+ TotalFiles 4))            ; asl13.library, gadtools13.library, iffparse.library, req.library
  963. )
  964.  
  965.  
  966. (complete 0)
  967.  
  968. (message "\nShall I proceed with the installation?"
  969.     (help    "Once you press the Proceed button, the selected items will be installed. This is your last chance "
  970.         "to abort this procedure without partially installing the selected files.\n"
  971.         "\n"
  972.         "After you press Proceed, you can use the Esc key to abort the installation procedure.\n")
  973. )
  974.  
  975.  
  976. ; ****************************
  977. ; * copy the startCED script so that we don't need to do it later.
  978. ; ****************************
  979. ;
  980. (copyfiles
  981.     (prompt    "")
  982.     (help    "")
  983.     (source    ("%s:startCED" DiskInstall))
  984.     (dest    "RAM:")
  985. )
  986.  
  987.  
  988. (onerror
  989.     (cleanUp)
  990. )
  991.  
  992.  
  993. ; ****************************
  994. ; * copy the emulator libraries (asl13.library, gadtools13.library, iffparse.library)
  995. ; * and req.library to the LIBS: directory.
  996. ; ****************************
  997. ;
  998. (if (< OSVersion 36)
  999.     (
  1000.     (set addToMeter    3)
  1001.     (incrementMeter)
  1002.  
  1003.     (set copyLibFileName    ("%s:Libs/asl13.library" DiskInstall))
  1004.     (set copyLibFileHelp    ("This library is required to run many of the %s programs under AmigaOS 1.3.\n" ProductName))
  1005.     (set DirPath        "LIBS:")
  1006.     (copyLibFile)
  1007.  
  1008.     (set copyLibFileName    ("%s:Libs/gadtools13.library" DiskInstall))
  1009.     (set copyLibFileHelp    ("This library is required to run many of the %s programs under AmigaOS 1.3.\n" ProductName))
  1010.     (set DirPath        "LIBS:")
  1011.     (copyLibFile)
  1012.  
  1013.     (set copyLibFileName    ("%s:Libs/iffparse.library" DiskInstall))
  1014.     (set copyLibFileHelp    ("This library is required to run many of the %s programs under AmigaOS 1.3.\n" ProductName))
  1015.     (set DirPath        "LIBS:")
  1016.     (copyLibFile)
  1017.  
  1018.     (set copyLibFileName    ("%s:Libs/req.library" DiskInstall))
  1019.     (set copyLibFileHelp    ("This library is required to run many of the %s programs under AmigaOS 1.3.\n" ProductName))
  1020.     (set DirPath        "LIBS:")
  1021.     (copyLibFile)
  1022.     )
  1023. )
  1024.  
  1025. (if (= 1 removeOldCED)
  1026.     (removeOldCEDFiles)
  1027. )
  1028.  
  1029. (if (IN PkgOpts 0)
  1030.     (CEDInstall)
  1031. )
  1032. (if (IN PkgOpts 1)
  1033.     (MetaMacInstall)
  1034. )
  1035. (if (IN PkgOpts 2)
  1036.     (RecoverCEDFilesInstall)
  1037. )
  1038. (if (IN PkgOpts 3)
  1039.     (ARexxScriptInstall)
  1040. )
  1041. (if (IN PkgOpts 4)
  1042.     (ReadMeInstall)
  1043. )
  1044.  
  1045. (if (AND (AND (OR (IN PkgOpts 0) (IN PkgOpts 2)) (>= WBVersion 38)) (<> LanguageID 0))
  1046.     (LocaleInstall)
  1047. )
  1048.  
  1049. (set DisplayReadMe    1)
  1050. (cleanUp)
  1051.