home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Amiga / Workbench / Archivers / ViewDIZ.lha / ViewDIZ / Install < prev    next >
Text File  |  1998-03-02  |  11KB  |  326 lines

  1. ;************************************
  2. ;                            
  3. ; $VER: ViewDIZ-Install 2.0
  4. ; $TAB:    8
  5. ; $AUTHOR: ⌐1997,1998 By Mikael Lund
  6. ;
  7. ;************************************
  8.  
  9. (message
  10.     "\nW E L C O M E   T O   V I E W D I Z   2 . 0\n\n"
  11.     "This installation utility will check everything needed to use ViewDIZ. "
  12.     "At all times you can use the help-buttons to recieve additional "
  13.     "information about the current installation part.\n\n"
  14.     "ViewDIZ is absolutely FREEWARE which means that you may use it "
  15.     "as much as you like - no restrictions, no money to be paid.  If, however, "
  16.     "you use it a lot - please consider sending a letter/e-mail to the Author."
  17. )
  18.  
  19.  
  20.  
  21. (if (< (/ (getversion) 65536) 37) (abort @app-name" only runs under Kickstart 2.04 or above!"))
  22. (if (< (/ (getversion) 65536) 39) (message "\n"@app-name" should run under Kickstart 2.04 - It have only been tested on Kickstart 3.0, though.\n\nIf you encounter any problems please mail me."))
  23. (if (not (exists "T:"        (noreq))) (abort "\nYou MUST have a T: assign - Reinstall Workbench!"))
  24. (if (not (exists "ENV:"        (noreq))) (abort "\nYou MUST have an ENV: assign - Reinstall Workbench!"))
  25. (if (not (exists "ENVARC:"    (noreq))) (abort "\nYou MUST have an ENVARC: assign - Reinstall Workbench!"))
  26. (if (not (exists "FONTS:"    (noreq))) (abort "\nYou MUST have a FONTS: assign - Reinstall Workbench!"))
  27. (if (not (exists "LIBS:"    (noreq))) (abort "\nYou MUST have a LIBS: assign - Reinstall Workbench!"))
  28. (if (not (exists "C:Version"    (noreq))) (abort "\nYou MUST have C:Version - Reinstall Workbench!"))
  29. (if (not (exists "Libs:Locale.library"        (noreq))) (abort "\nYou MUST have the Locale.library -  Reinstall Workbench !"))
  30. (if (not (exists "Libs:Rexxsupport.library"    (noreq))) (abort "\nYou MUST have the Rexxsupport.library - Reinstall Workbench or your Rexx-package!"))
  31. (if (not (exists "Libs:Reqtools.library"    (noreq))) (abort "\nYou MUST have the Reqtools.library - Get the recent version from Aminet:\n\nutil/libs/reqtoolusr.lha"))
  32.  
  33. (if (exists "libs/rexxdossupport.library")
  34.     (copylib
  35.         (source "libs/rexxdossupport.library")
  36.         (dest "libs:")
  37.     )
  38. )
  39. (if (exists "libs/rexxreqtools.library")
  40.     (copylib
  41.         (source "libs/rexxreqtools.library")
  42.         (dest "libs:")
  43.     )
  44. )
  45. ;**********************************
  46. ;
  47. ; Is the Rexx server running ?
  48. ;
  49. ;**********************************
  50. (working "\nChecking if you have got an ARexx server running\n(This might take some time)\n")
  51. (execute "c/Rexx?")
  52.  
  53. (if (not (exists "ENV:vd.temp"))
  54.     (
  55.         (run "sys:system/rexxmast")
  56.         (message    "\nYour ARexx server doesn't seem to be active.\n\n"
  57.                 "If you are sure you have one active, then just ignore this message and continue!\n"
  58.         )
  59.     )
  60.     (delete "ENV:vd.temp")
  61. )
  62. ;**********************************
  63. ;
  64. ; Install the special ANSI font.
  65. ;
  66. ;**********************************
  67. (if (not (exists "fonts:jetterm/"))
  68.     (copyfiles
  69.     (source "fonts/")
  70.     (dest "fonts:")
  71.     (pattern "#?")
  72.     )
  73. )
  74. ;**********************************
  75. ;
  76. ; Copying ViewDIZ + commands
  77. ;
  78. ;**********************************
  79. (set @default-dest "C:")
  80. (copyfiles
  81.     (source "C/ViewDIZ")
  82.     (dest "C:")
  83. )
  84. (set #bin
  85.     (askoptions
  86.         (prompt "\nWhich external programs should be installed ?\n(Press the help-button for details)\n")
  87.         (help    "To use ViewDIZ you will need some additional programs depending on which filetypes you wish to process.\n\n"
  88.             "╖ Copy2Clip is required for the CLIP-option.\n"
  89.             "╖ DMSdescript is required for DMS-processing.\n"
  90.             "╖ MagicDIZ is required for IFF/GIF/JPG-processing.\n"
  91.             "╖ xDIZ is required for XPK-processing.\n"
  92.             "╖ Textract is required for TXT/NFO-processing.\n"
  93.             "╖ ModuleDescript is for unpacked MOD/MED modules.\n\n"
  94.             "Not all required programs is included in this package - below is a list of other program you will need to process other filetypes:\n\n"
  95.             "╖ LHA,LZX,ZIP,UNZIP are required for Lha, LZx and ZIP archives.\n"
  96.             "╖ DMS is required if you want to unpack a DMS-files to a disk.\n"
  97.             "╖ XFDdecrunch is required for unpacking packed datafiles.\n"
  98.             "╖ UnARJ_FID is required for extracting File_ID.DIZ from ARJ files.\n\n"
  99.             "The files will be copied to C: - You may move them to another destination as long as this is in the command path."
  100.         )
  101.         (choices    "MagicDIZ 2.06"
  102.                 "DMSdescript 1.1"
  103.                 "Textract 1.0"
  104.                 "Copy2Clip 1.0"
  105.                 "xDiz 1.5"
  106.                 "ModuleDescript 1.0"
  107.         )
  108.         (default %111111)
  109.     )
  110. )
  111. (if (IN #bin 0)    (copylib    (dest "c:")    (source "c/MagicDIZ")))
  112. (if (IN #bin 1)    (copyfiles    (dest "c:")    (source "c/DMSdescript")))
  113. (if (IN #bin 2)    (copylib    (dest "c:")    (source "c/Textract")))
  114. (if (IN #bin 3)    (copylib    (dest "c:")    (source "c/Copy2Clip")))
  115. (if (IN #bin 4)    (copyfiles    (dest "c:")    (source "c/xDiz")))
  116. (if (IN #bin 5)    (copyfiles    (dest "c:")    (source "c/ModuleDescript")))
  117.  
  118. ;**********************************
  119. ;
  120. ; Copy Documentation.
  121. ;
  122. ;**********************************
  123. (if (exists "HELP:" (noreq))
  124.     (set #docdest "HELP:")
  125.     (set #docdest "S:")
  126. )
  127. (copyfiles (dest #docdest) (source "ViewDIZ.Guide"))
  128.  
  129. ;************************************
  130. ;
  131. ; Install Directory Opus 5+ buttons.
  132. ;
  133. ;************************************
  134.  
  135. (if (exists "Dopus5:" (noreq))
  136.     (copyfiles
  137.         (source "Dopus5/")
  138.         (dest "Dopus5:")
  139.         (pattern "#?")
  140.     )
  141. )
  142.  
  143. ;**********************************
  144. ;
  145. ; Copy the right locale file.
  146. ;
  147. ;**********************************
  148. (set    #lan1 "dansk"
  149.     #lan2 "svenska"
  150.     #lan3 "italiano"
  151.     #lan4 "polski"
  152.     #lan5 "deutsch"
  153.     #lan6 "nederlands"
  154.     #lan7 "magyar"
  155.     #def 0
  156. )
  157. (if (= @language #lan1)    (set #def 1))
  158. (if (= @language #lan2)    (set #def 2))
  159. (if (= @language #lan3)    (set #def 3))
  160. (if (= @language #lan4)    (set #def 4))
  161. (if (= @language #lan5)    (set #def 5))
  162. (if (= @language #lan6)    (set #def 6))
  163. (if (= @language #lan7)    (set #def 7))
  164.  
  165. (set #n    (askchoice
  166.         (prompt "\nWhich language would you like to use ?\n")
  167.         (help "ViewDIZ are localised which mean that you can use virtually any language.\n\nThis package includes material to localize ViewDIZ into your language if it's not listed - If you have got the spirit for it, you are welcome to do the translation - See documentation for details.\n\nNOTE: To use languages other than english, SYS:Prefs/Locale tool must be set with this language.")
  168.         (default #def)
  169.         (choices    "english (built in)"
  170.                 #lan1
  171.                 #lan2
  172.                 #lan3
  173.                 #lan4
  174.                 #lan5
  175.                 #lan6
  176.                 #lan7
  177.         )
  178.     )
  179. )
  180. (set #lang (select #n "" #lan1 #lan2 #lan3 #lan4 #lan5 #lan6 #lan7))
  181. (if (<> #lang "")
  182.     (copyfiles (dest (cat "Locale:Catalogs/" #lang)) (source (cat "Catalogs/" #lang "/ViewDIZ.catalog")))
  183. )
  184.  
  185. (copyfiles
  186.     (source "Catalogs/ViewDIZ.cd")
  187.     (dest "Locale:Catalogs")
  188. )
  189.  
  190. ;**********************************
  191. ;
  192. ; Configuration Part.
  193. ; Shortcut to executable header &
  194. ; the filesubstitution, "{f}"
  195. ;
  196. ;**********************************
  197.  
  198. (message "\nThe following section will configure ViewDIZ after your personal needs. From v2.0+ a brand new configuration system is used - if you have got an older version or none at all, you MUST run this section.\n\n"
  199.          "WARNING: Existing files will be overwritten!\n")
  200.  
  201. (set    #header    ".key f/a\n.bra {\n.ket }\n"
  202.     #f    "\"{f}\""
  203. )
  204.  
  205. (if (not (exists "ENV:ViewDIZ/"))
  206.     (makedir "ENV:ViewDIZ")
  207. )
  208.  
  209. ;**********************************
  210. ;
  211. ; Customize text editor
  212. ;
  213. ;**********************************
  214.  
  215. (set #precmd "")
  216. (set #bin
  217.    (askchoice
  218.     (prompt "\nWhat is your favourite texteditor ?\n")
  219.     (help "ViewDIZ lets you chose which texteditor to be used when editing File_ID.DIZ descriptions. If you have installed the CygnusED Prog. package you should use 'CygnusED'. If you are in doubt which editor to use, then just select the Workbench Editor.\n\nNOTE: If you chose 'other' make sure that the texteditor doesn't detatch itself from CLI!")
  220.     (choices "Workbench Editor (C:Ed)"
  221.          "CygnusED 3.5+"
  222.          "Other"
  223.     )
  224.     )
  225. )
  226. (if (= #bin 0)
  227.     (    (set #edfile "C:Ed" #options (cat #f " Window=CON:75/50/376/130/ViewDIZ-Editor/NOSIZE"))
  228.     (if (< (getsize #edfile) 10000)
  229.         (Message "\nYour C:Ed file seems a bit short! Are you sure it is the original Workbench Editor ?\n\nIf you are 110% then just forget this message and go ahead!\n")
  230.     )
  231.     )
  232. )
  233.  
  234. (if (= #bin 1)
  235.     (
  236.         ( set #precmd "Stack 8000 >NIL:\n" )
  237.         ( set #options ( cat #f " -keepio" ) )
  238.  
  239.         ( execute "c/cedfind.s" )
  240.         ( if ( > ( getsize "env:cedpath" ) 0 )
  241.             ( set #edfile ( tackon ( getenv "cedpath" ) "CED" ) )
  242.             ( set #edfile "C:CED" )
  243.         )
  244.  
  245.         ( if ( not ( exists #edfile ) )
  246.             (set #edfile
  247.                 (askfile
  248.                     (Prompt #findprompt)
  249.                     (help "The mainprogram is named 'CED' while the activator is named 'ED'")
  250.                     (default #edfile)
  251.                 )
  252.             )
  253.         )
  254.     )
  255. )
  256.  
  257. (if (= #bin 2)
  258.     (
  259.     (set #edfile
  260.         (askfile
  261.             (prompt "\nPlease select your favourite texteditor:\n")
  262.             (help "Here you may select your favourite texteditor. IMPORTANT: The editor must NOT detatch itself from CLI. To check start a CLI-window and start your editor from there. If a new CLI-prompt is returned the editor 'detatches' itself from CLI and cannot be used.")
  263.             (default "SYS:Utilities/")
  264.         )
  265.     )
  266.     (set #options
  267.         (askstring
  268.             (prompt "\nPlease select arguments for "#prg"\n(Use {f} to substitute file send by ViewDIZ.)\n")
  269.             (help "See manual for "#prg" to decide which arguments to use. {f} must ALWAYS be present as this substitutes the filename ViewDIZ will send to the editor. It is recommended to use double quotes around {f} to ensure filenames containing spaces.")
  270.             (default #f)
  271.         )
  272.     )
  273.     )
  274. )
  275.  
  276. ( textfile
  277.     ( dest "Env/ViewDIZ/Editor.s" )
  278.     ( append #header""#precmd"\""#edfile"\" "#options )
  279. )
  280.  
  281.  
  282. ;**********************************
  283. ;
  284. ; Install Configuration.
  285. ; ...And delete older configs
  286. ;
  287. ;**********************************
  288.  
  289. ( if ( exists "ENVARC:ViewDIZ.Config" )    ( delete "ENVARC:ViewDIZ.Config" ) )
  290. ( if ( exists "ENV:ViewDIZ/" )        ( delete "ENV:ViewDIZ/(#?.s|Devdest|MusPref)" ) )
  291. ( if ( exists "ENVARC:ViewDIZ/" )    ( delete "ENVARC:ViewDIZ/(#?.s|Devdest|MusPref)" ) )
  292.  
  293. ( copyfiles
  294.     ( source "ENV/ViewDIZ" )
  295.     ( dest "ENV:ViewDIZ" )
  296.     ( pattern "#?" )
  297. )
  298.  
  299. ( copyfiles
  300.     ( source "ENV:ViewDIZ" )
  301.     ( dest "ENVARC:ViewDIZ" )
  302.     ( pattern "#?" )
  303. )
  304.  
  305. ;**********************************
  306. ;
  307. ; Add 'resident' command to
  308. ; s:user-startup. Then make ViewDIZ
  309. ; resident (replace old)
  310. ; (DOS: 5 = err, 0 = ok)
  311. ;
  312. ;**********************************
  313.  
  314. ( startup "ViewDIZ"
  315.     ( Prompt "\nViewDIZ can be made resident - This results in a faster appearance. Do you want to use this feature on bootup ?\n" )
  316.     ( help "This will add a line to the file s:user-startup, so that ViewDIZ will be pre-loaded into memory at startup. This results in a faster appearance of ViewDIZ but it will cost you approx. 18k of memory." )
  317.     ( command "Resident C:ViewDIZ pure\nResident C:Execute pure" )
  318.     ( confirm )
  319. )
  320.  
  321. ( rexx "c/Popbutton!" )
  322. ( exit    "\n\nEverything should be settled now! To get a quick view of the usage and functions of ViewDIZ start ViewDIZ from CLI with no arguments. For a more detailed explanation see the documentation - And just one more thing: You may run this script again if you wanna change your settings.\n\n"
  323.     "Enjoy the program !\n" )
  324.  
  325. ( welcome "dummy" )
  326.