home *** CD-ROM | disk | FTP | other *** search
Wrap
/***************************************************************************/ /* */ /* Copyright (c) 1987 - 1992 IBM Corporation */ /* */ /* TK21DESK.CMD Version 1.0 */ /* */ /* Function: */ /* Build the WPS entries for the following products: */ /* Development Tool */ /* ON-Line Text */ /* C Samples */ /* Updates the CONFIG.SYS */ /* Note : */ /* */ /* Parameters: */ /* None */ /* */ /***************************************************************************/ Trace 'O' Address CMD '@ECHO OFF' /**************/ /* Initialize */ /**************/ Call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs Call sysloadfuncs tooldrive = '' toolpath = '' bootdrive = Substr(Translate(Value('PATH',,'OS2ENVIRONMENT')),Pos('\OS2\SYSTEM',Translate(Value('PATH',,'OS2ENVIRONMENT')))-2,2) /*****************************************************************************/ /* Getting the Toolkit 2.1 drive & path */ /*****************************************************************************/ If Pos('\TOOLKT21',Translate(Value('PATH',,'OS2ENVIRONMENT'))) > 0 Then tooldrive = Translate(Substr(Value('PATH',,'OS2ENVIRONMENT'),Pos('\TOOLKT21',Translate(Value('PATH',,'OS2ENVIRONMENT')))-2,2)) If tooldrive = '' Then Do Say "No path found for the OS/2 Toolkit 2.1, please enter the drive." Say "Example) C:" Parse Upper Pull tooldrive toolpath=tooldrive||"\TOOLKT21" Say "OS/2 Toolkit 2.1 DRIVE =" tooldrive Say "OS/2 toolkit 2.1 PATH =" toolpath Say "Is OS/2 Toolkit 2.1 in drive" tooldrive"?(Y/N)" Parse Upper Pull response If response <> 'Y' Then Do tooldrive = '' Say "Re-enter the Drive that contains OS/2 Toolkit 2.1." Parse Upper Pull tooldrive toolpath = tooldrive||'\TOOLKT21' End End Else Do Say "Path found for the OS/2 2.1 Toolkit." toolpath = tooldrive||'\TOOLKT21' Say "OS/2 Toolkit 2.1 DRIVE =" tooldrive Say "OS/2 toolkit 2.1 PATH =" toolpath Say "Is OS/2 Toolkit 2.1 information correct?(Y/N)" Parse Upper Pull response If response <> 'Y' Then Do tooldrive = '' Say "Re-enter the Drive that contains Toolkit 2.1." Parse Upper Pull tooldrive toolpath = tooldrive||'\TOOLKT21' End End Do Until file.0 <> 0 ret = SysFileTree(toolpath, 'file', 'D') If file.0 = 0 Then Do 'CLS' Say "The OS/2 Toolkit 2.1 is not in drive" tooldrive"." Say "Do you want to exit from OS/2 Toolkit installation?(Y/N)" Parse Upper Pull response If Substr(response,1,1) = 'Y' Then Call Endit tooldrive='' Say "Please re-enter the drive for OS/2 Toolkit 2.1." Say "Example) C:" Parse Upper Pull tooldrive toolpath=tooldrive||"\TOOLKT21" Say "OS/2 Toolkit 2.1 DRIVE =" tooldrive Say "OS/2 Toolkit 2.1 PATH =" toolpath Say "Is OS/2 Toolkit 2.1 in drive" tooldrive"?(Y/N)" Parse Upper Pull response If response <> 'Y' Then Do tooldrive = '' Say "Re-enter the Drive that contains OS/2 Toolkit 2.1." Parse Upper Pull tooldrive toolpath = tooldrive||'\TOOLKT21' End /* If */ End /* If */ End /* do */ /*****************************************************************************/ /* Ask User for Toolkit drive if there is no toolkit info in system */ /*****************************************************************************/ 'CLS' Say "Your OS/2 system is installed on the" bootdrive "drive." Say " " Say "The OS/2 Toolkit 2.1 components have been found:" Say " " If tooldrive <> '' Then Say " OS/2 Toolkit 2.1 is in" toolpath Say " " Say "This program will now create a folder for OS/2 Toolkit 2.1 and" Say "its identified components on your desktop." Say " " Say "Do you want to continue (Y/N)?" Parse Upper Pull yesno . If Substr(yesno,1,1) <> 'Y' Then Call Endit /*****************************************************************************/ /* Define & Create the Toolkit Folder for the TOOLKIT 2.1 */ /*****************************************************************************/ If tooldrive <> '' Then Do Call SysCreateObject 'WPFolder', 'Toolkit 2.1','<WP_DESKTOP>','OBJECTID=<TK_TOOLKIT>;ICONFILE='||toolpath||'\ICON\UTILS.ICO','R' /*****************************************************************************/ /* Create the Toolkit Info., Dev. Tool, & Sample Folder for the TOOLKIT 2.1 */ /*****************************************************************************/ Call SysCreateObject 'WPFolder', 'Toolkit Information','<TK_TOOLKIT>','OBJECTID=<TK_DEVINFO>;ICONFILE='||toolpath||'\ICON\ICONINFO.ICO','R' Call SysCreateObject 'WPFolder', 'Development Tools','<TK_TOOLKIT>','OBJECTID=<TK_DEVTOOLS>;ICONFILE='||toolpath||'\ICON\FXICON.ICO','R' Call SysCreateObject 'WPFolder', 'Sample Programs','<TK_TOOLKIT>','OBJECTID=<TK_CSAMPLE>;ICONFILE='||toolpath||'\ICON\OSTUTOR.ICO','R' Call SysCreateObject 'WPShadow','Toolkit Readme','<TK_TOOLKIT>','OBJECTID=<TK_TKREADME>;ICONFILE='||toolpath||'\;SHADOWID='||toolpath||'\READ.ME','R' /*****************************************************************************/ /* Create Reference Program ICONs in TOOLKIT Info Folder */ /*****************************************************************************/ Call SysCreateObject 'WPProgram','REXX Reference','<TK_DEVINFO>','OBJECTID=<TK_REXXAPI>;EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=REXXAPI.INF;STARTUPDIR='||toolpath||'\BOOK;','R' Call SysCreateObject 'WPProgram','IPF Reference','<TK_DEVINFO>','OBJECTID=<TK_IPFC20>;EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=IPFC20.INF;STARTUPDIR='||toolpath||'\BOOK;','R' Call SysCreateObject 'WPProgram','SOM Reference','<TK_DEVINFO>','OBJECTID=<TK_SOMREF>;EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=SOM.INF;STARTUPDIR='||toolpath||'\BOOK;','R' Call SysCreateObject 'WPProgram','Tools Reference','<TK_DEVINFO>','OBJECTID=<TK_TOOLREF>;EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=TOOLINFO.INF;STARTUPDIR='||toolpath||'\BOOK;','R' Call SysCreateObject 'WPProgram','PM Reference','<TK_DEVINFO>','OBJECTID=<TK_PMREF>;EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=PMREF;STARTUPDIR='||toolpath||'\BOOK;','R' Call SysCreateObject 'WPProgram','CP Guide and Reference','<TK_DEVINFO>','OBJECTID=<TK_PROGREF21>;EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=PROGREF21;STARTUPDIR='||toolpath||'\BOOK;','R' Call SysCreateObject 'WPProgram','Kernel Debug Reference','<TK_DEVINFO>','OBJECTID=<TK_KDEBUG>;EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=KDEBUG.INF;STARTUPDIR='||toolpath||'\BOOK;','R' Call SysCreateObject 'WPProgram','KwikInf','<TK_DEVINFO>','OBJECTID=<TK_KWIKINF>;EXENAME='||toolpath||'\OS2BIN\KWIKINF.EXE;PROGTYPE=PM;STARTUPDIR='||toolpath||'\OS2BIN;','R' /*****************************************************************************/ /* Create Sample Program ICONs in Samples Folder */ /*****************************************************************************/ samples.1 = toolpath||'\C\SAMPLES\WORMS\WORMS.EXE WINDOWABLEVIO; -30; Mixed Mode Sample ; <TK_WORMS>' samples.2 = toolpath||'\C\SAMPLES\ANIMALS\ANIMALS.CMD WINDOWABLEVIO ;; SOM Inheritance Sample ; <TK_ANIMALS>' samples.3 = toolpath||'\C\SAMPLES\TP\TP.CMD WINDOWABLEVIO ;; SOM Text Processing Sample ; <TK_TP>' samples.4 = toolpath||'\C\SAMPLES\NPIPE\SVRNPIPE.EXE PM ;CLINPIPE.EXE; Tic-Tac-Toe Sample ; <TK_NPIPE>' samples.5 = toolpath||'\C\SAMPLES\DLLAPI\DLLAPI.EXE PM ;;Dynamic Link Library Sample ; <TK_DLLAPI>' samples.6 = toolpath||'\C\SAMPLES\QUEUES\SVRQUEUE.EXE PM ;CLIQUEUE.EXE;Queues Sample ; <TK_QUEUES>' samples.7 = toolpath||'\C\SAMPLES\CLOCK\CLOCK.EXE PM ;;Clock Sample ; <TK_TKCLOCK>' samples.8 = toolpath||'\C\SAMPLES\DRAGDROP\DRAGDROP.EXE PM ;;Dragdrop Sample ; <TK_DRAGDROP>' samples.9 = toolpath||'\C\SAMPLES\STYLE\STYLE.EXE PM ;;Style Sample ; <TK_STYLE>' samples.10 = toolpath||'\C\SAMPLES\SEMAPH\SEMAPH.EXE PM ;;Semaphore Sample ; <TK_SEMAPH>' samples.11 = toolpath||'\C\SAMPLES\IMAGE\IMAGE32.EXE PM ;; Image Sample ; <TK_IMAGE>' samples.12 = toolpath||'\C\SAMPLES\VMM\VMM.EXE PM ;; Virtual Memory Management Sample ; <TK_VMM>' samples.13 = toolpath||'\C\SAMPLES\TEMPLATE\TEMPLATE.EXE PM ;;Application Template Sample ; <TK_TEMPLATE>' samples.14 = toolpath||'\C\SAMPLES\HANOI\HANOI.EXE PM ;; Towers of Hanoi Sample ; <TK_HANOI>' samples.15 = toolpath||'\C\SAMPLES\JIGSAW\JIGSAW.EXE PM ;; Jigsaw Puzzle Sample ; <TK_TKJIGSAW>' samples.16 = toolpath||'\C\SAMPLES\EAS\EAS.EXE PM ;; Edit Extended Attributes Sample ; <TK_EAS>' samples.17 = toolpath||'\C\SAMPLES\SORT\SORT.EXE PM ;; Sorting Algorithm Sample ; <TK_SORT>' samples.18 = toolpath||'\C\SAMPLES\HELLO\HELLO.EXE PM ;; Standard Window Sample ; <TK_HELLO>' samples.19 = toolpath||'\C\SAMPLES\GRAPHIC\GRAPHIC.EXE PM ;; Retained Graphics Sample ; <TK_GRAPHIC>' samples.20 = toolpath||'\C\SAMPLES\DIALOG\DIALOG.EXE PM ;; Introductory Dialog Box Sample ; <TK_DIALOG>' samples.21 = toolpath||'\C\SAMPLES\CLIPBRD\CLIPBRD.EXE PM ;; Clipboard Sample ; <TK_CLIPBRD>' samples.22 = toolpath||'\C\SAMPLES\PRINT\PRTSAMP.EXE PM ;; Print Sample ; <TK_PRINT>' samples.23 = toolpath||'\REXX\SAMPLES\CALLREXX\CALLREXX.EXE WINDOWABLEVIO ;; REXX Interpreter Invocation Sample ; <TK_CALLREXX>' samples.24 = toolpath||'\REXX\SAMPLES\DEVINFO\DEVINFO.CMD WINDOWABLEVIO ;; REXX Variable Pool Interface Sample ; <TK_RXTKINFO>' samples.25 = toolpath||'\REXX\SAMPLES\PMREXX\PMREXX.EXE WINDOWABLEVIO ; REXXTRY.CMD; Presentation Manager REXX Interface Sample ; <TK_PMREXX>' samples.26 = toolpath||'\REXX\SAMPLES\REXXUTIL\REXXUDEM.CMD WINDOWABLEVIO ;; REXX Utility Functions Sample ; <TK_REXXUTIL>' samples.27 = toolpath||'\REXX\SAMPLES\RXMACDLL\RXMACDLL.CMD WINDOWABLEVIO ;; External Functions in REXX Macrospace Sample ; <TK_RXMACDLL>' samples.0 = 27 Do i = 1 to samples.0 Parse Var samples.i program type ';' parms ';' title ';' objid program = Strip(program) type = Strip(title) parms = Strip(parms) title = Strip(title) objid = Strip(objid) If parms = '' Then Do Call SysCreateObject 'WPProgram',title,'<TK_CSAMPLE>','OBJECTID='||objid||';EXENAME='||program||';PROGTYPE='||type||';STARTUPDIR='||Filespec('D',program)||Substr(Filespec('P',program),1,Length(Filespec('P',program))-1)||';','R' End Else Do Call SysCreateObject 'WPProgram',title,'<TK_CSAMPLE>','OBJECTID='||objid||';EXENAME='||program||';PROGTYPE='||type||';PARAMETERS='||parms||';STARTUPDIR='||Filespec('D',program)||Substr(Filespec('P',program),1,Length(Filespec('P',program))-1)||';','R' End End Call SysCreateObject 'WPProgram','Palette Sample','<TK_CSAMPLE>','OBJECTID=<TK_PALETTE>;EXENAME='||toolpath||'\C\SAMPLES\PALETTE\PALETTE.EXE;PROGTYPE=PM;STARTUPDIR='||toolpath||'\C\SAMPLES\PALETTE;','R' Call SysCreateObject 'WPProgram','Information Presentation Facility Sample','<TK_CSAMPLE>','OBJECTID=<TK_IPF>;EXENAME='||bootdrive||'\OS2\VIEW.EXE;PROGTYPE=PM;PARAMETERS=IPF.INF;STARTUPDIR='||toolpath||'\C\SAMPLES\IPF;','R' Call SysRegisterObjectClass 'Car', toolpath||'\C\SAMPLES\WPCAR\CAR.DLL' Call SysCreateObject 'Car', 'WP Car Sample','<TK_CSAMPLE>','OBJECTID=<TK_CAR>' /*****************************************************************************/ /* Create Utility ICONs */ /*****************************************************************************/ Call SysCreateObject 'WPProgram','Dialog Editor','<TK_DEVTOOLS>','OBJECTID=<TK_DLGEDIT>;EXENAME='||toolpath||'\OS2BIN\DLGEDIT.EXE;PROGTYPE=PM;STARTUPDIR='||bootdrive||'\;','R' Call SysCreateObject 'WPProgram','Font Editor','<TK_DEVTOOLS>','OBJECTID=<TK_FONTEDIT>;EXENAME='||toolpath||'\OS2BIN\FONTEDIT.EXE;PROGTYPE=PM;STARTUPDIR='||bootdrive||'\;','R' Call SysCreateObject 'WPProgram','Icon Editor','<TK_DEVTOOLS>','OBJECTID=<TK_ICONEDIT>;EXENAME='||toolpath||'\OS2BIN\ICONEDIT.EXE;PROGTYPE=PM;STARTUPDIR='||bootdrive||'\;','R' Call SysRegisterObjectClass 'WPKlist', toolpath||'\DLL\WPCLSLST.DLL' Call SysCreateObject 'WPKlist', 'WP Class List','<TK_DEVTOOLS>','OBJECTID=<TK_CLIST>' /*****************************************************************************/ /* Update the CONFIG.SYS */ /*****************************************************************************/ Call Tk21ChgConfig End /****************/ /* Exit program */ /****************/ Endit: Exit 0 /***************************/ /* Change the CONFIG.SYS */ /***************************/ Tk21ChgConfig: /* change the config.sys file for Toolkit 2.1 */ '@cls' response='' Say ' Do you want to update 'bootdrive'\CONFIG.SYS?(Y/N)' Parse Upper Pull response If response <> 'N' Then Do Say ' The old 'bootdrive'\CONFIG.SYS will be created called 'bootdrive'\CONFIG.TKT.' Say ' ' Say ' Shutdown and restart your system for these changes to take affect.' Say ' ' End Else return 0 oldconfig=bootdrive'\CONFIG.SYS' newconfig=bootdrive'\CONFIG.TKT' tmpconfig=bootdrive'\TMP.SYS' os2path='SET PATH' os2libpath='LIBPATH' os2help='SET HELP' os2bookshelf='SET BOOKSHELF' os2ipfc='SET IPFC' os2include='SET INCLUDE' os2lib='SET LIB' os2progref21='SET PROGREF21' os2helpndx='SET HELPNDX' os2pmref='SET PMREF' ipfcflag=0 includeflag=0 libflag=0 progref21flag=0 helpndxflag=0 pmrefflag=0 /* get the portion of pathspec without the [drive]: */ pathonly = right(toolpath, length(toolpath)-2) /* * read the file one line at a time, and write it all out, making * changes accordingly - need to change path, libpath, help, bookshelf * ipfc, include, lib */ '@del 'newconfig ' 2>nul >nul' Do while lines(oldconfig) inline=linein(oldconfig) /******************************************/ /* parse the line into variable and value */ /******************************************/ parse value inline with os2var '=' os2value /********************************************************/ /* translate the variable into uppercase for comparison */ /********************************************************/ os2var=translate(os2var) Select /********************************************************/ /* For PATH */ /********************************************************/ when os2var=os2path Then Do tk21line=inline /* see if path is already set */ k = pos(pathonly'\OS2BIN', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\OS2BIN', translate(os2value)) If t <> 0 Then Do l=length(toolpath'\OS2BIN;') tk21line=os2var'='Insert(toolpath'\OS2BIN;', os2value, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',os2value) lenvalue=length(os2value) If position=lenvalue Then do /* ; at end of value */ tk21line=os2var'='os2value''toolpath'\OS2BIN;' End Else Do /* ; NOT at end of value */ tk21line=os2var'='os2value';'toolpath'\OS2BIN;' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For LIBPATH */ /********************************************************/ when os2var=os2libpath Then Do tk21line=inline /* see if lib path is already set */ k = pos(pathonly'\DLL', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\DLL', translate(os2value)) If t <> 0 Then Do l=length(toolpath'\DLL;') tk21line=os2var'='Insert(toolpath'\DLL;', os2value, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',os2value) lenvalue=length(os2value) If position=lenvalue Then Do /* ; at end of value */ tk21line=os2var'='os2value''toolpath'\DLL;' End Else Do /* ; NOT at end of value */ tk21line=os2var'='os2value';'toolpath'\DLL;' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For SET HELP */ /********************************************************/ when os2var=os2help Then Do tk21line=inline /* see if lib path is already set */ k = pos(pathonly'\OS2HELP', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\OS2HELP', translate(os2value)) If t <> 0 Then Do l=length(toolpath'\OS2HELP;') tk21line=os2var'='Insert(toolpath'\OS2HELP;', os2value, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',os2value) lenvalue=length(os2value) If position=lenvalue Then Do /* ; at end of value */ tk21line=os2var'='os2value''toolpath'\OS2HELP;' End Else Do /* ; NOT at end of value */ tk21line=os2var'='os2value';'toolpath'\OS2HELP;' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For SET BOOKSELF */ /********************************************************/ when os2var=os2bookshelf Then Do tk21line=inline /* see if lib path is already set */ k = pos(pathonly'\BOOK', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\BOOK', translate(os2value)) If t <> 0 Then Do l=length(toolpath'\BOOK;') tk21line=os2var'='Insert(toolpath'\BOOK;', os2value, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',os2value) lenvalue=length(os2value) If position=lenvalue Then Do /* ; at end of value */ tk21line=os2var'='os2value''toolpath'\BOOK;' End Else Do /* ; NOT at end of value */ tk21line=os2var'='os2value';'toolpath'\BOOK;' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For SET IPFC */ /********************************************************/ when os2var=os2ipfc Then Do ipfcflag=1 tk21line=inline k = pos(pathonly'\IPFC', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\IPFC', translate(os2value)) If t <> 0 Then Do l=length(toolpath'\IPFC;') tk21line=os2var'='Insert(toolpath'\IPFC;', os2value, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',os2value) lenvalue=length(os2value) If position=lenvalue Then Do /* ; at end of value */ tk21line=os2var'='os2value''toolpath'\IPFC' End Else Do /* ; NOT at end of value */ tk21line=os2var'='os2value';'toolpath'\IPFC' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For SET INCLUDE */ /********************************************************/ when os2var=os2include Then Do includeflag=1 tk21line=inline /* see if C\OS2H path is already set */ k = pos(pathonly'\C\OS2H', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\C\OS2H', translate(os2value)) If t <> 0 Then Do l=length(toolpath'\C\OS2H;') tk21line=os2var'='Insert(toolpath'\C\OS2H;', os2value, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',os2value) lenvalue=length(os2value) If position=lenvalue Then Do /* ; at end of value */ tk21line=os2var'='os2value''toolpath'\C\OS2H;' End Else Do /* ; NOT at end of value */ tk21line=os2var'='os2value';'toolpath'\C\OS2H;' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* see if ASM\OS2INC path is already set */ k = pos(pathonly'\ASM\OS2INC', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\ASM\OS2INC', translate(tk21line)) If t <> 0 Then Do l=length(toolpath'\ASM\OS2INC;') tk21line=Insert(toolpath'\ASM\OS2INC;', tk21line, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',tk21line) lenvalue=length(tk21line) If position=lenvalue Then Do /* ; at end of value */ tk21line=tk21line||toolpath'\ASM\OS2INC;' End Else Do /* ; NOT at end of value */ tk21line=tk21line';'toolpath'\ASM\OS2INC;' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* see if C\OS2H\VDD path is already set */ k = pos(pathonly'\C\OS2H\VDD', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\C\OS2H\VDD', translate(tk21line)) If t <> 0 Then Do l=length(toolpath'\C\OS2H\VDD;') tk21line=Insert(toolpath'\C\OS2H\VDD;', tk21line, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',tk21line) lenvalue=length(tk21line) If position=lenvalue Then Do /* ; at end of value */ tk21line=tk21line''toolpath'\C\OS2H\VDD;' End Else Do /* ; NOT at end of value */ tk21line=tk21line';'toolpath'\C\OS2H\VDD;' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For SET LIB */ /********************************************************/ when os2var=os2lib Then Do libflag=1 tk21line=inline /* see if lib path is already set */ k = pos(pathonly'\OS2LIB', translate(tk21line)) If k = 0 Then Do /* See if Toolkit 2.0 exist */ t = pos('\TOOLKT20\OS2LIB', translate(os2value)) If t <> 0 Then Do l=length(toolpath'\OS2LIB;') tk21line=os2var'='Insert(toolpath'\OS2LIB;', os2value, t-3, l) End Else Do /* * see if there is a ; at the end of the value */ position=lastpos(';',os2value) lenvalue=length(os2value) If position=lenvalue Then Do /* ; at end of value */ tk21line=os2var'='os2value''toolpath'\OS2LIB;' End Else Do /* ; NOT at end of value */ tk21line=os2var'='os2value';'toolpath'\OS2LIB;' End End End Else /* see if the drive letter is not the same */ If substr(tk21line, k-2, 1) \= tooldrive Then /* change the drive letter only */ tk21line = overlay(tooldrive, tk21line, k-2) /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For PROGREF21 */ /********************************************************/ when os2var=os2progref21 Then Do progref21flag=1 tk21line=inline /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For HELPNDX */ /********************************************************/ when os2var=os2helpndx Then Do helpndxflag=1 tk21line=inline /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /********************************************************/ /* For PMREF */ /********************************************************/ when os2var=os2pmref Then Do pmrefflag=1 tk21line=inline /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End otherwise Do /* * write the line out to the new config file */ result=lineout(newconfig, inline) If result=1 Then Do writeerror() return 1 End End End /* select */ End /* Do */ /***************************************************************/ /* if there was no SET IPFC variable set in CONFIG.SYS, Then */ /* put New env. variables */ /***************************************************************/ If ipfcflag=0 Then Do tk21line='SET IPFC='toolpath'\IPFC' /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /******************************************************************/ /* if there was no SET INCLUDE variable set in CONFIG.SYS, Then */ /* put New env. variables */ /******************************************************************/ If includeflag=0 Then Do tk21line='SET INCLUDE='toolpath'\C\OS2H;'toolpath'\C\OS2H\VDD;'toolpath'\ASM\OS2INC;' /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /******************************************************************/ /* if there was no SET LIB variable set in CONFIG.SYS, Then */ /* put New env. variables */ /******************************************************************/ If libflag=0 Then Do tk21line='SET LIB='toolpath'\OS2LIB;' /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /******************************************************************/ /* if there was no SET PROGREF21 variable set in CONFIG.SYS, Then */ /* put New env. variables */ /******************************************************************/ If progref21flag=0 Then Do tk21line='SET PROGREF21=CPGREF1.INF+CPGREF2.INF+CPGREF3.INF' /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /******************************************************************/ /* if there was no SET HELPNDX variable set in CONFIG.SYS, Then */ /* put New env. variables */ /******************************************************************/ If helpndxflag=0 Then Do tk21line='SET HELPNDX=EPMKWHLP.NDX' /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /******************************************************************/ /* if there was no SET PMREF variable set in CONFIG.SYS, Then */ /* put New env. variables */ /******************************************************************/ If pmrefflag=0 Then Do tk21line='SET PMREF=PMFUN.INF+PMGPI.INF+PMHOK.INF+PMMSG.INF+PMREL.INF+PMWIN.INF+PMWKP.INF' /* * write the line out to the new config file */ result=lineout(newconfig, tk21line) If result=1 Then Do writeerror() return 1 End End /*********************/ /* close the files */ /*********************/ result=lineout(newconfig) result=lineout(oldconfig) /******************************************************************/ /* Copy created file(CONFIG.TKT) to temporary file(TMP.SYS), */ /* copy original file(CONFIG.SYS) to new file(CONFIG.TKT), */ /* and copy temporary file(TMP.SYS) to original file(CONFIG.SYS). */ /******************************************************************/ '@copy 'oldconfig' 'tmpconfig' 2>nul >nul' '@copy 'newconfig' 'oldconfig' 2>nul >nul' '@copy 'tmpconfig' 'newconfig' 2>nul >nul' '@del 'tmpconfig' 2>nul >nul' /******************************************************************/ /* Finished the Update */ /******************************************************************/ Say ' ' Say ' 'bootdrive'\CONFIG.SYS updated succesfully.' Say ' ' return 0 writeerror: /* display a write error to the screen */ '@cls' Say ' ' Say ' ' Say ' ***** ERROR *****' Say ' ' Say ' An error occured while attempting to write the ' Say ' 'bootdrive'\CONFIG.SYS file. Check the available disk' Say ' disk space on the current drive and retry the' Say ' install process.' Say ' ' return 0 /********************************/ /* Notify user in case of error */ /********************************/ Telluser: Procedure Parse source . . tell_name . tell_name = Filespec('name',tell_name) Parse Upper Var tell_name tell_name '.' . ulogfile = tell_name If Arg(2,'e') = 0 Then Do Say tell_name||':' Date('U') Time() Arg(1) End Else Do If Arg(2) = 0 Then Do Say tell_name||':' Date('U') Time() Arg(1) End Else Do Say Copies(' ',15+Length(tell_name)) Arg(1) End End Return 0