Changeset 1144
- Timestamp:
- Sep 1, 2008, 11:21:40 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cfgmgr.cmd
r1136 r1144 1 1 /* 2 ::$Id$2 $Id$ 3 3 4 4 CFGMGR.CMD - manage installation, maintenance and deinstallation … … 86 86 nop 87 87 else 88 if (cfg.file.f.toolbar = 1) & (cfg.unattended = 1) then88 if (cfg.file.f.toolbar = 1) & (cfg.unattended = 1) & (translate(right(cfg.file.f.name, 13, ' ')) \= '\QUICKTLS.DAT') then 89 89 call Ticket267Fix cfg.file.f.name 90 90 end … … 137 137 138 138 NormalExit: 139 say140 say cfg.pgmname' has ended.'141 say 'Time elapsed:' time('e')142 139 n = endlocal() 143 140 exit cfg.errorcode … … 279 276 cfg.file.f.desc.1 = 'FM/2 toolbar list' 280 277 cfg.file.f.desc.0 = 1 281 cfg.file.f.toolbar = 0278 cfg.file.f.toolbar = 1 282 279 283 280 f = f + 1 … … 311 308 thisdir = thisdir || '\' 312 309 call directory thisdir 310 fm2ini = value('FM2INI',,'OS2ENVIRONMENT') 311 if fm2ini = '' then 312 if right(thisdir, 1) \= '\' then 313 cfg.inifile = thisdir || '\' || 'FM3.INI' 314 else 315 cfg.inifile = thisdir || 'FM3.INI' 316 else 317 cfg.inifile = fm2ini 318 313 319 /* edit for correct directory here? */ 314 320 … … 320 326 321 327 ProcessArgs: procedure expose (globals) 328 parse arg args 329 if pos('/ToOlBaRsOnLy', args) > 0 then 330 cfg.specialiconrun = 1 331 else 332 cfg.specialiconrun = 0 322 333 parse upper arg args 323 334 do while args \= '' & cfg.errorcode = 0 … … 454 465 455 466 Usage: procedure expose (globals) 456 say 'Proper usage of 'cfg.pgmname' :'457 say 458 say cfg.pgmname' /INSTALL [/UNATTENDED] '467 say 'Proper usage of 'cfg.pgmname' (the order of the parameters is not important):' 468 say 469 say cfg.pgmname' /INSTALL [/UNATTENDED] [/TOOLBARSONLY]' 459 470 say ' This installs any missing configuration files with default values.' 460 471 say 461 say cfg.pgmname' /INSTALL /DEFAULTS [/UNATTENDED] '472 say cfg.pgmname' /INSTALL /DEFAULTS [/UNATTENDED] [/TOOLBARSONLY]' 462 473 say ' This action backs up user-modified configuration files and replaces' 463 474 say ' them with default values. Unless /UNATTENDED, you are asked to confirm' 464 475 say ' this action.' 465 476 say 466 say cfg.pgmname' /DEINSTALL /DEFAULTS [/UNATTENDED] '477 say cfg.pgmname' /DEINSTALL /DEFAULTS [/UNATTENDED] [/TOOLBARSONLY]' 467 478 say ' This reverses the action described above.' 468 479 say 469 say cfg.pgmname' /DEINSTALL [/UNATTENDED] '480 say cfg.pgmname' /DEINSTALL [/UNATTENDED] [/TOOLBARSONLY]' 470 481 say ' This deletes all configuration files. Unless /UNATTENDED, you are asked' 471 482 say ' to confirm this action. (This is action is automatically done during' … … 474 485 say 'The optional parameter /UNATTENDED means there will be NO user interaction' 475 486 say ' or confirmation of the operation!!!' 476 say 'The order of the parameters is not important.' 487 say 488 say 'The optional parameter /TOOLBARSONLY means only toolbar-related files will' 489 say ' be processed.' 477 490 return 478 491 … … 565 578 566 579 UpdateFM2Ini: procedure expose (globals) 567 parse source . . thispgm 568 thisdir = left(thispgm, lastpos('\', thispgm)) 569 inifile = thisdir || 'fm3.ini' 570 EnvVarList = strip(SysIni(inifile, 'FM/3', 'TreeEnvVarList')) 580 EnvVarList = strip(SysIni(cfg.inifile, 'FM/3', 'TreeEnvVarList')) 571 581 if EnvVarList = '' | EnvVarList = 'ERROR:' then 572 call SysIni inifile, 'FM/3', 'TreeEnvVarList', 'PATH;DPATH;LIBPATH;HELP;BOOKSHELF;LIB;INCLUDE;LOCPATH;SMINCLUDE;LPATH;CODELPATH'573 LastToolbox = SysIni( inifile, 'FM/3', 'LastToolBox')574 LastToolbar = SysIni( inifile, 'FM/3', 'LastToolbar')582 call SysIni cfg.inifile, 'FM/3', 'TreeEnvVarList', 'PATH;DPATH;LIBPATH;HELP;BOOKSHELF;LIB;INCLUDE;LOCPATH;SMINCLUDE;LPATH;CODELPATH' 583 LastToolbox = SysIni(cfg.inifile, 'FM/3', 'LastToolBox') 584 LastToolbar = SysIni(cfg.inifile, 'FM/3', 'LastToolbar') 575 585 if LastToolbar = 'ERROR:' then 576 586 do … … 579 589 else 580 590 LastToolbar = LastToolbox 581 call SysIni inifile, 'FM/3', 'LastToolbar', LastToolbar582 end 583 if SysIni( inifile, 'FM/3', 'FM2Shutdown.Toolbar') = 'ERROR:' then584 call SysIni inifile, 'FM/3', 'FM2Shutdown.Toolbar', LastToolbar585 if SysIni( inifile, 'FM/4', 'LastToolbar') = 'ERROR:' then586 call SysIni inifile, 'FM/4', 'LastToolbar', LastToolbar591 call SysIni cfg.inifile, 'FM/3', 'LastToolbar', LastToolbar 592 end 593 if SysIni(cfg.inifile, 'FM/3', 'FM2Shutdown.Toolbar') = 'ERROR:' then 594 call SysIni cfg.inifile, 'FM/3', 'FM2Shutdown.Toolbar', LastToolbar 595 if SysIni(cfg.inifile, 'FM/4', 'LastToolbar') = 'ERROR:' then 596 call SysIni cfg.inifile, 'FM/4', 'LastToolbar', LastToolbar 587 597 return 588 598 589 599 Ticket267Fix: procedure expose (globals) 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 600 parse arg infile 601 fix_string = 'Fixed: Ticket 267' 602 abort_fix = 0 603 outfile = SysTempFilename('cfgmgr??.fix') 604 call lineout outfile, ';' fix_string 605 /* Read file, if comment has "already repaired" message then stop */ 606 do while lines(infile) > 0 607 line = linein(infile) 608 if left(line, 1) = ';' then 609 if pos(fix_string, line) > 0 then 610 do 611 abort_fix = 1 612 leave 613 end 614 else 615 call lineout outfile, line 616 else if word(line, 1) = ':spacer' then 617 call lineout outfile, ';' || substr(line, 2) 618 else 619 do 620 tool.1 = line 621 tool.2 = linein(infile) 622 tool.3 = linein(infile) 623 tool.4 = linein(infile) 624 button_name = translate(tool.2) 625 if (button.button_name.text \= '') & (tool.4 >= 4900) & (tool.4 < 4950) then 626 do 627 call lineout outfile, button.button_name.helptext 628 call lineout outfile, button.button_name.text 629 call lineout outfile, tool.3 630 call lineout outfile, button.button_name.id 631 end 632 else 633 do 634 call lineout outfile, tool.1 635 call lineout outfile, tool.2 636 call lineout outfile, tool.3 637 call lineout outfile, tool.4 638 end 639 end 640 end 641 call stream infile, 'c', 'close' 642 call stream outfile, 'c', 'close' 643 if abort_fix = 0 then 644 do 635 645 'copy' infile cfg.backupdir /* backup tls file */ 636 637 638 639 646 'copy' outfile infile /* "install" new tls file */ 647 cfg.action_taken = 1 648 end 649 call SysFileDelete outfile 640 650 return 641 651 … … 643 653 644 654 Error: 645 say 646 parse source . . cmd 647 say 'CONDITION'('C') 'signaled at' cmd 'line' SIGL'.' 648 if 'CONDITION'('D') \= '' then 649 say 'REXX reason =' 'CONDITION'('D')'.' 650 if 'CONDITION'('C') == 'SYNTAX' & 'SYMBOL'('RC') == 'VAR' then 651 say 'REXX error =' RC '-' 'ERRORTEXT'(RC)'.' 652 else if 'SYMBOL'('RC') == 'VAR' then 653 say 'RC =' RC'.' 654 say 'Source =' 'SOURCELINE'(SIGL) 655 656 if 'CONDITION'('I') \== 'CALL' | 'CONDITION'('C') == 'NOVALUE' | 'CONDITION'('C') == 'SYNTAX' then do 657 trace '?A' 658 say 'Exiting.' 659 call 'SYSSLEEP' 2 660 exit 'CONDITION'('C') 661 end 662 663 return 655 say 656 parse source . . cmd 657 say 'CONDITION'('C') 'signaled at' cmd 'line' SIGL'.' 658 if 'CONDITION'('D') \= '' then 659 say 'REXX reason =' 'CONDITION'('D')'.' 660 if 'CONDITION'('C') == 'SYNTAX' & 'SYMBOL'('RC') == 'VAR' then 661 say 'REXX error =' RC '-' 'ERRORTEXT'(RC)'.' 662 else if 'SYMBOL'('RC') == 'VAR' then 663 say 'RC =' RC'.' 664 say 'Source =' 'SOURCELINE'(SIGL) 665 666 if 'CONDITION'('I') \== 'CALL' | 'CONDITION'('C') == 'NOVALUE' | 'CONDITION'('C') == 'SYNTAX' then do 667 trace '?A' 668 say 'Exiting.' 669 call 'SYSSLEEP' 2 670 exit 'CONDITION'('C') 671 end 672 return 664 673 665 674 /* end Error */
Note:
See TracChangeset
for help on using the changeset viewer.