home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 30 fixes_v / 30-fixes_v.zip / p21sp.zip / OS2BOOT.CMD < prev    next >
OS/2 REXX Batch file  |  1994-06-07  |  15KB  |  505 lines

  1. /*         Create an OS/2 2.1 Boot Diskette & the Perfomance 2.1 Utility Diskette           */
  2. /*                          Copyright (c) 1992, 1993, 1994 CLEAR & SIMPLE, INC.                                */
  3. ECHO OFF
  4. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  5. call SysLoadFuncs
  6. 'mode co80,27'
  7. ver=sysos2ver()
  8. if ver='2.11' then sp=1
  9. else sp=0
  10. objectName='O S 2 B O O T . C M D'
  11. progid='OS2BOOT.CMD'
  12. call source
  13. call initVariables
  14. call welcome
  15. pos=SysCurPos(0,0)
  16. 'cls'
  17. pos=SysCurPos(0,0)
  18. say 'This program will create a bootable diskette for OS/2' ver
  19.  
  20. say;SAY GREEN;Say  '  Label it "PERFORMANCE 2.1 OS/2 BOOT Diskette"';SAY BLUE;say
  21. say 'It will also (optionally) create a second diskette containing several'
  22. say 'utility functions that can only be run when you are booted from the'
  23. say 'Boot Diskette.';say;SAY GREEN;SAY'  Label it the "PERFORMANCE 2.1 UTILITY Diskette".';SAY BLUE;
  24. say;say 'See the Software Chapter in the Performance 2.1 Book '
  25. say 'for more information on the Utility disk. ';say
  26. say 'You will need up to two (2) blank, formatted, High Density 3.5" diskettes.'
  27. say '(one for the OS/2 Boot Diskette and one for the Utility Diskette.)'
  28. say '    (or one 2.88MB diskette) '
  29. say;say "To build a Boot Diskette you'll need the"
  30. say 'OS/2 'ver' INSTALLATION diskette and OS/2 'ver' - Diskette 1'
  31. if sp=1 then say 'or the OS/2 2.1 Service Pack Disk1 and Disk2';
  32.  
  33. SAY;SAY RED;say 'Do you have the necessary items and wish to continue? (Y/N) ';SAY BLUE
  34. parse upper pull ans1 .
  35. if ans1 \= 'Y' then do
  36.    say 'No diskettes will be created, per your request!'
  37.    say ' '; say 'Press Enter to End this Object'; pull
  38. exit
  39. end   
  40. else NOP
  41.  
  42. todrive = ' '
  43. pctype = ' '
  44.  
  45. CALL getBOOT 
  46. say;say ' But first, I need some information from you!';say
  47.  
  48. do until todrive='A' | todrive='B'
  49. say 'Please enter the diskette drive letter (e.g., "A" or "B") '
  50. say 'where you want me to create the diskette(s).'
  51. say red; say '(This must be a 3.5" disk drive.)';say blue
  52. parse upper pull todrive
  53. end   
  54. todrive = todrive||':'
  55.  
  56. do until fromdrive='A' | fromdrive='B'
  57. say 'Please enter the diskette drive letter (e.g., "A" or "B") '
  58. say 'where you will insert the OS/2 Install & Disk 1 diskettes.'
  59. say '(This may be the same drive as above, and may be 5.25").'
  60. parse upper pull fromdrive
  61. end
  62. fromdrive = fromdrive||':'
  63.  
  64. do until pctype = 1 | pctype = 2
  65. say 'What type of machine do you have?'
  66. say '   1 = ISA (AT bus) or EISA bus'
  67. say '   2 = Microchannel (IBM PS/2 M55 or larger)'
  68. say "You MUST enter either '1' or '2' "
  69. pull pctype
  70. end  
  71.  
  72. say ' '
  73. say ' Do you wish to build an OS/2 boot diskette? (Y/N)'
  74. parse upper pull bdisk .
  75. if bdisk \= 'Y' then do
  76.    say 'No OS/2 boot disk will be created, per your request!'
  77.    call doUtilDisk
  78.    pull
  79.    exit
  80. end  
  81.  
  82. t = 0
  83. do while t = 0
  84.   say ' '
  85.   say 'I will need about 1.3 MB of temporary disk space to build a'
  86.   say 'boot diskette.  Please enter the letter of  the drive where you'
  87.   say 'want me to put the temporary files (e.g., "C", "D", etc.)'
  88.   say '(or just press Enter for the default of your current boot drive):'
  89.   parse upper pull tempdriv
  90.   if tempdriv = ' ' then do 
  91.     tempdriv = Driveis
  92.     t = 1
  93.     end  
  94.   else do
  95.      tempdriv = tempdriv||":"
  96.      map = SysDriveMap('C:', 'LOCAL')
  97.      parse value map with d.1 d.2 d.3 d.4 d.5 d.6 d.7 d.8 d.9
  98.       do d=1 to 9
  99.        if tempdriv = d.d  then t = 1
  100.        
  101.      end  
  102.   end  
  103. end  
  104.  
  105.  
  106. say 'I am now ready to build an OS/2 boot diskette on' todrive
  107. info = SysDriveInfo(tempdriv)
  108. parse var info dr free total label
  109. if free < 1300000 then do
  110.     freek = free/1024
  111.     freem = freek/1000
  112.     say 'You must have at least 1.3 MB on your ' tempdrive 'drive to run this utility.'
  113.     say 'You only have' freeM ' MB available.  Please clear some disk space and try again.'
  114.     exit
  115. end   
  116.  
  117. say
  118. 'MD 'tempdriv'\cands  >NUL'
  119. b=0
  120. do while b = 0
  121.  note.1 = 262
  122.  note.2 = 523
  123.  note.3 = 262
  124.  note.4 = 523
  125. do i=1 to 4
  126.  call beep note.i,75
  127. end  
  128.  
  129. say red;SAY 'Please insert the OS/2 'ver' INSTALLATION DISKETTE in drive 'fromdrive;say blue
  130. if sp=1 then say ' or the OS/2 2.1 Service Pack Disk1'
  131.  
  132.    
  133. 'PAUSE'
  134. say 
  135. call SysFileTree fromdrive'\OS2LDR.', 'inst'
  136. b=inst.0
  137. end  
  138.  
  139. say 'Copying files...'
  140. "xCOPY" fromdrive"\OS2KRNL*. " tempdriv"\CANDS\OS2KRNL.* /t/h >NUL"
  141. "xCOPY" fromdrive"\OS2LDR. " tempdriv"\CANDS\*.* /t/h >NUL"
  142. "xCOPY" fromdrive"\SYSINSTX.COM " tempdriv"\CANDS\*.*  >NUL"
  143. "xCOPY" fromdrive"\OS2LDR.MSG "tempdriv"\CANDS\*.* /t/h >NUL"
  144.  
  145.  
  146. say
  147. b=0
  148. do while b = 0
  149.  note.1 = 262
  150.  note.2 = 523
  151.  note.3 = 262
  152.  note.4 = 523
  153.  do i=1 to 4
  154.   call beep note.i,75
  155. end  
  156.  SAY 'Please insert the OS/2 'ver' DISKETTE 1 in drive 'fromdrive
  157. if sp=1 then say ' or the OS/2 2.1 Service Pack Disk2'
  158. else
  159.  'PAUSE'
  160.  say
  161.  call SysFileTree fromdrive'\HARDERR.EXE', 'inst'
  162.  b=inst.0
  163. end 
  164.  
  165. say 'Copying files...'
  166. "COPY" fromdrive"\COUNTRY.SYS" tempdriv"\CANDS\*.* >NUL "
  167. "COPY" fromdrive"\PRINT0"pctype".SYS" tempdriv"\CANDS\*.* >NUL "
  168. "COPY" fromdrive"\SCREEN0"pctype".SYS" tempdriv"\CANDS\*.* >NUL "
  169. "COPY" fromdrive"\KBD0"pctype".SYS" tempdriv"\CANDS\*.* >NUL "
  170. "COPY" fromdrive"\CLOCK0"pctype".SYS" tempdriv"\CANDS\*.* >NUL "
  171. "COPY" fromdrive"\CMD.EXE" tempdriv"\CANDS\*.* >NUL "
  172.  
  173. "COPY" fromdrive"\ANSICALL.DLL" tempdriv"\CANDS\*.* >NUL "
  174. "COPY" fromdrive"\B*.DLL" tempdriv"\CANDS\*.* >NUL "
  175. "COPY" fromdrive"\DOSCALL1.DLL" tempdriv"\CANDS\*.* >NUL "
  176. "COPY" fromdrive"\KBDCALLS.DLL" tempdriv"\CANDS\*.* >NUL "
  177. say 'Still copying files...'
  178. "COPY" fromdrive"\MOUCALLS.DLL" tempdriv"\CANDS\*.* >NUL "
  179. "COPY" fromdrive"\VIOCALLS.DLL" tempdriv"\CANDS\*.* >NUL "
  180. "COPY" fromdrive"\QUECALLS.DLL" tempdriv"\CANDS\*.* >NUL "
  181. "COPY" fromdrive"\SESMGR.DLL" tempdriv"\CANDS\*.* >NUL "
  182. "COPY" fromdrive"\OS2CHAR.DLL" tempdriv"\CANDS\*.* >NUL "
  183. "COPY" fromdrive"\NAMPIPES.DLL" tempdriv"\CANDS\*.* >NUL "
  184. "COPY" fromdrive"\MSG.DLL" tempdriv"\CANDS\*.* >NUL "
  185. "COPY" fromdrive"\NLS.DLL" tempdriv"\CANDS\*.* >NUL "
  186. "COPY" fromdrive"\NPXEMLTR.DLL" tempdriv"\CANDS\*.* >NUL "
  187.  
  188. "COPY" fromdrive"\KEYBOARD.DCP" tempdriv"\CANDS\*.* >NUL "
  189. "COPY" fromdrive"\OS2DASD.DMD" tempdriv"\CANDS\*.* >NUL "
  190. "COPY" fromdrive"\IBMINT13.I13" tempdriv"\CANDS\*.* >NUL "
  191. "COPY" fromdrive"\IBM"pctype"FLPY.ADD" tempdriv"\CANDS\*.* >NUL "
  192.  
  193. say
  194. c=1
  195. do while c \= 0
  196.  note.1 = 262
  197.  note.2 = 523
  198.  note.3 = 262
  199.  note.4 = 523
  200.  do i=1 to 4
  201.  call beep note.i,75
  202.  end  
  203. SAY 'Please insert a blank, formatted diskette for your'
  204. SAY 'new boot diskette in drive ' todrive
  205. say;say red; say 'This must be a formatted 3.5" HD diskette'
  206. say 'DO NOT USE a DD (low density) Diskette that you formatted for 1.44MB!'
  207. say blue
  208.  'PAUSE'
  209.  say
  210.  call SysFileTree todrive'\*.*', 'boot'
  211.  c=boot.0
  212.   if c\=0 then say 'Diskette is not completely blank, it may have hidden files'
  213. end 
  214.  
  215. say 'Loading System files...'
  216. tempdriv"\CANDS\SYSINSTX "todrive 
  217. 'ERASE 'tempdriv'\CANDS\sysinstx.com >NUL '
  218.  
  219. say 'Copying files to new boot diskette...'
  220. "xCOPY "tempdriv"\CANDS\*.* "todrive"/t/h >NUL "  
  221.  
  222. say 'Cleaning up temporary files... '
  223. say 'the list of files vary by system type'
  224.  
  225. call elimdir tempdriv'\cands' Y
  226.  
  227.  "COPY "Driveis"\OS2\HPFS.IFS "todrive" >NUL  "
  228.  "COPY "Driveis"\OS2\OS2SCSI.DMD "todrive" >NUL  "
  229.  
  230. if pctype = '2' then do
  231. 'copy 'driveis'\os2\abios.sys ' todrive '>NUL'
  232. 'copy 'driveis'\os2\*.bio ' todrive '>NUL'
  233. end   
  234.  
  235. say 'Making CONFIG.SYS for your new boot diskette...'
  236. outfile = todrive"\CONFIG.SYS"
  237.  
  238. call lineout outfile, "REM This CONFIG.SYS created by Clear and Simple, Inc."
  239. call lineout outfile, 'IFS=HPFS.IFS /CACHE:64'
  240. call lineout outfile, 'BUFFERS=32'
  241. call lineout outfile, 'IOPL=YES'
  242. call lineout outfile, 'MEMMAN=NOSWAP'
  243. call lineout outfile, 'PROTSHELL=CMD.EXE'
  244. call lineout outfile, 'SET OS2_SHELL=CMD.EXE'
  245. call lineout outfile, 'DISKCACHE=64,LW'
  246. call lineout outfile, 'PROTECTONLY=YES'
  247. call lineout outfile, 'LIBPATH=.;\;'
  248. call lineout outfile, 'PAUSEONERROR=NO'
  249. call lineout outfile, 'CODEPAGE=850'
  250. call lineout outfile, 'DEVINFO=KBD,US,KEYBOARD.DCP'
  251. call lineout outfile, 'DEVICE=\DOS.SYS'
  252. call lineout outfile, 'SET PATH=.;\'
  253. call lineout outfile, 'SET DPATH=\;'
  254. call lineout outfile, 'SET KEYS=ON'
  255. call lineout outfile, 'BASEDEV=IBM'pctype'FLPY.ADD'
  256. if (pctype='1') then call lineout outfile, 'BASEDEV=IBM1S506.ADD'
  257. call lineout outfile, 'BASEDEV=OS2SCSI.DMD'
  258. call lineout outfile, 'BASEDEV=IBMINT13.I13'
  259. call lineout outfile, 'BASEDEV=OS2DASD.DMD'
  260. call lineout outfile
  261. DROP outfile
  262.  
  263. say;say 'OS/2 2.1 Boot Diskette successfully created.'
  264. say;say green; say 'When you use this diskette to boot, it is normal to get'
  265. say ' an error message:'
  266. say black;say ' SYS0318 - Message file OS001.MSG cannot be found';say green
  267. say;say 'This should be followed by an [A:\] prompt - enter any commands there.';say blue;say
  268. call doUtilDisk
  269.  
  270. call SysDropFuncs
  271. say ' '
  272. say 'Your new PERFORMANCE 2.1 Diskette(s) have been created.'
  273. say '        - by -'
  274. say 'CLEAR & SIMPLE, INC.'
  275. SAY ' '
  276.  
  277. say ' '; say 'Press Enter to End this Object'
  278. pull
  279. exit
  280.  
  281. doUtilDisk:
  282. say;say 'Do you want me to create a "Performance 2.1" Utility Diskette? (Y/N)'
  283. parse upper pull chk1 .
  284. if chk1 \= 'Y' then do
  285.   say ' '; say 'Are you sure?  This is recommended!'
  286.   say ' '; say 'Last chance to make a Utility diskette? (Y/N)'; pull chk1
  287.    if chk1 \= 'Y' then do
  288.     say 'I will NOT create a Utility Diskette.'
  289.     say 'CLEAR & SIMPLE, INC.'
  290.     return
  291.   end   
  292. end
  293. say ' '
  294. c=1
  295. do while c \= 0
  296.  note.1 = 262
  297.  note.2 = 523
  298.  note.3 = 262
  299.  note.4 = 523
  300. do i=1 to 4
  301.  call beep note.i,75
  302. end  
  303. SAY 'Please insert a second blank, formatted diskette which will'
  304. SAY 'become the Utility Diskette in drive ' todrive
  305. 'PAUSE'
  306. say ' '
  307. call SysFileTree todrive'\*.*', 'chck'
  308. if chck.0 \=0 then do; say 'diskette is not completely blank - it may have hidden files'
  309.  say 'We will assume there is enough room'
  310.  say '(ctrl-break) can stop the copies'
  311. end   
  312.  c=0
  313. end  
  314. say red;say 'Copying CHKDSK.COM to the Utility Diskette...'
  315.  
  316. "COPY" Driveis"\OS2\CHKDSK.COM "todrive' >NUL '
  317. "COPY" Driveis"\OS2\SYSTEM\OSO001.MSG "todrive' >NUL  '
  318. "COPY" Driveis"\OS2\DLL\UHPFS.DLL "todrive' >NUL '
  319.  
  320. say red;Say 'Copying PERFORMANCE 2.1 Utilities to the diskette...'
  321. call SysFileTree 'os2boot.cmd', 'info', 'F'
  322. parse upper var info.1 cdate ctime fsize attribs wherefile
  323. parse var Wherefile Wdrive ':\' Wdir '\OS2BOOT.CMD'
  324. wdrive=right(wdrive,1)
  325. P2LOC=WDRIVE':\'WDIR
  326. 'COPY' P2LOC"\UTILp21\*.CMD" todrive' >NUL '
  327.  
  328. say green;Say 'Copying CONFIG.SYS to ORIGINAL.SYS on the Utility Diskette...'
  329. "COPY" Driveis"\CONFIG.SYS "todrive"\ORIGINAL.SYS"'  '
  330. say;say 'Copying OS2.INI and OS2SYS.INI to the Utility Diskette...'
  331. "xCOPY "driveis"\os2\os2*.ini "todrive"/t/h >NUL "
  332.  
  333.  
  334.  
  335. say blue;say;say ' '; say 'PERFORMANCE 2.1 Utility diskette Created!'
  336. say; say 'Press Enter to End'
  337. return
  338.  
  339. source:
  340. parse upper source where
  341. parse var where . . yes'\OS2BOOT.CMD'
  342. rc=SysFileTree(yes'\MAP.CMD', stem, F)
  343. if stem.0=0 then DO;
  344. SAY 'This program has been modified to ONLY execute from the same'
  345. say 'location where the entire Performance 2.1 PLUS product is installed.'
  346. say 'We created this inconvience so that we could make it more '
  347. say 'convienient to distribute this update over CompuServe.'
  348. say;say 'Please copy this program 'progid 'to the correct drive'
  349. say 'and directory where Performance 2.1 PLUS is installed, \PERF21 '
  350. say '- so that it will properly execute.'
  351. say; say 'If you do not have Performance 2.1 PLUS you may '
  352. say 'purchase it from several stores that carry OS/2 Software.  '
  353. say 'You can also call Clear & Simple, Inc. at 203-658-1204, '
  354. say 'or Fax (203) 651-0354, we accept VISA, MC or Discover credit cards.'
  355. say;say 'The price of Performance 2.1 PLUS is only $39.95 '
  356. say '- it includes a 100 page book dedicated to tuning your OS/2 system,'
  357. say 'and 40 REXX utility programs that simplify the tuning process'
  358. say 'and provide additional utility functions like backing-up your desktop'
  359. say 'or making a single OS/2 Boot Diskette, etc.'
  360. say;say 'Press enter to end.'
  361. pull
  362. exit
  363. end
  364. return
  365.  
  366.  
  367.  
  368.  
  369. getBOOT:
  370. bootdrive = Value('Path',,'OS2ENVIRONMENT')
  371. parse upper var bootdrive bootdrive
  372. Driveis = Substr(bootdrive,Pos('\OS2\SYSTEM',bootdrive)-2,2)
  373. return
  374.  
  375. Welcome:
  376. echo on
  377. 'prompt $p$E[0;'34';'47';'5';'5'm]'
  378. echo off
  379. 'cls'
  380. call SysCurState 'OFF'
  381. call sysCurPos '4', '0'
  382.  
  383. msg.0 =12
  384. msg.1 = blue
  385. msg.2 = cr5 cr5' ┌────────────────────────────────┐'
  386. msg.3 = cr5 cr5' │                                │ '
  387. msg.4 = cr5 cr5' │  P E R F O R M A N C E   2.1   │'
  388. msg.5 = cr5 cr5' │                                │      '
  389. msg.6 = cr5 cr5' │                                │'
  390. msg.7 = cr5 cr5' │                                │'
  391. msg.8 = cr5 cr5' │                                │'
  392. msg.9 = cr5 cr5' │                                │'
  393. msg.10 = cr5 cr5' └────────────────────────────────┘'
  394. msg.11 = hblue
  395. msg.12 = cr5 '        Copyright (c) 1993 Clear & Simple, Inc.           '
  396.  
  397. msg.13= '         Please Maximize SCREEN SIZE  & Press Enter to Continue    '
  398. do i =1  to msg.0
  399.        say msg.i
  400.        end
  401. call SysCurPos '19','0'
  402.  
  403.  
  404. say red;
  405. call sysCurPos '7', '22'
  406. call syssay '────────────────────────────'
  407. call sysCurPos '8', '21'
  408. call syssay '─────────────────────────────'
  409.  
  410.  
  411. say;
  412.  
  413. say red;
  414. call sysCurPos '9', '21'
  415. call syssay 'Go'
  416.  
  417.  
  418. call sysCurPos '9', '23'
  419. call syssay ' as fast as'
  420.  
  421.  
  422. call sysCurPos '9', '35'
  423. call syssay '32 bits'
  424.  
  425.  
  426. call sysCurPos '11', '30'
  427. call syssay ' will'
  428.  
  429.  
  430. call sysCurPos '11', '35'
  431. call syssay ' take'
  432.  
  433.  
  434. say blue;
  435. call sysCurPos '11', '41'
  436. call syssay 'you!'
  437.  
  438.  
  439. say hblack;
  440. call sysCurPos '15', '0'
  441.  
  442. SAY'       Please Maximize SCREEN SIZE  & Press Enter to Continue...'
  443.  
  444.  
  445. say red;
  446. call sysCurPos '14', '26'
  447.  
  448. CALL SYSPAUSE ObjectName
  449. call SysCurState 'ON'
  450.  
  451.  
  452. 'cls'
  453. echo on
  454. 'prompt $p$E[0;'34';'47';'5';'5'm]'
  455. echo off
  456. 'cls'
  457. return
  458.  
  459.  
  460. InitVariables:
  461. CharSet:
  462. /* Foreground colors, not highlighted*/
  463. black      ='A'
  464. red        ='A'
  465. green      ='A'
  466. yellow     ='A'
  467. blue       ='A'
  468. white      ='A'
  469. /* Foreground colors, highlighted*/
  470. hblack      ='A'
  471. hred       ='A'
  472. hgreen     ='A'
  473. hyellow    ='A'
  474. hblue      ='A'
  475. hwhite     ='A'
  476.  
  477. blue_o_white = 'A'
  478. white_o_blue ='A'
  479. white_o_red  ='A'
  480. cursor_up  ='A'          /* Cursor up 1 line*/
  481. cursor_up2 ='A'          /* Cursor up 2 lines */
  482. cursor_down   ='B'       /* Cursor down 1 line */
  483. cursor_right  ='C'       /* Cursor right 1 space  */
  484. cr5 ='C'       /* Cursor right 5 spaces */
  485. normal      ='A'     /* Restore default attrib. and color    */
  486. reverse     ='A'     /* Reverse video   */
  487.  
  488. highlight   ='A'     /* Highlight  */
  489. invisible   ='A'     /* Invisible */
  490. return
  491.  
  492. SysPause:
  493. parse arg prompt
  494.   if prompt='' then
  495.     prompt='Press Enter key when ready . . .'
  496.   call SysSay prompt
  497.   Pull .
  498.   say
  499. return
  500. SysSay:
  501. parse arg string
  502.   call charout 'STDOUT', string
  503. return
  504.  
  505.