source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XPDI.m@ 1582

Last change on this file since 1582 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 7.1 KB
RevLine 
[613]1XPDI ;SFISC/RSD - Install Process ;9:53 AM 31 Jan 2008
2 ;;8.0;KERNEL;**10,21,39,41,44,58,68,108,145,184,229**;Jul 10, 1995
3EN ;install
4 N DIR,DIRUT,POP,XPD,XPDA,XPDD,XPDIJ,XPDDIQ,XPDIT,XPDIABT,XPDNM,XPDNOQUE,XPDPKG,XPDREQAB,XPDST,XPDSET,XPDSET1,XPDT,XPDQUIT,XPDQUES,Y,ZTSK,%
5 S %="I '$P(^(0),U,9),$D(^XPD(9.7,""ASP"",Y,1,Y)),$D(^XTMP(""XPDI"",Y))",XPDST=$$LOOK^XPDI1(%)
6 Q:'XPDST!$D(XPDQUIT)
7 S XPDIT=0,(XPDSET,XPDSET1)=$P(^XPD(9.7,XPDST,0),U) K ^TMP($J)
8 ;;
9 ;; Patch checker , points to file # 9.6 ; RED
10 D EN^VEPEFKPC(.XPDT,.XPDQUIT,1053) Q:$D(XPDQUIT) ;VOE 1 Patch
11 D EN^VEPEFKPC(.XPDT,.XPDQUIT,1054) Q:$D(XPDQUIT) ;VOE 1.1 Patch
12 D EN^VEPEFKPC(.XPDT,.XPDQUIT,7397) Q:$D(XPDQUIT) ;NO HOME 1.0 Patch
13 ;
14 ;Check each part of XPDT array
15 F S XPDIT=$O(XPDT(XPDIT)) Q:'XPDIT D Q:'$D(XPDT)!$D(XPDQUIT)
16 .S XPDA=+XPDT(XPDIT),XPDNM=$P(XPDT(XPDIT),U,2),XPDPKG=+$P($G(^XPD(9.7,+XPDT(XPDIT),0)),U,2),%=$P(^(0),U,5)
17 .W !,"Checking Install for Package ",XPDNM
18 .;check that Install file was created correctly
19 .I '$D(^XPD(9.7,XPDA,"INI"))!'$D(^("INIT")) W !,"**INSTALL FILE IS CORRUPTED**",!,*7 S XPDQUIT=1 Q
20 .;run enviroment check routine
21 .;XPDREQAB req. build missing, =2 global killed
22 .I $$ENV^XPDIL1(1) S:$G(XPDREQAB)=2 XPDQUIT=1 Q
23 .;save variables that are setup in environ. chck. routine
24 .I $D(XPDNOQUE)!$D(XPDDIQ) D
25 ..S:$D(XPDNOQUE) ^XTMP("XPDI",XPDA,"ENVVAR","XPDNOQUE")=XPDNOQUE
26 ..I $D(XPDDIQ) M ^XTMP("XPDI",XPDA,"ENVVAR","XPDDIQ")=XPDDIQ
27 .D QUES^XPDI1(XPDA) Q:'$D(XPDT(+XPDIT))!$D(XPDQUIT)
28 .;XPDIJ=XPDA if XPDIJ routine is part of Build
29 .S:$D(^XTMP("XPDI",XPDA,"RTN","XPDIJ")) XPDIJ=XPDA
30 .D XQSET^XPDI1(XPDA)
31 ;NONE = no Build to install
32 G NONE:'$O(XPDT(""))!$D(XPDQUIT)!($G(XPDREQAB))
33 ;check that we have all Builds to install
34 S XPDA=XPDST,XPDNM=XPDSET,Y=0
35 F S Y=$O(^XPD(9.7,"ASP",XPDA,Y)) Q:'Y S %=+$O(^(Y,0)) I '$D(XPDT("DA",%)) G NONE
36 W !
37 ;See if a Master Build
38 S %=$O(^XTMP("XPDI",XPDA,"BLD",0)),%=$P(^(%,0),U,3) S:%=1 XPDT("MASTER")=XPDA
39 ;Inhibit Logon Question
40 D DIR^XPDIQ("XPI") I $D(DIRUT) D ABRTALL(2) Q
41 ;disable options question
42 D DIR^XPDIQ("XPZ") I $D(DIRUT) D ABRTALL(2) Q
43 ;XPDSET=set name,(also build name), of options that will be disabled
44 ;XPDSET1=setname or null if they don't want to disable
45 D I XPDSET1="^" D ABRTALL(2) Q
46 .;if they say no, set XPDET1=""
47 .S:'$G(XPDQUES("XPZ1")) XPDSET1="",Y=0
48 .S ^XTMP("XQOO",XPDSET,0)=XPDSET_" is being installed by KIDS^"_DT_U_DUZ
49 .I XPDSET1]"" D Q:XPDSET1="^"!(XPDSET1="")
50 ..;merge the options/protocols that were put in ^TMP($J,"XQOO",build name)
51 ..M ^XTMP("XQOO",XPDSET)=^TMP($J,"XQOO",XPDSET)
52 ..D INIT^XQOO(.XPDSET1) Q:"^"[XPDSET1
53 ..N DIR S DIR(0)="N^0:60:0",DIR("B")=0
54 ..S DIR("A")="Delay Install (Minutes)",DIR("?")="Enter the number of minutes to delay the installing of Routines after the Disable of Options"
55 ..W ! D ^DIR I $D(DIRUT) S XPDSET1="^"
56 .;Y is set in the call to DIR in previous .DO
57 .;save setname into first Build and the Delay in minutes, Y
58 .K XPD S XPD(9.7,XPDST_",",7)=(XPDSET1]"")_XPDSET,XPD(9.7,XPDST_",",8)=Y
59 .D FILE^DIE("","XPD")
60 ;check if they want to update other CPUs
61 I $G(XPDQUES("XPZ2")) D I $D(DIRUT) D ABRTALL(2) Q
62 .N DA,DIE,DIR,DR,I,XPD,X,Y,Z
63 .;if they haven't already added Volume Sets, populate the mulitple
64 .I '$O(^XPD(9.7,XPDA,"VOL",0)) D I $D(XPD) D UPDATE^DIE("","XPD")
65 ..X ^%ZOSF("UCI") S Y=$P(Y,",",2),(I,Z)=0
66 ..F S I=$O(^%ZIS(14.5,I)) Q:'I S X=$G(^(I,0)) S:$P(X,U)]""&$P(X,U,11)&($P(X,U)'=Y) Z=Z+1,XPD(9.703,"+"_Z_","_XPDA_",",.01)=$P(X,U)
67 .W !!,"I will Update the following VOLUME SETS:",!
68 .S I=0 F S I=$O(^XPD(9.7,XPDA,"VOL",I)) Q:'I W ?3,$P(^(I,0),U),!
69 .W ! S DIR(0)="Y",DIR("A")="Want to edit this list",DIR("B")="NO"
70 .D ^DIR Q:$D(DIRUT) D:Y
71 ..S DA=XPDA,DIE="^XPD(9.7,",DR=30,DR(2,9.703)=".01"
72 ..D ^DIE
73 .I '$O(^XPD(9.7,XPDA,"VOL",0)) W !!,"No VOLUME SETS selected!!" Q
74 .Q:$$TM^%ZTLOAD ;quit if Taskman is running
75 .W !!,"TASKMAN is not running. If you install now, you must run the routine XPDCPU",!,"in the production UCI for each of the VOLUME SETS you have listed once"
76 .W !,"the installation starts!!",!,"If you Queue the install, the VOLUME SETS will be updated automatically.",*7,*7,!!
77DEV S POP=0 S:'$D(^DD(3.5,0)) POP=1
78 ;check if home device is defined
79 I 'POP S IOP="",%ZIS=0 D ^%ZIS
80 ;Kernel Virgin Install
81 I POP S XPDA=XPDST D:$G(XPDIJ) XPDIJ^XPDI1 G EN^XPDIJ
82 ;set XPDA=starting Build, ask for device for messages
83 ;XPDNOQUE is defined means don't let them queue output
84 W !!,"Enter the Device you want to print the Install messages."
85 W:'$D(XPDNOQUE) !,"You can queue the install by enter a 'Q' at the device prompt."
86 W !,"Enter a '^' to abort the install.",!
87 S XPDA=XPDST,%ZIS=$P("Q",U,'$D(XPDNOQUE))
88 D ^%ZIS G:POP ASKABRT
89 ;reset expiration date to T+7 on transport global
90 S XPDD=$$FMADD^XLFDT(DT,7),^XTMP("XPDI",0)=XPDD_U_DT
91 I $D(IO("Q")) D G ASKABRT:$D(ZTSK)[0 D XPDIJ^XPDI1:$G(XPDIJ),QUIT^XPDI1(XPDST) Q
92 . N DIR,NOW S NOW=$$HTFM^XLFDT($$HADD^XLFDT($H,,,2)) ;Must be in future
93 . S DIR(0)="DA^"_NOW_":"_XPDD_":AEFRSX"
94 . S DIR("A")="Request Start Time: "
95 . S DIR("B")=$$FMTE^XLFDT(NOW)
96 . S DIR("?",1)="Enter a Date including Time"
97 . S DIR("?",2)="The time must be in the future and not to exceed 7 days in the future."
98 . S DIR("?")="Current date/time: "_DIR("B")
99 . D ^DIR
100 .Q:$D(DIRUT)
101 .S ZTDTH=Y,ZTRTN="EN^XPDIJ",ZTDESC=XPDNM_" KIDS install",ZTSAVE("XPDA")=""
102 .D ^%ZTLOAD,HOME^%ZIS K IO("Q")
103 .Q:$D(ZTSK)[0
104 .W !,"Install Queued!",!!
105 .;save task into first Build
106 .K XPD S XPD(9.7,XPDST_",",5)=ZTSK,XPDIT=0
107 .F S XPDIT=$O(XPDT(XPDIT)) Q:'XPDIT S XPD(9.7,+XPDT(XPDIT)_",",.02)=1 D FILE^DIE("","XPD") K XPD
108 ;run install
109 U IO D XPDIJ^XPDI1:$G(XPDIJ),QUIT^XPDI1(XPDST) G EN^XPDIJ
110 Q
111 ;
112 ;XPDA=ien to del, XPDK=1 kill global, XPDALL=1 deleting all
113 ;XPDST=starting package.
114ABORT(XPDA,XPDK,XPDALL) ;abort install of Build XPDA
115 N %,DA,DIK,XPDJ,XPDNM,Y
116 Q:'$D(^XPD(9.7,XPDA,0)) S XPDNM=$P(^(0),U)
117 D BMES^XPDUTL(XPDNM_" Build will not be installed"_$S(XPDK=1:", Transport Global deleted!",1:"")),MES^XPDUTL(" "_$$HTE^XLFDT($H))
118 S DIK="^XPD(9.7,",XPDJ=XPDT("NM",XPDNM),DA=XPDA
119 ;kill XPDT array, but don't kill global if XPDK=2
120 K XPDT("NM",XPDNM),XPDT("DA",XPDA),XPDT(XPDJ),XPDT("GP") Q:XPDK=2
121 K ^XTMP("XPDI",XPDA)
122 ;if we are not deleting all packages and we are deleting the starting package
123 ;set the next package to the starting package. It must always be 1.
124 I '$G(XPDALL),XPDA=XPDST S Y=$O(XPDT(0)) D:Y
125 .;unlock starting install
126 .L -^XPD(9.7,XPDST)
127 .S XPDST=+XPDT(Y),XPDT(1)=XPDT(Y),XPDT("DA",XPDST)=1,XPDT("NM",$P(XPDT(Y),U,2))=1,XPDIT=0
128 .K XPDT(Y) N XPD
129 .S %="XPD(9.7,"""_XPDST_","")",@%@(3)=XPDST,@%@(4)=1
130 .;loop thru the rest of the packages and reset the starting package field
131 .F S Y=$O(XPDT(Y)) Q:'Y D
132 ..S XPD(9.7,+XPDT(Y)_",",3)=XPDST
133 .D FILE^DIE("","XPD")
134 D ^DIK
135 Q
136ASKABRT ;ask if want to unload distribution
137 N DIR,DIRUT,X,Y
138 S XPDQUIT=1,DIR(0)="Y",DIR("A")="Install ABORTED, Want to remove the Transport Globals",DIR("B")="YES"
139 W ! D ^DIR I Y D ABRTALL(1) Q
140 L -^XPD(9.7,XPDST)
141 Q
142ABRTALL(XPDK) ;abort all Builds
143 N XPDA
144 S XPDT=0
145 F S XPDT=$O(XPDT(XPDT)) Q:'XPDT S XPDA=+XPDT(XPDT) D ABORT(XPDA,XPDK,1)
146 ;unlock starting install
147 L -^XPD(9.7,XPDST)
148 Q
149NONE W !!,"**NOTHING INSTALLED**",!
150 Q
Note: See TracBrowser for help on using the repository browser.