source: FOIAVistA/trunk/r/FOUNDATIONS-XOBU/XOBUENV.m

Last change on this file was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 7.2 KB
Line 
1XOBUENV ;; ld/alb - VistaLink Environment Check ; 08/08/2003 08:44
2 ;;1.5;Foundations;;Sep 09, 2005
3 ;;Foundations Toolbox Release v1.5 [Build: 1.5.0.026]
4 ;
5 ;
6EN ;- entry point
7 ;
8 ;- programmer variables check
9 DO PROG IF $GET(XPDABORT) GOTO ENQ
10 ;
11 ;- operating system check
12 DO OSCHK IF $GET(XPDABORT) GOTO ENQ
13 ;
14 ;- check for presence of obsolete SYSTEM file (#18)
15 DO FILE18
16 ;
17 ;- passed load check
18 IF '$GET(XPDENV),'$GET(XPDABORT) WRITE !!?1,">>> VistALink environment check completed for KIDS Load a Distribution option.",!
19 ;
20 ;- passed install check
21 IF $GET(XPDENV)=1,'$GET(XPDABORT) WRITE !!?1,">>> VistALink environment check completed for KIDS Install Package option.",!
22 ;
23ENQ QUIT
24 ;
25PROG ;- check enviroment for programmer variables
26 ;
27 WRITE !?1,">>> Checking environment...",!
28 IF +$GET(DUZ)'>0!($GET(DUZ(0))'="@") DO
29 . SET XPDABORT=1
30 . WRITE !," You must first initialize programmer environment by running ^XUP.",!
31 QUIT
32 ;
33OSCHK ;- check enviroment for operating system (DSM or OpenM)
34 ;
35 NEW XOBOS
36 SET XOBOS=$PIECE($GET(^%ZOSF("OS")),"^")
37 IF XOBOS'["DSM"&(XOBOS'["OpenM") DO
38 . SET XPDABORT=1
39 . DO PRNTXT("OSMSG")
40 QUIT
41 ;
42FILE18 ;- check for obsolete Kernel file #18 which is in VistALink's numberspace
43 ;
44 NEW I,LINE,XOBABORT,XOBASK
45 ;
46 ;- file #18 not found
47 IF '$$FILECHK() GOTO FILE18Q
48 ;
49 ;- file found; display user msg
50 DO PRNTXT("INTRO")
51 ;
52 ;- if load, ask if they want file deletion instructions
53 IF 'XPDENV DO GOTO FILE18Q
54 . DO:$$ASKINSTR()>0 TOP,PRNTXT("INSTR1"),PAUSE,PRNTXT("INSTR2"),PAUSE
55 ;
56 ;- if install, ask if user wants to abort install
57 ;- if yes, ask if they want file deletion instructions
58 SET XOBABORT=$$ASKINSTL()
59 IF XOBABORT DO QUIT
60 . IF XOBABORT=1 DO:$$ASKINSTR()>0 TOP,PRNTXT("INSTR1"),PAUSE,PRNTXT("INSTR2"),PAUSE
61 . SET XPDABORT=2
62 ;
63 ;- if user wants to continue install, ask again to be sure
64 IF XOBABORT=0 DO
65 . SET XOBASK=$$REASK()
66 . IF XOBASK<1 DO
67 .. IF XOBASK=0 DO:$$ASKINSTR()>0 TOP,PRNTXT("INSTR1"),PAUSE,PRNTXT("INSTR2"),PAUSE
68 .. SET XPDABORT=2
69FILE18Q QUIT
70 ;
71ASKINSTL() ;- ask if user wants to abort install
72 ;
73 NEW XOB0,XOBA,XOBARR,XOBB
74 SET XOB0="YAO"
75 SET XOBA=" Do you want to abort the installation now? "
76 SET XOBB="YES"
77 SET XOBARR(1)=" NOTE:"
78 SET XOBARR(2)=" If you choose to abort the installation, please do a global listing"
79 SET XOBARR(3)=" of file ^DIC(18, and ^DD(18, after deleting the file to ensure that"
80 SET XOBARR(4)=" the SYSTEM file (#18) is completely deleted from your system before"
81 SET XOBARR(5)=" reinstalling the VistALink package. If you need additional help"
82 SET XOBARR(6)=" deleting the file, please contact National VistA Support (NVS)."
83 SET XOBARR(7)=" "
84 QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
85 ;
86REASK() ;- ask user again if they want to continue with install (pre-init will
87 ; delete file #18)
88 ;
89 NEW XOB0,XOBA,XOBARR,XOBB
90 SET XOB0="YAO"
91 SET XOBA=" Are you sure you want to continue? "
92 SET XOBB="NO"
93 SET XOBARR(1)=" "
94 SET XOBARR(2)=" NOTE:"
95 SET XOBARR(3)=" Continuing with the installation will delete the SYSTEM file (#18)"
96 SET XOBARR(4)=" using the FileMan Data Dictionary Deletion call (EN^DIU2)."
97 SET XOBARR(5)=" "
98 QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
99 ;
100ASKINSTR() ;- ask if user wants file deletion instructions
101 ;
102 NEW XOB0,XOBA,XOBARR,XOBB
103 SET XOB0="YAO"
104 SET XOBA=" Would you like instructions on how to delete SYSTEM file (#18)? "
105 SET XOBB="YES"
106 SET XOBARR(1)=" "
107 QUIT $$ANSWER(XOB0,XOBA,XOBB,.XOBARR)
108 ;
109ANSWER(XOB0,XOBA,XOBB,XOBARR) ;wrap FileMan DIR Reader call
110 ;
111 ; Input:
112 ; XOB0 - DIR(0) string
113 ; XOBA - DIR("A") string
114 ; XOBB - DIR("B") string
115 ; XOBARR - DIR("A",x) string
116 ;
117 ; Output:
118 ; Function Value - Internal value returned from ^DIR (0 for No, 1 for
119 ; YES) or -1 if user up-arrows or the read times out.
120 ;
121 NEW DIR,DIRUT,X,Y ; ^DIR variables
122 ;
123 SET DIR(0)=XOB0
124 SET DIR("A")=$GET(XOBA)
125 IF $DATA(XOBARR)>1 MERGE DIR("A")=XOBARR
126 IF $GET(XOBB)'="" SET DIR("B")=XOBB
127 DO ^DIR KILL DIR
128 QUIT $SELECT($DATA(DIRUT):-1,1:$PIECE(Y,U))
129 ;
130FILECHK() ;- Check for file 18
131 ;
132 NEW XOBA,XOBFIL
133 SET XOBA=0
134 DO FILE^DID(18,"","NAME","XOBFIL")
135 IF $GET(XOBFIL("NAME"))="SYSTEM",($$VFILE^DILFD(18)) SET XOBA=1
136 IF $DATA(^DIC(18))!$DATA(^DD(18)) SET XOBA=1
137 QUIT XOBA
138 ;
139PRNTXT(TEXT) ;- display user text
140 ;
141 QUIT:$GET(TEXT)=""
142 NEW I,LINE
143 FOR I=1:1 SET LINE=$PIECE($TEXT(@TEXT+I),";;",2) QUIT:LINE="$END" WRITE !,LINE
144 QUIT
145 ;
146TOP ;- top of screen
147 ;
148 QUIT:$EXTRACT(IOST,1,2)'="C-"
149 IF $Y>1 WRITE @IOF
150 QUIT
151 ;
152PAUSE ;- enhance readability of text
153 ;
154 QUIT:$EXTRACT(IOST,1,2)'="C-"
155 WRITE ! SET DIR(0)="E",DIR("A")="Press return to continue" DO ^DIR KILL DIR WRITE !
156 QUIT
157 ;
158INTRO ;- display message to user explaining file #18
159 ;; >>>>>>>>>> ATTENTION: File SYSTEM (#18) was found on your system. <<<<<<<<<<
160 ;;
161 ;; SYSTEM file #18 was the precursor to the KERNEL SYSTEMS PARAMETER
162 ;; file and is obsolete. The SYSTEM file uses the same numberspace
163 ;; that VistALink is assigned and must be deleted before VistALink
164 ;; can be installed. You may wish to manually backup and manually
165 ;; delete file #18.
166 ;;
167 ;; If you do not manually delete file #18 and it is still on your system
168 ;; during the installation phase, you will be prompted with a series of
169 ;; questions. The questions will allow you to abort the installation or
170 ;; allow the installation to safely delete the SYSTEM file for you.
171 ;;
172 ;;$END
173 ;
174INSTR1 ;- user instructions to delete file #18
175 ;;
176 ;;
177 ;; ******** How to delete the SYSTEM file (#18) ********
178 ;;
179 ;;
180 ;; 1) From the programmer prompt, go to the FileMan main menu
181 ;;
182 ;; 2) Choose option 6, UTILITY FUNCTIONS
183 ;;
184 ;; 3) Choose option 6, EDIT FILE
185 ;;
186 ;; 4) MODIFY WHAT FILE: // 18 SYSTEM
187 ;;
188 ;; 5) Do you want to use the screen-mode version? YES// YES
189 ;; (recommend using screen-mode because you can exit out without
190 ;; saving your changes if necessary)
191 ;;
192 ;; 6) At the FILE NAME: prompt (which should have the name SYSTEM
193 ;; in it), type @
194 ;;$END
195 ;
196INSTR2 ;- user instructions to delete file #18 (continued)
197 ;;
198 ;;
199 ;; 7) It will then ask the following questions:
200 ;; DO YOU WANT JUST TO DELETE THE FILE CONTENTS,
201 ;; & KEEP THE FILE DEFINITION? No// No (No)
202 ;; IS IT OK TO DELETE THE '^DIC(18)' GLOBAL? Yes// Yes (Yes)
203 ;; SURE YOU WANT TO DELETE THE ENTIRE FILE? No// Yes (Yes)
204 ;; Deleting the DATA DICTIONARY...
205 ;; Deleting the INPUT TEMPLATES....
206 ;; Deleting the PRINT TEMPLATES...
207 ;; Deleting the SORT TEMPLATES...
208 ;; Deleting the FORMS...
209 ;;
210 ;; 8) The last step is a global listing to check that file #18 and its DD
211 ;; have been deleted. Here's an example:
212 ;; cor> D ^%G
213 ;; Global ^DIC(18,
214 ;; DIC(18,
215 ;; Global ^DD(18,
216 ;; DD(18,
217 ;; Global ^
218 ;;$END
219 ;
220OSMSG ;- Message to user if operating system is not Cache or DSM
221 ;;
222 ;; VistALink has been tested on Cache and DSM. It has not been tested
223 ;; or programmed to be compatible yet on other M implementations,
224 ;; therefore installation will abort.
225 ;;
226 ;;$END
227 ;
Note: See TracBrowser for help on using the repository browser.