home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / adf42w.zip / MakeFolder.Cmd < prev    next >
OS/2 REXX Batch file  |  1997-04-23  |  9KB  |  325 lines

  1. /* Begin Folder/Icon Creator for AdeptXBBS */
  2. trace on
  3. '@Echo off'
  4. adummy = ''
  5. say ''
  6. adummy = ''
  7. say ''
  8. say ''
  9. say ''
  10. say ''
  11. say 'This little script does not install Adeptxbbs for you, what it does do  '
  12. say ' is create an Adept Folder and icons for you on your Desktop.          '
  13. say ' And gives you the option of configuring a 2 node version             '
  14. say ' of AdeptXbbs. '
  15. say ''
  16. dummy = charout(,'Do you wish to continue with this process ? [y/N] ')
  17. parse upper pull adummy
  18. if left(adummy,1) \= 'Y' then do
  19.   exit
  20. end
  21.  
  22. curdir = directory()
  23.  
  24. do
  25.     say ''
  26.     say 'Please enter the drive letter AdeptXBBS is installed on (Ex. C:)'
  27.     say 'You MUST enter the full drive letter, C: <- Notice the colon'
  28.     say '--'
  29.     parse upper pull dummy
  30.     ADDRESS CMD dummy
  31.     ADDRESS CMD "CD\"
  32.     ADDRESS CMD "CD ADEPT"
  33.     olddir = curdir
  34.     curdir = dummy'\ADEPT'
  35.     say ''
  36.     say 'Current sub-directory: 'curdir
  37.     say ''
  38.     say 'Is this the Directory AdeptXBBS is installed in ?'
  39.     dum = charout(, 'sub-directory? [Y/n] ')
  40.     parse upper pull dummy
  41.     if left(dummy,1) = 'N' then do
  42.     say 'Folder Creation aborted...'
  43.     exit
  44.     end
  45.  
  46.     say ''
  47. end
  48.  
  49. /* load rexx utility functions */
  50.  
  51. rc = stream('adept.exe','c','query exists')
  52. if rc = '' then
  53. do
  54.   say 'Sorry, ADEPT.EXE not found.  Must not be right directory. Terminating.'
  55.   exit
  56. end
  57.  
  58. say ''
  59. say 'If you see any SYS### errors from this point on, please ignore them'
  60. say ''
  61. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  62. call SysLoadFuncs
  63.  
  64. /* say it, then do it */
  65.  
  66. say "Creating AdeptXbbs folder..."
  67.  
  68. /* first, create AdeptSoft folder */
  69.  
  70. title = "AdeptXbbs"
  71. classname = 'WPFolder'
  72. location = '<WP_DESKTOP>'
  73. setup = 'OBJECTID=<AdeptXbbs_Folder>;OPEN=DEFAULT'
  74. result=SysCreateObject(classname,title,location,setup,f)
  75.  
  76. /* If folder exists, ask before updating */
  77.  
  78. if result = 0 then
  79. do
  80.   existed = 'TRUE'
  81.   say ''
  82.   say 'The AdeptXBBS folder already exists.'
  83.   dum = Charout(, 'Do you really want to create a duplicate? [Y/n] ')
  84.   parse upper pull dummy
  85.   if left(dummy,1) = 'N' then
  86.   do
  87.       say 'Folder Creation Aborted.. Exiting... '
  88.       exit
  89.     end
  90. say "Creating objects in AdeptSoft folder..."
  91.  
  92. /* now, create program objects in AdeptSoft folder */
  93.  
  94. title = "AdeptXBBS 1 Node"
  95. classname = 'WPProgram'
  96. location = '<AdeptXbbs_Folder>'
  97. setup = 'EXENAME='curdir'\ADEPT.EXE;STARTUPDIR='curdir';PARAMETERS=/NODES 1'
  98. call SysCreateObject classname,title,location,setup,u
  99.  
  100. title = "AdeptXBBS 2 Nodes"
  101. classname = 'WPProgram'
  102. location = '<AdeptXbbs_Folder>'
  103. setup = 'EXENAME='curdir'\ADEPT.EXE;STARTUPDIR='curdir';PARAMETERS=/NODES 2'
  104. call SysCreateObject classname,title,location,setup,u
  105.  
  106. title = "AdeptXBBS in Setup Mode"
  107. classname = 'WPProgram'
  108. location = '<AdeptXbbs_Folder>'
  109. setup = 'EXENAME='curdir'\ADEPT.EXE;STARTUPDIR='curdir';PARAMETERS=/NODES 2 /SETUP'
  110. call SysCreateObject classname,title,location,setup,u
  111.  
  112. rc = stream('xsend.cmd','c','query exists')
  113. if rc \= '' then
  114. do
  115.   title = "Send files"
  116.   classname = 'WPProgram'
  117.   location = '<AdeptXbbs_Folder>'
  118.   setup = 'EXENAME='curdir'\XSEND.CMD;STARTUPDIR='curdir
  119.   if existed = '' then setup = setup';PARAMETERS=%* 'curdir'\\'
  120.   call SysCreateObject classname,title,location,setup,u
  121. end
  122.  
  123. rc = stream('fileedit.exe','c','query exists')
  124. if rc \= '' then
  125. do
  126.   title = "File area editor"
  127.   classname = 'WPProgram'
  128.   location = '<AdeptXbbs_Folder>'
  129.   setup = 'EXENAME='curdir'\FILEEDIT.EXE;STARTUPDIR='curdir
  130.   call SysCreateObject classname,title,location,setup,u
  131. end
  132.  
  133. rc = stream('mail.cmd','c','query exists')
  134. if rc \= '' then
  135. do
  136.   title = "Process mail"
  137.   classname = 'WPProgram'
  138.   location = '<AdeptXbbs_Folder>'
  139.   setup = 'EXENAME='curdir'\mail.cmd;STARTUPDIR='curdir
  140.   call SysCreateObject classname,title,location,setup,u
  141. end
  142.  
  143. rc = stream('reindexfiles.exe','c','query exists')
  144. if rc \= '' then
  145. do
  146.   title = "Reindex File Database"
  147.   classname = 'WPProgram'
  148.   location = '<AdeptXbbs_Folder>'
  149.   setup = 'EXENAME='curdir'\ReIndexFiles.EXE;STARTUPDIR='curdir';PARAMETERS=/NUKE'
  150.   call SysCreateObject classname,title,location,setup,u
  151. end
  152.  
  153. rc = stream('reindexusers.exe','c','query exists')
  154. if rc \= '' then
  155. do
  156.   title = "Reindex User File"
  157.   classname = 'WPProgram'
  158.   location = '<AdeptXbbs_Folder>'
  159. setup = 'EXENAME='curdir'\ReIndexUsers.Exe;STARTUPDIR='curdir
  160. call SysCreateObject classname,title,location,setup,u
  161. end
  162.  
  163. rc = stream('bfsmake.exe','c','query exists')
  164. if rc \= '' then
  165. do
  166.   title = "Convert file areas"
  167.   classname = 'WPProgram'
  168.   location = '<AdeptXbbs_Folder>'
  169.   setup = 'EXENAME='curdir'\BFSMAKE.EXE;STARTUPDIR='curdir
  170.   call SysCreateObject classname,title,location,setup,u
  171. end
  172.  
  173. rc = stream('xmsg.cmd','c','query exists')
  174. if rc \= '' then
  175. do
  176.   title = "Clean up msg areas"
  177.   classname = 'WPProgram'
  178.   location = '<AdeptXbbs_Folder>'
  179.   setup = 'EXENAME='curdir'\CLEAN.EXE;STARTUPDIR='curdir
  180.   call SysCreateObject classname,title,location,setup,u
  181. end
  182.  
  183. rc = stream('AdpXBBS.DOC','c','query exists')
  184. if rc \= '' then
  185. do
  186.   title = "AdeptXBBS Documentation!"
  187.   classname = 'WPShadow'
  188.   location = '<AdeptXbbs_Folder>'
  189.   setup = 'SHADOWID='rc
  190.   call SysCreateObject classname,title,location,setup,u
  191. end
  192.  
  193. rc = stream('GATEKPR.DOC','c','query exists')
  194. if rc \= '' then
  195. do
  196.   title = "Gate Keeper Documentation!"
  197.   classname = 'WPShadow'
  198.   location = '<AdeptXbbs_Folder>'
  199.   setup = 'SHADOWID='rc
  200.   call SysCreateObject classname,title,location,setup,u
  201. end
  202.  
  203. rc = stream('AdpRexx.DOC','c','query exists')
  204. if rc \= '' then
  205. do
  206.   title = "AdeptREXX Documentation!"
  207.   classname = 'WPShadow'
  208.   location = '<AdeptXbbs_Folder>'
  209.   setup = 'SHADOWID='rc
  210.   call SysCreateObject classname,title,location,setup,u
  211. end
  212.  
  213. rc = stream('UserMod.Doc','c','query exists')
  214. if rc \= '' then
  215. do
  216.   title = "Batch User Modifier"
  217.   classname = 'WPShadow'
  218.   location = '<AdeptXbbs_Folder>'
  219.   setup = 'SHADOWID='rc
  220.   call SysCreateObject classname,title,location,setup,u
  221. end
  222.  
  223. rc = stream('FAQ12-95.TXT','c','query exists')
  224. if rc \= '' then
  225. do
  226.   title = "AdeptXBBS Frequently Asked Questions"
  227.   classname = 'WPShadow'
  228.   location = '<AdeptXbbs_Folder>'
  229.   setup = 'SHADOWID='rc
  230.   call SysCreateObject classname,title,location,setup,u
  231. end
  232.  
  233.   rc = directory('Menus')
  234.   if rc \= '' then
  235.   do
  236.     call directory curdir
  237.     title = "BBS Menus"
  238.     classname = 'WPShadow'
  239.     location = '<AdeptXbbs_Folder>'
  240.     setup = 'SHADOWID='rc
  241.     call SysCreateObject classname,title,location,setup,u
  242.   end
  243.  
  244.   rc = directory('Text')
  245.   if rc \= '' then
  246.   do
  247.     call directory curdir
  248.     title = "BBS Text"
  249.     classname = 'WPShadow'
  250.     location = '<AdeptXBBS_Folder>'
  251.     setup = 'SHADOWID='rc
  252.     call SysCreateObject classname,title,location,setup,u
  253.   end
  254.  
  255.   rc = directory('System\SysNews')
  256.   if rc \= '' then
  257.   do
  258.     call directory curdir
  259.     title = "BBS System News"
  260.     classname = 'WPShadow'
  261.     location = '<AdeptXbbs_Folder>'
  262.     setup = 'SHADOWID='rc
  263.     call SysCreateObject classname,title,location,setup,u
  264.   end
  265.  
  266.   rc = directory('System\MiscNews')
  267.   if rc \= '' then
  268.   do
  269.     call directory curdir
  270.     title = "BBS Misc. News"
  271.     classname = 'WPShadow'
  272.     location = '<AdeptXbbs_Folder>'
  273.     setup = 'SHADOWID='rc
  274.     call SysCreateObject classname,title,location,setup,u
  275.   end
  276.  
  277. rc = stream('Adept.HLP','c','query exists')
  278. if rc \= '' then
  279. do
  280.   rc = stream('SEEHELP.EXE','c','query exists')
  281.   if rc \= '' then
  282.   do
  283.     title = "AdeptXBBS Online Help"
  284.     classname = 'WPProgram'
  285.     location = '<AdeptXbbs_Folder>'
  286.     setup = 'EXENAME='curdir'\SEEHELP.EXE;'
  287.     setup = setup'STARTDIR='curdir';PARAMETERS='curdir'\ADEPT.HLP'
  288.     call SysCreateObject classname,title,location,setup,f
  289.   end
  290. end
  291.  
  292. do
  293.   say ''
  294.   say 'Folder Creation appears to have been sucessful!'
  295.   say ''
  296. end
  297.  
  298. do
  299.   say ''
  300.   say 'NOTE: This setup defaults to starting 2 nodes.  Both nodes will be'
  301.   say '      started in  "'"SETUP"'"  mode.  This is to be sure that it will'
  302.   say '      not interupt anything else that is running.'
  303.   say ''
  304.   say '      You can setup the BBSs options from the Config pull down on'
  305.   say '      the main screen.'
  306.   say ''
  307.   say '      Be sure to click on Shutdown in order to make sure your settings'
  308.   say '      are properly saved.'
  309.   say ''
  310.   say ''
  311.   say 'Would you like to setup your copy of'
  312.   dum = Charout(, 'AdeptXBBS? [y/N] ')
  313.   parse upper pull dummy
  314.   if left(dummy,1) = 'Y' then
  315.   do
  316.     ADDRESS CMD 'Adept.exe /NODES 2 /SETUP'
  317.   end
  318.   say ''
  319.  
  320. end
  321.  
  322. say 'Thank you for choosing AdeptXbbs, The All round Best OS/2 BBs!'
  323. end
  324. /* END Install Program */
  325.