home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / wcron2b4.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-01-26  |  5KB  |  176 lines

  1. /* Installation for Warpcron 2.0
  2.    (c) by Julian Buss
  3.    ideas taken from famous Object Desktop software - try it if you don't know it!
  4. */
  5.  
  6. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  7. Call SysLoadFuncs
  8.  
  9. Say 'Welcome to Warpcron 2.0 WPS installation.'
  10. Say 'This script copies files to the target directory and'
  11. Say 'creates a WPS folder and some objects in it,'
  12. Say 'so that everything''s ready for work :-)'
  13. Say
  14.  
  15. SourceDir = directory()
  16. Parse Arg TargetDir
  17. UnixTargetDir = Translate(TargetDir, '/', '\')
  18.  
  19. if TargetDir = '' then do
  20.    Say 'You didn''t give an installation directory.'
  21.    Say 'What would you like to do?'
  22.    Say
  23.    Say '  (W)PS installation only (no copy of files)'
  24.    Say '  (F)ull install, (file copy and creation of WPS objects)'
  25.    Say
  26.    Call Charout, ('Your choice: ')
  27.    Parse Upper Pull Answer
  28.    If Left( Answer, 1 ) = W Then do
  29.      Say 'Okay, I''m ready to create the wps objects now.'
  30.      Say 'Are you ready, too (Y/N)?'
  31.      Parse Upper Pull Answer
  32.      If Left( Answer, 1 ) = N Then call end
  33.      TargetDir = SourceDir
  34.      UnixTargetDir = Translate(TargetDir, '/', '\')
  35.      call CreateObjects
  36.      call end
  37.    end
  38.  
  39.    Say 'In which directory should I install Warpcron?'
  40.    Say 'Note: must exist, if not, create one NOW.'
  41.    Call Charout, ('Directory: ' )
  42.    Parse Pull TargetDir
  43. end
  44.  
  45. tmp = directory(TargetDir)
  46. if translate(tmp) <> translate(TargetDir) then do
  47.    Say 'Target directory 'TargetDir' is nonexistent.'
  48.    Say 'Please create it before running installation.'
  49.    Say '(yes, I know, the install.cmd should do this for you...'
  50.    Say ' I will code this later ;-) )'
  51.    Say
  52.    call end
  53. end
  54. else tmp = directory(SourceDir)
  55.  
  56. Say
  57. say 'Target directory is: 'TargetDir
  58. say 'Current directory is: 'SourceDir
  59. Say 'Should I start (Y/N)?'
  60. Parse Upper Pull Answer
  61. If Left( Answer, 1 ) = N Then call end
  62.  
  63. 'xcopy 'SourceDir'\* 'TargetDir' /S'
  64. Call CreateObjects
  65. say 'done. See "Welcome!" for next steps.'
  66. call end
  67.  
  68. CreateObject: procedure
  69.     Parse Arg Class, Title, Location, Setup, Collision
  70.     Say 'Creating ['Title']'
  71.     rc = SysCreateObject( Class, Title, Location, Setup, Collision )
  72.     If rc <> 1 Then
  73.         Say ' > failed to create ['Title' | 'Class'] at location ['Location']'
  74.     return rc
  75.  
  76. CreateObjects:
  77.  
  78. rc = CreateObject( 'WPFolder',,
  79.     'Warpcron',,
  80.     '<WP_DESKTOP>',,
  81.     'NOPRINT=YES;'||,
  82.         'DEFAULTVIEW=CONTENTS;'||,
  83.         'ICONPOS=32,88;'||,
  84.         'ICONVIEWPOS=6 58 59 20;'||,
  85.         'SELFCLOSE=1;'||,
  86.         'ICONFONT=9.WarpSans;'||,
  87.         'DETAILSFONT=9.WarpSans;'||,
  88.         'TREEFONT=9.WarpSans;'||,
  89.         'ICONVIEW=NONGRID,NORMAL;'||,
  90.         'DETAILSVIEW=MINI;'||,
  91.         'TREEVIEW=LINES,MINI;'||,
  92.         'OBJECTID=<Warpcron>',,
  93.     'Update' )
  94.  
  95.   rc = CreateObject( 'WPProgram',,
  96.       'Warpcron window',,
  97.       '<Warpcron>',,
  98.       'NOTDEFAULTICON=YES;'||,
  99.           'NOPRINT=YES;'||,
  100.           'DEFAULTVIEW=RUNNING;'||,
  101.           'ICONPOS=38,22;'||,
  102.           'EXENAME='TargetDir'\WARPCRON.EXE;'||,
  103.           'STARTUPDIR='TargetDir';'||,
  104.           'PROGTYPE=WINDOWABLEVIO;'||,
  105.           'ICONFILE='SourceDir'\inst\Warpcron.ICO',,
  106.       'Update' )
  107.  
  108.   rc = CreateObject( 'WPProgram',,
  109.       'WarpcronSetup',,
  110.       '<Warpcron>',,
  111.       'NOTDEFAULTICON=YES;'||,
  112.           'NOPRINT=YES;'||,
  113.           'DEFAULTVIEW=RUNNING;'||,
  114.           'ICONPOS=6,22;'||,
  115.           'EXENAME='TargetDir'\WCRSETUP.EXE;'||,
  116.           'STARTUPDIR='TargetDir';'||,
  117.           'PROGTYPE=PM;'||,
  118.           'MINIMIZED=YES;'||,
  119.           'ICONFILE='SourceDir'\inst\wcrsetup.ico',,
  120.       'Update' )
  121.  
  122.   rc = CreateObject( 'WPProgram',,
  123.       'Warpcron Fullscreen',,
  124.       '<Warpcron>',,
  125.       'NOTDEFAULTICON=YES;'||,
  126.           'NOPRINT=YES;'||,
  127.           'DEFAULTVIEW=RUNNING;'||,
  128.           'ICONPOS=26,22;'||,
  129.           'EXENAME='TargetDir'\WARPCRON.EXE;'||,
  130.           'STARTUPDIR='TargetDir';'||,
  131.           'PROGTYPE=FULLSCREEN;'||,
  132.           'ICONFILE='SourceDir'\inst\Warpcron.ICO',,
  133.       'Update' )
  134.  
  135.   rc = CreateObject( 'WPProgram',,
  136.       'End Warpcron',,
  137.       '<Warpcron>',,
  138.       'NOTDEFAULTICON=YES;'||,
  139.           'NOPRINT=YES;'||,
  140.           'DEFAULTVIEW=RUNNING;'||,
  141.           'ICONPOS=16,22;'||,
  142.           'EXENAME=cmd.exe;'||,
  143.           'STARTUPDIR='TargetDir';'||,
  144.           'PARAMETERS=/c echo . > 'TargetDir'\endwcr;'||,
  145.           'PROGTYPE=WINDOWABLEVIO;'||,
  146.           'MINIMIZED=YES;'||,
  147.           'ICONFILE='SourceDir'\inst\End.ICO',,
  148.       'Update' )
  149.  
  150.   rc = CreateObject( 'WPProgram',,
  151.       'Welcome!',,
  152.       '<Warpcron>',,
  153.       'NOTDEFAULTICON=YES;'||,
  154.           'NOPRINT=YES;'||,
  155.           'DEFAULTVIEW=RUNNING;'||,
  156.           'ICONPOS=6,22;'||,
  157.           'EXENAME='TargetDir'\POPUP.EXE;'||,
  158.           'STARTUPDIR='TargetDir';'||,
  159.           'PARAMETERS=-f'TargetDir'\welcome;'||,
  160.           'PROGTYPE=PM;'||,
  161.           'MINIMIZED=YES;'||,
  162.           'ICONFILE='SourceDir'\inst\popup.ico',,
  163.       'Update' )
  164.  
  165.   call SysCreateObject "WPUrl", "Warpcron 2.0 Documentation", "<Warpcron>", "LOCATOR=file:///"UnixTargetDir"/doc/index.htm";
  166.  
  167. return
  168.  
  169. end:
  170.  
  171. Say 'press ENTER to end installation.'
  172. Parse Pull
  173. exit
  174.  
  175.  
  176.