home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / chapm20.zip / ChapBas.st < prev    next >
Text File  |  1995-06-22  |  2KB  |  48 lines

  1. "Installation file."
  2. | stdDirectory fileDirectory aString files aStream file |
  3. stdDirectory := '?ChapManInstallationDirectory'.
  4.  
  5. (stdDirectory notEmpty and: [stdDirectory first = $?]) ifTrue: [
  6.     stdDirectory := Smalltalk at: (stdDirectory copyFrom: 2
  7.         to: stdDirectory size) asSymbol ifAbsent: [''].
  8.     ].
  9. stdDirectory := Directory pathName: stdDirectory.
  10. files := #(
  11. ('ChapMan VST Goodies' 'ChapGood')
  12. ('ParcPlace Compatibility' 'ParcPCom')
  13. ('System Extensions' 'SysExten')
  14. ('Userinterface Extensions Portable' 'UIExPort')
  15. ('Userinterface Extensions' 'UIExten?')
  16. ('ChapMan Kernel' 'ChapKrnl')
  17. ('ChapMan Userinterface Extensions' 'ChapUIE')
  18. ('ChapMan System Extensions' 'ChapSysE')
  19. ('ChapMan User-Interface' 'ChapUI')
  20. ('ChapMan Base' 'ChapBas')
  21. ).
  22.  
  23. files do: [:each |
  24.     Transcript cr; nextPutAll: 'Installing: ', (each at: 1), '...'.
  25.     fileDirectory := stdDirectory.
  26.     [
  27.     file := (each at: 2) collect: [:c | c == $? 
  28.         ifTrue: [SmalltalkLibrary platformLetter] 
  29.         ifFalse: [c]].
  30.     File exists: file, '.cls' in: fileDirectory
  31.     ] whileFalse: [
  32.         aString := Prompter 
  33.             title: 'File not found in ', fileDirectory fullDirName
  34.             prompt: 'Enter new directory for file ', file, '.cls'
  35.             default: ''.
  36.         (aString isNil or: [aString isEmpty]) ifTrue: [
  37.             Transcript cr; nextPutAll: 'Installation aborted'; cr.
  38.             ^Error signal: 'Installation aborted'].
  39.         fileDirectory := Directory pathName: aString.
  40.         (MessageBox confirm: 'Use this directory for subsequent files also?') ifTrue: [
  41.             stdDirectory := fileDirectory].
  42.         ].
  43.     aStream := fileDirectory file: file, '.cls'.
  44.     [aStream fileIn] ensure: [aStream close].
  45.     ].
  46.  
  47. Transcript cr; nextPutAll: 'Done.'.!
  48.