home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / newlookb.zip / NEWLOOK.CMD < prev    next >
OS/2 REXX Batch file  |  1996-03-31  |  26KB  |  604 lines

  1. /*****************************************************************************\
  2. * NEWLOOK.CMD - main procedure                                                *
  3. \*****************************************************************************/
  4.  
  5. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  6. call SysLoadFuncs
  7. '@echo off'
  8. 'ECHO '
  9. 'cls'
  10.  
  11. /*****************************************************************************\
  12. *  Error checking: working directory, RC.EXE, RCPP.EXE, RCPP.ERR, RDC.CMD,    *
  13. *                  RESMGR.CMD, RDCPP.EXE, SYSICONS and WINCTLS subdirectoties *
  14. *                  free drive space, command processor                        *
  15. \*****************************************************************************/
  16.  
  17. /* check working directory                                                   */
  18. wkdir = SysSearchPath('PATH', 'NEWLOOK.CMD')
  19. if wkdir = '' then do
  20.    call startMsg
  21.    say '  NEWLOOK.CMD must be run in its own directory. Just double click on its icon.'
  22.    call endMsg
  23. end
  24.  
  25. /* look for RC.EXE, RCPP.EXE and RCPP.ERR                                    */
  26. rcpath = SysSearchPath('PATH', 'RC.EXE')
  27. rcpppath = SysSearchPath('PATH', 'RCPP.EXE')
  28. rcppErrpath = SysSearchPath('PATH', 'RCPP.ERR')
  29. if (rcpath = '' | rcpppath = '' | rcppErrpath = '') then do
  30.    call startMsg
  31.    say '  You must install RC.EXE, RCPP.EXE and RCPP.ERR in a directory included in'
  32.    say '  the PATH statement of your CONFIG.SYS. See NEWLOOK.TXT for more details.'
  33.    call SysCurPos 15, 2
  34.    call endMsg
  35. end
  36.  
  37. /* look for Martin Lafaix's RESMGR                                           */
  38. rdcpath = SysSearchPath('PATH', 'RDC.CMD')
  39. resmgrpath = SysSearchPath('PATH', 'RESMGR.CMD')
  40. rdcpppath = SysSearchPath('PATH', 'RDCPP.EXE')
  41. nldir = DIRECTORY()
  42. if (rdcpath = '' | resmgrpath = '' | rdcpppath = '') then do
  43.    call startMsg
  44.    say '  You must install Martin Lafaix''s RESMGR in...'
  45.    say '  'nldir
  46.    say '  or any other directory included in the PATH statement of your CONFIG.SYS.'
  47.    say '  See NEWLOOK.TXT for more details.'
  48.    call endMsg
  49. end
  50.  
  51. /* check the existence of SYSICONS and WINCTLS directories                   */
  52. nlIcoDir=STREAM(nldir || '\SYSICONS\PMWP.RC','C','QUERY EXISTS')
  53. nlWCTLsDir=STREAM(nldir || '\WINCTLS\PMMERGE.RC','C','QUERY EXISTS')
  54. if (nlIcoDir = '' | nlWCTLsDir = '') then do
  55.    call startMsg
  56.    say '  Cannot find SYSICONS or WINCTLS subdirectories!!!'
  57.    say '  When extracting NEWLOOK.ZIP you must rebuild SYSICONS and WINCTLS'
  58.    say '  subdirectories. Do not use UNZIP with the ''-j'' option!'
  59.    call endMsg
  60. end
  61.  
  62. /* check if there is enough space on the disk                                */
  63. nldrive=filespec('drive', nldir)
  64. parse value SysDriveInfo(nldrive) with a freespace b c
  65. freespace=trunc(freespace/1048576,1)
  66. pmwpSav = STREAM(nldir || '\PMWP.SAV', 'C', 'QUERY EXISTS')
  67. pmmergeSav = STREAM(nldir ||'\PMMERGE.SAV', 'C', 'QUERY EXISTS')
  68. select
  69.    when (freespace < 3 & (pmwpSav = '' | pmmergeSav = ''))
  70.       then do
  71.       call startMsg
  72.       say '  you have only' freespace 'Mb of free disk space on drive' nldrive
  73.       say '  you need at least 3 Mb.'
  74.       say '  Type ''read'' in the menu screen to see NEWLOOK.TXT for more details.'
  75.       call endMsg 'noexit'
  76.       end
  77.    when (freespace < 6 | (freespace < 3 & pmwpSav \= ''  & pmmergeSav \= ''))
  78.       then do
  79.       call startMsg
  80.       say '  you have only' freespace 'Mb of free disk space on drive' nldrive
  81.       say '  you need at least 6 Mb to run the ''newall'' COMMAND or make more'
  82.       say '  than one back-up copy of PMWP.DLL and PMMERGE.DLL. If you want to'
  83.       say '  change both icons and window controls, change the first before, then'
  84.       say '  reboot, change the controls and then reboot again.'
  85.       say '  Type ''read'' in the menu screen to see NEWLOOK.TXT for more details.'
  86.       call endMsg 'noexit'
  87.       end
  88.    when (freespace < 8 & pmwpSav = '' & pmmergeSav = '')
  89.       then do
  90.       call startMsg
  91.       say '  you have only' freespace 'Mb of free disk space on drive' nldrive '.'
  92.       say '  You need at least 8 Mb to make more than one back-up copy of'
  93.       say '  PMWP.DLL and PMMERGE.DLL. Copy PMWP.SAV and PMMERGE.SAV on diskettes'
  94.       say '  and delete the originals if you have just installed an OS/2 FixPack'
  95.       say '  and want to patch the new PMMERGE.DLL and PMWP.DLL.'
  96.       say '  Type ''read'' in the menu screen to see NEWLOOK.TXT for more details.'
  97.       call endMsg 'noexit'
  98.       end
  99.    otherwise
  100.       nop
  101. end
  102.  
  103. /* look for CMD.EXE                                                          */
  104. cmdpath = SysSearchPath('PATH', 'CMD.EXE')
  105. if cmdpath = '' then do
  106.    call startMsg
  107.    say '  cannot find CMD.EXE. If you use a different command processor you must'
  108.    say '  reinstall CMD.EXE or edit NEWLOOK.CMD file, replacing all CMD.EXE'
  109.    say '  occurrencies with the name of the executable of your command processor.'
  110.    call endMsg
  111. end
  112.  
  113. /* gets OS/2 drive and directory                                             */
  114. os2drive = FILESPEC('drive', cmdpath)
  115. os2path = FILESPEC('path', cmdpath)
  116.  
  117. /* introduction screen                                                       */
  118. say ''
  119. 'cls'
  120. say
  121. say '   ┌────────────────────────────────────────────────────────────────────────┐'
  122. say '   │                                                                        │'
  123. say '   │    *****************       NEWLOOK V. 0.11       ******************    │'
  124. say '   │    March 28 1996            copyright (c)      Alessandro Cantatore    │'
  125. say '   │                                                                        │'
  126. say '   └────────────────────────────────────────────────────────────────────────┘'
  127. say
  128. say '   ┌────────────────────────────────────────────────────────────────────────┐'
  129. say '   │                                                                        │'
  130. say '   │        If you decide to change the default system icons or window      │'
  131. say '   │      controls, PMWP.DLL and / or PMMERGE.DLL will be changed. The      │'
  132. say '   │      original files will be copied  as PMWP. SAV and PMMERGE. SAV      │'
  133. say '   │      in NEWLOOK directory .  Your CONFIG. SYS will be temporarily      │'
  134. say '   │      changed too and a back-up copy will be saved as CONFIG.NLK.       │'
  135. say '   │        If you ever used RESMGR  or CHG_CTLS application, you must      │'
  136. say '   │      restore the original DLLs before applying new default system      │'
  137. say '   │      icons or window controls.                                         │'
  138. say '   │        Type READ in the following menu screen for more details.        │'
  139. say '   │                                                                        │'
  140. say '   └────────────────────────────────────────────────────────────────────────┘'
  141. call SysCurPos 23, 4
  142. 'pause'
  143. call mainmenu
  144. call SysDropFuncs
  145. exit
  146.  
  147.  
  148. /*****************************************************************************\
  149. *  mainmenu: menu procedure                                                   *
  150. \*****************************************************************************/
  151.  
  152. mainmenu:
  153.    say ''
  154.    'cls'
  155.    call SysCurPos 2, 0
  156.    say '   ┌────────────────────────────────────────────────────────────────────────┐'
  157.    say '   │                                                                        │'
  158.    say '   │    ACTION                                                  COMMAND     │'
  159.    say '   │    Read NEWLOOK.TXT ...................................... read        │'
  160.    say '   │    Edit the new system icons ............................. editico     │'
  161.    say '   │    Edit the new window controls .......................... editctls    │'
  162.    say '   │    Change the default system icons ....................... newico      │'
  163.    say '   │    Change window controls ................................ newctls     │'
  164.    say '   │    Change both system icon and window controls ........... newall      │'
  165.    say '   │    Restore original system icons ......................... restico     │'
  166.    say '   │    Restore original window controls ...................... restctls    │'
  167.    say '   │    Restore both original system icons and window controls  restall     │'
  168.    say '   │    Exit .................................................. quit        │'
  169.    say '   │                                                                        │'
  170.    say '   └────────────────────────────────────────────────────────────────────────┘'
  171.  
  172.    say ''
  173.    call SysCurPos 18, 0
  174.    say '   ┌────────────────────────────────────────────────────────────────────────┐'
  175.    say '   │                                                                        │'
  176.    say '   │                                                                        │'
  177.    say '   │                                                                        │'
  178.    say '   └────────────────────────────────────────────────────────────────────────┘'
  179.    do while done \= 1
  180.       call SysCurPos 20, 8
  181.       say '                                                          '
  182.       call SysCurPos 20, 8
  183.       pull action
  184.       say ''
  185.       select
  186.          when action = 'READ'          /* read program documentation         */
  187.             then do
  188.                call readdoc
  189.                call mainmenu
  190.                done = 1
  191.             end
  192.          when action = 'EDITICO'       /* open SYSICONS folder for editing   */
  193.             then do
  194.                call editing 'SYSICONS'
  195.                call mainmenu
  196.                done = 1
  197.             end
  198.          when action = 'EDITCTLS'      /* open WINCTLS folder for editing    */
  199.             then do
  200.                call editing 'WINCTLS'
  201.                call mainmenu
  202.                done = 1
  203.             end
  204.          when action = 'NEWICO'        /* patch PMWP.DLL                     */
  205.             then do
  206.                call patchdll 'PMWP'
  207.                call doneMsg
  208.                done = 1
  209.             end
  210.          when action = 'NEWCTLS'       /* patch PMMERGE.DLL                  */
  211.             then do
  212.                call patchdll , 'PMMERGE'
  213.                call doneMsg
  214.                done = 1
  215.             end
  216.          when action = 'NEWALL'        /* patch both PMWP.DLL and PMMERGE.DLL*/
  217.             then do
  218.                call patchdll 'PMWP', 'PMMERGE'
  219.                call doneMsg
  220.                done = 1
  221.             end
  222.          when action = 'RESTICO'       /* restore original PMWP.DLL          */
  223.             then do
  224.                call restore 'PMWP'
  225.                call doneMsg
  226.                done = 1
  227.             end
  228.          when action = 'RESTCTLS'      /* restore original PMMERGE.DLL       */
  229.             then do
  230.                call restore , 'PMMERGE'
  231.                call doneMsg
  232.                done = 1
  233.             end
  234.          when action = 'RESTALL'       /* restore original PMWP and PMMERGE  */
  235.             then do
  236.                call restore 'PMWP', 'PMMERGE'
  237.                call doneMsg
  238.                done = 1
  239.             end
  240.          when action = 'QUIT'          /* terminate NEWLOOK.CMD and exit     */
  241.             then do
  242.                call SysDropFuncs
  243.                exit
  244.             end
  245.          otherwise                     /* unvalid command: alarm and loop    */
  246.             call alarm
  247.       end                              /* end select                         */
  248.    end                                 /* end do                             */
  249. return
  250.  
  251.  
  252. /*****************************************************************************\
  253. *  readdoc: shows the program documentation                                   *
  254. \*****************************************************************************/
  255.  
  256. readdoc: procedure
  257.    read = checkEditor('E.EXE')
  258.    read NEWLOOK.TXT
  259. return
  260.  
  261.  
  262. /*****************************************************************************\
  263. *  editing: opens "SYSICONS" or "WINCTLS" folder for editing                  *
  264. \*****************************************************************************/
  265.  
  266. editing: procedure expose nldir
  267. arg folder
  268.    call startMsg
  269.    say '  Now the' folder 'folder will be opened.'
  270.    say '  Icons are saved with a PTR extension. Do not rename them!'
  271.    say '  Icons and Bitmaps are saved in various formats. Remember to check all'
  272.    say '  the available formats by the "Device | List... | View" menu commands.'
  273.    say '  See NEWLOOK.TXT for more details.'
  274.    call endMsg 'noexit'
  275.    rc = SysOpenObject(nldir || '\' || folder, 'default', 'FALSE')
  276.    if rc = 0 then do
  277.       call startMsg
  278.       say '  Cannot open ' nldir || '\' || folder
  279.       call endMsg
  280.    end
  281. return
  282.  
  283.  
  284. /*****************************************************************************\
  285. *  doneMsg: after patching DDLs says you must reboot                          *
  286. \*****************************************************************************/
  287.  
  288. doneMsg:
  289.    call startMsg
  290.    say '  Your system files have been updated.'
  291.    say '  You must reboot in order to let changes take into effect'
  292.    call endsnd
  293.    call endMsg
  294. return
  295.  
  296.  
  297. /*****************************************************************************\
  298. *  patchdll: back-ups DLLs passed as arguments, patches them, patches         *
  299. *            CONFIG.SYS and swaps old DLLs with new ones on next reboot       *
  300. \*****************************************************************************/
  301.  
  302. patchdll: procedure expose os2drive os2path cmdpath nldir
  303. arg name1, name2
  304.    'cls'
  305.    say
  306.    call checkConfig
  307.     /* back-up config.sys                 */
  308.    'copy' os2drive || '\CONFIG.SYS' os2drive || '\CONFIG.NLK'
  309.    'del' os2drive || '\CONFIG.SYS'
  310.    if name1 = ''
  311.       then nop
  312.    else do                             /* PMWP.DLL                           */
  313.       call checkbackup name1, 'PATCH'
  314.       filename = checkdll(name1)
  315.       'copy' filename
  316.       'copy PMWP.DLL PMWP.SAV'
  317.       'rc -r SYSICONS\PMWP.RC'
  318.       if RC \= 0 then
  319.          call patchError 'Resource Compiler', 'PMWP.DLL'
  320.       ADDRESS CMD 'call resmgr -a PMWP.DLL SYSICONS\PMWP.RES'
  321.       if RC \= 0 then
  322.          call patchError 'Resource Manager', 'PMWP.DLL'
  323.       ' del SYSICONS\PMWP.RES'
  324.       'echo call=' || cmdpath '/c copy' nldir || '\PMWP.DLL' os2drive || os2path,
  325.                    || 'DLL >>' os2drive || '\CONFIG.SYS'
  326.       'echo call=' || cmdpath '/c del' nldir || '\PMWP.DLL >>' os2drive,
  327.                    || '\config.sys'
  328.    end
  329.    if name2 = ''
  330.       then nop
  331.    else do                             /* PMMERGE.DLL                        */
  332.       call checkbackup name2, 'PATCH'
  333.       filename = checkdll(name2)
  334.       'copy' filename
  335.       'copy PMMERGE.DLL PMMERGE.SAV'
  336.       'rc -r WINCTLS\PMMERGE.RC'
  337.       if RC \= 0 then
  338.          call patchError 'Resource Compiler', 'PMMERGE.DLL'
  339.       ADDRESS CMD 'call resmgr -a PMMERGE.DLL WINCTLS\PMMERGE.RES'
  340.       if RC \= 0 then
  341.          call patchError 'Resource Manager', 'PMMERGE.DLL'
  342.       'del WINCTLS\PMMERGE.RES'
  343.       'echo call='|| cmdpath '/c copy' nldir || '\PMMERGE.DLL' os2drive || os2path,
  344.                   || 'DLL >>' os2drive || '\CONFIG.SYS'
  345.       'echo call=' || cmdpath '/c del' nldir || '\PMMERGE.DLL >>' os2drive,
  346.                    || '\config.sys'
  347.    end
  348.    'type' os2drive || '\CONFIG.NLK >>' os2drive || '\CONFIG.SYS'
  349.    'echo call=' || cmdpath '/c copy' os2drive || '\CONFIG.NLK' os2drive,
  350.                 || '\CONFIG.SYS >>' os2drive || '\CONFIG.SYS'
  351. return
  352.  
  353.  
  354. /*****************************************************************************\
  355. *  checkConfig: avoid to overwrite a valid copy of CONFIG.SYS                 *
  356. \*****************************************************************************/
  357.  
  358. checkConfig:
  359.    'type' os2drive || '\config.sys | find /I "PMWP" >nul'
  360.    if RC = 0 then
  361.       call configError
  362.    'type' os2drive || '\config.sys | find /I "PMMERGE" >nul'
  363.    if RC = 0 then
  364.       call configError
  365. return
  366.  
  367.  
  368. /*****************************************************************************\
  369. *  checkdll: checks PMWP.DLL or PMMERGE.DLL existence                         *
  370. \*****************************************************************************/
  371.  
  372. checkdll: procedure expose os2drive os2path
  373. arg dllname
  374.    filename = stream( os2drive || os2path || '\DLL\' || dllname || '.DLL', 'C',,
  375.                      'query exists')
  376.    if filename = '' then do
  377.       call startMsg
  378.       say '  Cannot find ' dllname || '.DLL in ' os2drive || os2path,
  379.              || '\DLL directory'
  380.       'rename ' os2drive || '\CONFIG.NLK CONFIG.SYS'
  381.       call endMsg
  382.    end
  383. return filename
  384.  
  385.  
  386. /*****************************************************************************\
  387. *  restore: restore back-up copies of original DLLs                           *
  388. \*****************************************************************************/
  389.  
  390. restore: procedure expose os2drive os2path cmdpath nldir
  391. arg name1, name2
  392.    'cls'
  393.    say
  394.    call checkConfig
  395.    'copy' os2drive || '\CONFIG.SYS' os2drive || '\CONFIG.NLK'
  396.    'del' os2drive || '\CONFIG.SYS'     /* back-up config.sys                 */
  397.    if name1 = ''
  398.       then nop
  399.    else do                             /* PMWP.DLL                           */
  400.       filename = checkbackup(name1, 'RESTORE')
  401.       'echo call=' || cmdpath '/c copy' filename os2drive || os2path,
  402.                   || 'DLL\PMWP.DLL >>' os2drive || '\CONFIG.SYS'
  403.       'echo call=' || cmdpath '/c del' filename '>>' os2drive || '\CONFIG.SYS'
  404.    end
  405.    if name2 = ''
  406.       then nop
  407.    else do                             /* PMMERGE.DLL                        */
  408.       filename = checkbackup(name2, 'RESTORE')
  409.       'echo call=' || cmdpath '/c copy' filename os2drive || os2path,
  410.                   || 'DLL\PMMERGE.DLL >>' os2drive || '\CONFIG.SYS'
  411.       'echo call=' || cmdpath '/c del' filename '>>' os2drive || '\CONFIG.SYS'
  412.    end
  413.    'type' os2drive || '\CONFIG.NLK >>' os2drive || '\CONFIG.SYS'
  414.    'echo call=' || cmdpath '/c copy' os2drive || '\CONFIG.NLK' os2drive,
  415.                 || '\CONFIG.SYS >>' os2drive || '\CONFIG.SYS'
  416. return
  417.  
  418.  
  419. /*****************************************************************************\
  420. *  checkbackup: checks the existence of original back-up copies of PMWP.DLL   *
  421. *  or PMMERGE.DLL                                                             *
  422. \*****************************************************************************/
  423.  
  424. checkbackup: procedure expose os2drive os2path cmdpath nldir
  425. arg dllname, action
  426.    filename = stream( nldir || '\' || dllname || '.SAV', 'C', 'query exists')
  427.    select
  428.       when (filename = '' & action = 'RESTORE')
  429.          then do
  430.             call startMsg
  431.             say '  Cannot find back-up copy of' dllname || '.DLL in ' nldir || 'directory!'
  432.             say '  You must copy the original from the installation disk renaming it'
  433.             say ' ' dllname || '.SAV and run NEWLOOK again.'
  434.             call undo
  435.          call endMsg
  436.          end
  437.       when (filename \= '' & action = 'PATCH')
  438.          then do
  439.             call startMsg
  440.             say '  NEWLOOK has detected a back-up copy of' dllname || '.DLL .'
  441.             say '  Since RESMGR does not work correctly when re-patching DLLs,'
  442.             say '  you must restore original OS/2 DLLs before patching them.'
  443.             say '  Anyway if you have just installed an OS/2 fixpack, overwriting so'
  444.             say '  previously patched DLLs, you can patch the new DLLs now. In this'
  445.             say '  case' dllname || '.SAV will be saved as' dllname || '.SV1.'
  446.             say '  If later you make a back-out of the FixPack do not forget to delete'
  447.             say ' ' dllname || '.SAV and to rename' dllname || '.SV1' dllname || '.SAV.'
  448.             say '  Type "continue" to patch DLLs now, press "enter" to go back to mainmenu.'
  449.             say '  See NEWLOOK.TXT for more details.'
  450.             pull reply
  451.             if reply = 'CONTINUE' then
  452.                return filename
  453.             else do
  454.                call undo
  455.                call mainmenu
  456.             end
  457.          end
  458.       otherwise
  459.          nop
  460.    end
  461. return filename
  462.  
  463.  
  464. /*****************************************************************************\
  465. *  checkEditor: if it cannot find e.exe in the CONFIG.SYS PATH asks the user  *
  466. *               for another editor                                            *
  467. \*****************************************************************************/
  468.  
  469. checkEditor: procedure
  470. arg editor
  471.    editpath = SysSearchPath('PATH', editor)
  472.    if editpath = '' then do
  473.       call startMsg
  474.       say '  Cannot find' editor || '.'
  475.       say '  Type the name of the executable file of the editor you use.'
  476.       say
  477.       pull editor
  478.       exestension = right(editor, 3)
  479.       if exestension \= 'EXE' then
  480.       editor = editor ||'.exe'
  481.       editor = checkEditor(editor)
  482.    end
  483. return editor
  484.  
  485.  
  486. /*****************************************************************************\
  487. *  configError: restore a back-up copy of CONFIG.SYS, if cannot find          *
  488. *  CONFIG.NLK strips CONFIG.SYS of all "call=x:\os2\cmd.exe..." statements    *
  489. \*****************************************************************************/
  490.  
  491. configError: procedure expose os2drive os2path cmdpath nldir
  492.    call startMsg
  493.    say '  Error!!! You did not reboot after patching the DLL!!!'
  494.    say '  NEWLOOK will restore the original files. Do not press Ctrl+C or'
  495.    say '  Ctrl-break now!!! See NEWLOOK.TXT for more details.'
  496.    say
  497.    'pause'
  498.    say
  499.    RC = undo()
  500.    if RC \= 0 then do
  501.       call alarm
  502.       say '  You deleted the back-up copy of CONFIG.SYS!!!'
  503.       say '  NEWLOOK will try to rebuild it now.'
  504.       say '  Please check the new CONFIG.SYS file!!!'
  505.       say '  A copy of the wrong CONFIG.SYS will be saved as CONFIG.ERR'
  506.       say
  507.       'pause'
  508.       say
  509.       'copy' os2drive '\config.sys' os2drive '\config.err'
  510.       'type' os2drive '\config.err | find /I /V "call=' || cmdpath || '" > config.sys'
  511.       read = checkEditor('E.EXE')
  512.       read  os2drive '\config.sys'
  513.    end
  514.    call startMsg
  515.    say '  Everything has been restored to its previous state as you'
  516.    say '  had never run NEWLOOK since last reboot.'
  517.    say '  Now if you still want to change or restore icons or controls'
  518.    say '  run again NEWLOOK, type the proper command and then reboot.'
  519.    call endsnd
  520.    call endMsg
  521.    call SysDropFuncs
  522.    exit
  523. return
  524.  
  525.  
  526. /*****************************************************************************\
  527. *  compareDLL : compares *.DLL with *.SAV if they have same size and same     *
  528. *               time stamp returns 1                                          *
  529. \*****************************************************************************/
  530.  
  531. compareDLL: procedure expose os2drive os2path nldir
  532. arg DLLname
  533.    call SysFileTree os2drive || os2path || 'DLL\' || DLLname || '.DLL', filename, 'T'
  534.    DLLfile=left(filename.1, 26)
  535.    call SysFileTree nldir || '\' || DLLname || '.SAV', filename, 'T'
  536.    SAVfile=left(filename.1, 26)
  537. return DLLfile=SAVfile
  538.  
  539.  
  540. /*****************************************************************************\
  541. *  undo : cleans NEWLOOK directory in case of failure                         *
  542. \*****************************************************************************/
  543.  
  544. undo: procedure expose os2drive os2path nldir
  545.    RC = compareDLL('PMWP')
  546.    if RC = 1 then
  547.       call SysFileDelete nldir || '\PMWP.SAV'
  548.    call SysFileDelete nldir || '\PMWP.DLL'
  549.    RC = compareDLL('PMMERGE')
  550.    if RC = 1 then
  551.       call SysFileDelete nldir || '\PMMERGE.SAV'
  552.    call SysFileDelete nldir || '\PMMERGE.DLL'
  553.    'copy' os2drive || '\config.nlk' os2drive || '\config.sys'
  554. return RC
  555.  
  556.  
  557. /*****************************************************************************\
  558. *  patchError: show a message in case of failure of RC or RESMGR              *
  559. \*****************************************************************************/
  560.  
  561. patchError: procedure
  562. arg command, dllfile
  563.    call startMsg
  564.    say ' ' command 'error while patching' dllfile || '!!!'
  565.    say '  See NEWLOOK.TXT for more details!'
  566.    call undo
  567.    call endMsg
  568. return
  569.  
  570.  
  571. alarm:
  572.   call beep 1000,300
  573.   call beep 150, 500
  574. return
  575.  
  576.  
  577. endsnd:
  578.   call beep 1600, 200
  579.   call beep 800, 200
  580.   call beep 400, 200
  581.   call beep 200, 200
  582.   call beep 100, 200
  583. return
  584.  
  585.  
  586. startMsg:
  587.    'cls'
  588.    call alarm
  589.    call SysCurPos 5, 0
  590. return
  591.  
  592.  
  593. endMsg: procedure
  594. arg done
  595.    call SysCurPos 19, 2
  596.    'pause'
  597.    if done = '' then do
  598.       call SysDropFuncs
  599.       exit
  600.    end
  601. return
  602.  
  603.  
  604.