XOBUENV ;; ld/alb - VistaLink Environment Check ; 08/08/2003 08:44
;;1.5;Foundations;;Sep 09, 2005
;;Foundations Toolbox Release v1.5 [Build: 1.5.0.026]
;
;
EN ;- entry point
;
;- programmer variables check
DO PROG IF $GET(XPDABORT) GOTO ENQ
;
;- operating system check
DO OSCHK IF $GET(XPDABORT) GOTO ENQ
;
;- check for presence of obsolete SYSTEM file (#18)
DO FILE18
;
;- passed load check
IF '$GET(XPDENV),'$GET(XPDABORT) WRITE !!?1,">>> VistALink environment check completed for KIDS Load a Distribution option.",!
;
;- passed install check
IF $GET(XPDENV)=1,'$GET(XPDABORT) WRITE !!?1,">>> VistALink environment check completed for KIDS Install Package option.",!
;
ENQ QUIT
;
PROG ;- check enviroment for programmer variables
;
WRITE !?1,">>> Checking environment...",!
IF +$GET(DUZ)'>0!($GET(DUZ(0))'="@") DO
. SET XPDABORT=1
. WRITE !," You must first initialize programmer environment by running ^XUP.",!
QUIT
;
OSCHK ;- check enviroment for operating system (DSM or OpenM)
;
NEW XOBOS
SET XOBOS=$PIECE($GET(^%ZOSF("OS")),"^")
IF XOBOS'["DSM"&(XOBOS'["OpenM") DO
. SET XPDABORT=1
. DO PRNTXT("OSMSG")
QUIT
;
FILE18 ;- check for obsolete Kernel file #18 which is in VistALink's numberspace
;
NEW I,LINE,XOBABORT,XOBASK
;
;- file #18 not found
IF '$$FILECHK() GOTO FILE18Q
;
;- file found; display user msg
DO PRNTXT("INTRO")
;
;- if load, ask if they want file deletion instructions
IF 'XPDENV DO GOTO FILE18Q
. DO:$$ASKINSTR()>0 TOP,PRNTXT("INSTR1"),PAUSE,PRNTXT("INSTR2"),PAUSE
;
;- if install, ask if user wants to abort install
;- if yes, ask if they want file deletion instructions
SET XOBABORT=$$ASKINSTL()
IF XOBABORT DO QUIT
. IF XOBABORT=1 DO:$$ASKINSTR()>0 TOP,PRNTXT("INSTR1"),PAUSE,PRNTXT("INSTR2"),PAUSE
. SET XPDABORT=2
;
;- if user wants to continue install, ask again to be sure
IF XOBABORT=0 DO
. SET XOBASK=$$REASK()
. IF XOBASK<1 DO
.. IF XOBASK=0 DO:$$ASKINSTR()>0 TOP,PRNTXT("INSTR1"),PAUSE,PRNTXT("INSTR2"),PAUSE
.. SET XPDABORT=2
FILE18Q QUIT
;
ASKINSTL() ;- ask if user wants to abort install
;
NEW XOB0,XOBA,XOBARR,XOBB
SET XOB0="YAO"
SET XOBA=" Do you want to abort the installation now? "
SET XOBB="YES"
SET XOBARR(1)=" NOTE:"
SET XOBARR(2)=" If you choose to abort the installation, please do a global listing"
SET XOBARR(3)=" of file ^DIC(18, and ^DD(18, after deleting the file to ensure that"
SET XOBARR(4)=" the SYSTEM file (#18) is completely deleted from your system before"
SET XOBARR(5)=" reinstalling the VistALink package. If you need additional help"
SET XOBARR(6)=" deleting the file, please contact National VistA Support (NVS)."
SET XOBARR(7)=" "
QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
;
REASK() ;- ask user again if they want to continue with install (pre-init will
; delete file #18)
;
NEW XOB0,XOBA,XOBARR,XOBB
SET XOB0="YAO"
SET XOBA=" Are you sure you want to continue? "
SET XOBB="NO"
SET XOBARR(1)=" "
SET XOBARR(2)=" NOTE:"
SET XOBARR(3)=" Continuing with the installation will delete the SYSTEM file (#18)"
SET XOBARR(4)=" using the FileMan Data Dictionary Deletion call (EN^DIU2)."
SET XOBARR(5)=" "
QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
;
ASKINSTR() ;- ask if user wants file deletion instructions
;
NEW XOB0,XOBA,XOBARR,XOBB
SET XOB0="YAO"
SET XOBA=" Would you like instructions on how to delete SYSTEM file (#18)? "
SET XOBB="YES"
SET XOBARR(1)=" "
QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
;
ANSWER(XOB0,XOBA,XOBB,XOBARR) ;wrap FileMan DIR Reader call
;
; Input:
; XOB0 - DIR(0) string
; XOBA - DIR("A") string
; XOBB - DIR("B") string
; XOBARR - DIR("A",x) string
;
; Output:
; Function Value - Internal value returned from ^DIR (0 for No, 1 for
; YES) or -1 if user up-arrows or the read times out.
;
NEW DIR,DIRUT,X,Y ; ^DIR variables
;
SET DIR(0)=XOB0
SET DIR("A")=$GET(XOBA)
IF $DATA(XOBARR)>1 MERGE DIR("A")=XOBARR
IF $GET(XOBB)'="" SET DIR("B")=XOBB
DO ^DIR KILL DIR
QUIT $SELECT($DATA(DIRUT):-1,1:$PIECE(Y,U))
;
FILECHK() ;- Check for file 18
;
NEW XOBA,XOBFIL
SET XOBA=0
DO FILE^DID(18,"","NAME","XOBFIL")
IF $GET(XOBFIL("NAME"))="SYSTEM",($$VFILE^DILFD(18)) SET XOBA=1
IF $DATA(^DIC(18))!$DATA(^DD(18)) SET XOBA=1
QUIT XOBA
;
PRNTXT(TEXT) ;- display user text
;
QUIT:$GET(TEXT)=""
NEW I,LINE
FOR I=1:1 SET LINE=$PIECE($TEXT(@TEXT+I),";;",2) QUIT:LINE="$END" WRITE !,LINE
QUIT
;
TOP ;- top of screen
;
QUIT:$EXTRACT(IOST,1,2)'="C-"
IF $Y>1 WRITE @IOF
QUIT
;
PAUSE ;- enhance readability of text
;
QUIT:$EXTRACT(IOST,1,2)'="C-"
WRITE ! SET DIR(0)="E",DIR("A")="Press return to continue" DO ^DIR KILL DIR WRITE !
QUIT
;
INTRO ;- display message to user explaining file #18
;; >>>>>>>>>> ATTENTION: File SYSTEM (#18) was found on your system. <<<<<<<<<<
;;
;; SYSTEM file #18 was the precursor to the KERNEL SYSTEMS PARAMETER
;; file and is obsolete. The SYSTEM file uses the same numberspace
;; that VistALink is assigned and must be deleted before VistALink
;; can be installed. You may wish to manually backup and manually
;; delete file #18.
;;
;; If you do not manually delete file #18 and it is still on your system
;; during the installation phase, you will be prompted with a series of
;; questions. The questions will allow you to abort the installation or
;; allow the installation to safely delete the SYSTEM file for you.
;;
;;$END
;
INSTR1 ;- user instructions to delete file #18
;;
;;
;; ******** How to delete the SYSTEM file (#18) ********
;;
;;
;; 1) From the programmer prompt, go to the FileMan main menu
;;
;; 2) Choose option 6, UTILITY FUNCTIONS
;;
;; 3) Choose option 6, EDIT FILE
;;
;; 4) MODIFY WHAT FILE: // 18 SYSTEM
;;
;; 5) Do you want to use the screen-mode version? YES// YES
;; (recommend using screen-mode because you can exit out without
;; saving your changes if necessary)
;;
;; 6) At the FILE NAME: prompt (which should have the name SYSTEM
;; in it), type @
;;$END
;
INSTR2 ;- user instructions to delete file #18 (continued)
;;
;;
;; 7) It will then ask the following questions:
;; DO YOU WANT JUST TO DELETE THE FILE CONTENTS,
;; & KEEP THE FILE DEFINITION? No// No (No)
;; IS IT OK TO DELETE THE '^DIC(18)' GLOBAL? Yes// Yes (Yes)
;; SURE YOU WANT TO DELETE THE ENTIRE FILE? No// Yes (Yes)
;; Deleting the DATA DICTIONARY...
;; Deleting the INPUT TEMPLATES....
;; Deleting the PRINT TEMPLATES...
;; Deleting the SORT TEMPLATES...
;; Deleting the FORMS...
;;
;; 8) The last step is a global listing to check that file #18 and its DD
;; have been deleted. Here's an example:
;; cor> D ^%G
;; Global ^DIC(18,
;; DIC(18,
;; Global ^DD(18,
;; DD(18,
;; Global ^
;;$END
;
OSMSG ;- Message to user if operating system is not Cache or DSM
;;
;; VistALink has been tested on Cache and DSM. It has not been tested
;; or programmed to be compatible yet on other M implementations,
;; therefore installation will abort.
;;
;;$END
;
XOBUENV ;; ld/alb - VistaLink Environment Check ; 08/08/2003 08:44
+1 ;;1.5;Foundations;;Sep 09, 2005
+2 ;;Foundations Toolbox Release v1.5 [Build: 1.5.0.026]
+3 ;
+4 ;
EN ;- entry point
+1 ;
+2 ;- programmer variables check
+3 DO PROG
IF $GET(XPDABORT)
GOTO ENQ
+4 ;
+5 ;- operating system check
+6 DO OSCHK
IF $GET(XPDABORT)
GOTO ENQ
+7 ;
+8 ;- check for presence of obsolete SYSTEM file (#18)
+9 DO FILE18
+10 ;
+11 ;- passed load check
+12 IF '$GET(XPDENV)
IF '$GET(XPDABORT)
WRITE !!?1,">>> VistALink environment check completed for KIDS Load a Distribution option.",!
+13 ;
+14 ;- passed install check
+15 IF $GET(XPDENV)=1
IF '$GET(XPDABORT)
WRITE !!?1,">>> VistALink environment check completed for KIDS Install Package option.",!
+16 ;
ENQ QUIT
+1 ;
PROG ;- check enviroment for programmer variables
+1 ;
+2 WRITE !?1,">>> Checking environment...",!
+3 IF +$GET(DUZ)'>0!($GET(DUZ(0))'="@")
Begin DoDot:1
+4 SET XPDABORT=1
+5 WRITE !," You must first initialize programmer environment by running ^XUP.",!
End DoDot:1
+6 QUIT
+7 ;
OSCHK ;- check enviroment for operating system (DSM or OpenM)
+1 ;
+2 NEW XOBOS
+3 SET XOBOS=$PIECE($GET(^%ZOSF("OS")),"^")
+4 IF XOBOS'["DSM"&(XOBOS'["OpenM")
Begin DoDot:1
+5 SET XPDABORT=1
+6 DO PRNTXT("OSMSG")
End DoDot:1
+7 QUIT
+8 ;
FILE18 ;- check for obsolete Kernel file #18 which is in VistALink's numberspace
+1 ;
+2 NEW I,LINE,XOBABORT,XOBASK
+3 ;
+4 ;- file #18 not found
+5 IF '$$FILECHK()
GOTO FILE18Q
+6 ;
+7 ;- file found; display user msg
+8 DO PRNTXT("INTRO")
+9 ;
+10 ;- if load, ask if they want file deletion instructions
+11 IF 'XPDENV
Begin DoDot:1
+12 IF $$ASKINSTR()>0
DO TOP
DO PRNTXT("INSTR1")
DO PAUSE
DO PRNTXT("INSTR2")
DO PAUSE
End DoDot:1
GOTO FILE18Q
+13 ;
+14 ;- if install, ask if user wants to abort install
+15 ;- if yes, ask if they want file deletion instructions
+16 SET XOBABORT=$$ASKINSTL()
+17 IF XOBABORT
Begin DoDot:1
+18 IF XOBABORT=1
IF $$ASKINSTR()>0
DO TOP
DO PRNTXT("INSTR1")
DO PAUSE
DO PRNTXT("INSTR2")
DO PAUSE
+19 SET XPDABORT=2
End DoDot:1
QUIT
+20 ;
+21 ;- if user wants to continue install, ask again to be sure
+22 IF XOBABORT=0
Begin DoDot:1
+23 SET XOBASK=$$REASK()
+24 IF XOBASK<1
Begin DoDot:2
+25 IF XOBASK=0
IF $$ASKINSTR()>0
DO TOP
DO PRNTXT("INSTR1")
DO PAUSE
DO PRNTXT("INSTR2")
DO PAUSE
+26 SET XPDABORT=2
End DoDot:2
End DoDot:1
FILE18Q QUIT
+1 ;
ASKINSTL() ;- ask if user wants to abort install
+1 ;
+2 NEW XOB0,XOBA,XOBARR,XOBB
+3 SET XOB0="YAO"
+4 SET XOBA=" Do you want to abort the installation now? "
+5 SET XOBB="YES"
+6 SET XOBARR(1)=" NOTE:"
+7 SET XOBARR(2)=" If you choose to abort the installation, please do a global listing"
+8 SET XOBARR(3)=" of file ^DIC(18, and ^DD(18, after deleting the file to ensure that"
+9 SET XOBARR(4)=" the SYSTEM file (#18) is completely deleted from your system before"
+10 SET XOBARR(5)=" reinstalling the VistALink package. If you need additional help"
+11 SET XOBARR(6)=" deleting the file, please contact National VistA Support (NVS)."
+12 SET XOBARR(7)=" "
+13 QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
+14 ;
REASK() ;- ask user again if they want to continue with install (pre-init will
+1 ; delete file #18)
+2 ;
+3 NEW XOB0,XOBA,XOBARR,XOBB
+4 SET XOB0="YAO"
+5 SET XOBA=" Are you sure you want to continue? "
+6 SET XOBB="NO"
+7 SET XOBARR(1)=" "
+8 SET XOBARR(2)=" NOTE:"
+9 SET XOBARR(3)=" Continuing with the installation will delete the SYSTEM file (#18)"
+10 SET XOBARR(4)=" using the FileMan Data Dictionary Deletion call (EN^DIU2)."
+11 SET XOBARR(5)=" "
+12 QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
+13 ;
ASKINSTR() ;- ask if user wants file deletion instructions
+1 ;
+2 NEW XOB0,XOBA,XOBARR,XOBB
+3 SET XOB0="YAO"
+4 SET XOBA=" Would you like instructions on how to delete SYSTEM file (#18)? "
+5 SET XOBB="YES"
+6 SET XOBARR(1)=" "
+7 QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
+8 ;
ANSWER(XOB0,XOBA,XOBB,XOBARR) ;wrap FileMan DIR Reader call
+1 ;
+2 ; Input:
+3 ; XOB0 - DIR(0) string
+4 ; XOBA - DIR("A") string
+5 ; XOBB - DIR("B") string
+6 ; XOBARR - DIR("A",x) string
+7 ;
+8 ; Output:
+9 ; Function Value - Internal value returned from ^DIR (0 for No, 1 for
+10 ; YES) or -1 if user up-arrows or the read times out.
+11 ;
+12 ; ^DIR variables
NEW DIR,DIRUT,X,Y
+13 ;
+14 SET DIR(0)=XOB0
+15 SET DIR("A")=$GET(XOBA)
+16 IF $DATA(XOBARR)>1
MERGE DIR("A")=XOBARR
+17 IF $GET(XOBB)'=""
SET DIR("B")=XOBB
+18 DO ^DIR
KILL DIR
+19 QUIT $SELECT($DATA(DIRUT):-1,1:$PIECE(Y,U))
+20 ;
FILECHK() ;- Check for file 18
+1 ;
+2 NEW XOBA,XOBFIL
+3 SET XOBA=0
+4 DO FILE^DID(18,"","NAME","XOBFIL")
+5 IF $GET(XOBFIL("NAME"))="SYSTEM"
IF ($$VFILE^DILFD(18))
SET XOBA=1
+6 IF $DATA(^DIC(18))!$DATA(^DD(18))
SET XOBA=1
+7 QUIT XOBA
+8 ;
PRNTXT(TEXT) ;- display user text
+1 ;
+2 IF $GET(TEXT)=""
QUIT
+3 NEW I,LINE
+4 FOR I=1:1
SET LINE=$PIECE($TEXT(@TEXT+I),";;",2)
IF LINE="$END"
QUIT
WRITE !,LINE
+5 QUIT
+6 ;
TOP ;- top of screen
+1 ;
+2 IF $EXTRACT(IOST,1,2)'="C-"
QUIT
+3 IF $Y>1
WRITE @IOF
+4 QUIT
+5 ;
PAUSE ;- enhance readability of text
+1 ;
+2 IF $EXTRACT(IOST,1,2)'="C-"
QUIT
+3 WRITE !
SET DIR(0)="E"
SET DIR("A")="Press return to continue"
DO ^DIR
KILL DIR
WRITE !
+4 QUIT
+5 ;
INTRO ;- display message to user explaining file #18
+1 ;; >>>>>>>>>> ATTENTION: File SYSTEM (#18) was found on your system. <<<<<<<<<<
+2 ;;
+3 ;; SYSTEM file #18 was the precursor to the KERNEL SYSTEMS PARAMETER
+4 ;; file and is obsolete. The SYSTEM file uses the same numberspace
+5 ;; that VistALink is assigned and must be deleted before VistALink
+6 ;; can be installed. You may wish to manually backup and manually
+7 ;; delete file #18.
+8 ;;
+9 ;; If you do not manually delete file #18 and it is still on your system
+10 ;; during the installation phase, you will be prompted with a series of
+11 ;; questions. The questions will allow you to abort the installation or
+12 ;; allow the installation to safely delete the SYSTEM file for you.
+13 ;;
+14 ;;$END
+15 ;
INSTR1 ;- user instructions to delete file #18
+1 ;;
+2 ;;
+3 ;; ******** How to delete the SYSTEM file (#18) ********
+4 ;;
+5 ;;
+6 ;; 1) From the programmer prompt, go to the FileMan main menu
+7 ;;
+8 ;; 2) Choose option 6, UTILITY FUNCTIONS
+9 ;;
+10 ;; 3) Choose option 6, EDIT FILE
+11 ;;
+12 ;; 4) MODIFY WHAT FILE: // 18 SYSTEM
+13 ;;
+14 ;; 5) Do you want to use the screen-mode version? YES// YES
+15 ;; (recommend using screen-mode because you can exit out without
+16 ;; saving your changes if necessary)
+17 ;;
+18 ;; 6) At the FILE NAME: prompt (which should have the name SYSTEM
+19 ;; in it), type @
+20 ;;$END
+21 ;
INSTR2 ;- user instructions to delete file #18 (continued)
+1 ;;
+2 ;;
+3 ;; 7) It will then ask the following questions:
+4 ;; DO YOU WANT JUST TO DELETE THE FILE CONTENTS,
+5 ;; & KEEP THE FILE DEFINITION? No// No (No)
+6 ;; IS IT OK TO DELETE THE '^DIC(18)' GLOBAL? Yes// Yes (Yes)
+7 ;; SURE YOU WANT TO DELETE THE ENTIRE FILE? No// Yes (Yes)
+8 ;; Deleting the DATA DICTIONARY...
+9 ;; Deleting the INPUT TEMPLATES....
+10 ;; Deleting the PRINT TEMPLATES...
+11 ;; Deleting the SORT TEMPLATES...
+12 ;; Deleting the FORMS...
+13 ;;
+14 ;; 8) The last step is a global listing to check that file #18 and its DD
+15 ;; have been deleted. Here's an example:
+16 ;; cor> D ^%G
+17 ;; Global ^DIC(18,
+18 ;; DIC(18,
+19 ;; Global ^DD(18,
+20 ;; DD(18,
+21 ;; Global ^
+22 ;;$END
+23 ;
OSMSG ;- Message to user if operating system is not Cache or DSM
+1 ;;
+2 ;; VistALink has been tested on Cache and DSM. It has not been tested
+3 ;; or programmed to be compatible yet on other M implementations,
+4 ;; therefore installation will abort.
+5 ;;
+6 ;;$END
+7 ;