source: FOIAVistA/tag/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XPDIJ1.m@ 1096

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

initial load of FOIAVistA 6/30/08 version

File size: 5.5 KB
Line 
1XPDIJ1 ;SFISC/RSD - Cont. of Install Job ;05/11/2001 09:07
2 ;;8.0;KERNEL;**41,68,108,200**;Jul 10, 1995
3IN ;install XPDA
4 ;XPDA=ien of file 9.7, XPDNM=package name
5 Q:'$D(^XTMP("XPDI",XPDA))!'$D(^XPD(9.7,XPDA,0))
6 ;check if already installed
7 I $P($G(^XPD(9.7,XPDA,1)),U,3) D BMES^XPDUTL(" "_XPDNM_" Already Installed ") Q
8 N DIFROM,XPD,XPD0,XPDBLD,XPDCHECK,XPDCP,XPDI,XPDGREF,XPDIST,XPDIDTOT,XPDIDCNT,XPDIDMOD,XPDRTN
9 ;XPDBLD subscript for build entry i.e. ^XTMP("XPDI",XPDA,"BLD",XPDBLD
10 S DIFROM=$$VER^XPDUTL(XPDNM),XPDBLD=$O(^XTMP("XPDI",XPDA,"BLD",0)),XPDGREF="^XTMP(""XPDI"","_XPDA_",""TEMP"")"
11 D TITLE^XPDID(XPDNM)
12 ;the $T is there only for installing patch 41 to prevent a noline error
13 ;check that Package file has entry
14 I $T(PKGADD^XPDIP)]"" S Y=$$PKGADD^XPDIP
15 S XPD0=^XTMP("XPDI",XPDA,"BLD",XPDBLD,0)
16 I '$$CHK(11) D
17 .D BMES^XPDUTL(" Install Started for "_XPDNM_" : "),STMP(11)
18 .;update status, installed by fields and distribution date
19 .S XPD(9.7,XPDA_",",.02)=2,XPD(9.7,XPDA_",",9)=DUZ,XPD(9.7,XPDA_",",51)=$P(XPD0,U,4)
20 .D FILE^DIE("","XPD")
21 E D BMES^XPDUTL(" Install Restarted for "_XPDNM_" at "_$$HTE^XLFDT($H))
22 D BMES^XPDUTL("Build Distribution Date: "_$$FMTE^XLFDT($P(XPD0,U,4)))
23 D RTN Q:$D(XPDABORT)
24 D PRE Q:$D(XPDABORT)
25 D FMDATA Q:$D(XPDABORT)
26 D COMP Q:$D(XPDABORT)
27 D POST:$G(XPDT("MASTER"))'=XPDA
28 Q ;Finshed
29 ;
30RTN I '$$CHK(12) D
31 .D BMES^XPDUTL(" Installing Routines:"),SETTOT^XPDID(9.8),RTN^XPDIJ(XPDA),STMP(12)
32 E D BMES^XPDUTL(" Routines already installed.")
33 Q
34 ;
35PRE S XPDCP="INI"
36 ;check if pre-install has completed
37 I '$$VERCP^XPDUTL("XPD PREINSTALL COMPLETED") D Q:$D(XPDABORT)
38 .;setup XPDQUES array with pre-install questions/answers
39 .D QUES^XPDIQ("PRE")
40 .;XPDCHECK=ien of current checkpoint, (0)=name of checkpoint
41 .;XPDCP="INI"-pre install or "INIT"-post install
42 .;loop thru check points starting with INSTALL STARTED
43 .S XPDCHECK=1
44 .F S XPDCHECK=$O(^XPD(9.7,XPDA,"INI",XPDCHECK)) Q:'XPDCHECK S XPD=^(XPDCHECK,0) D Q:$D(XPDABORT)
45 ..;if there is no call back, quit
46 ..Q:$G(^XPD(9.7,XPDA,"INI",XPDCHECK,1))="" S XPDRTN=^(1)
47 ..;check if checkpoint has been completed
48 ..Q:$P(XPD,U,2)
49 ..I XPDCHECK=2 D BMES^XPDUTL(" Running Pre-Install Routine: "_XPDRTN)
50 ..;zero the progress bar
51 ..I $D(XPDIDVT) S XPDIDTOT=0 D UPDATE^XPDID(0)
52 ..D @XPDRTN
53 ..;write message and abort if developer wants
54 ..I $D(XPDABORT) D BMES^XPDUTL("Install ** ABORTED ** in Pre-Install program") Q
55 ..S %=$$COMCP^XPDUTL(XPDCHECK)
56 .Q:$D(XPDABORT)
57 .;complete pre-init check point
58 .S %=$$COMCP^XPDUTL("XPD PREINSTALL COMPLETED")
59 E D BMES^XPDUTL(" Pre-Install already finished.")
60 Q
61 ;
62FMDATA ;build XPDQUES arrays for all of the FM Files
63 D QUES^XPDIQ("XPF")
64 ;check the last file and see if it's already installed
65 S XPD=$G(^(+$O(^XPD(9.7,XPDA,4,"A"),-1),0))
66 I '$P(XPD,U,2) D:$D(^XTMP("XPDI",XPDA,"FIA"))
67 .D BMES^XPDUTL(" Installing Data Dictionaries: "),SETTOT^XPDID(4),FIA^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
68 E D BMES^XPDUTL(" Data Dictionaries already installed.")
69 S %=+$O(^XTMP("XPDI",XPDA,"DATA",""),-1),XPD=$G(^XPD(9.7,XPDA,4,%,0))
70 I '$P(XPD,U,3) D:%
71 .D BMES^XPDUTL(" Installing Data: "),DAT^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
72 E D BMES^XPDUTL(" Data already installed.")
73 Q
74 ;
75COMP S (%,XPD)=""
76 F S %=+$O(^XPD(9.7,XPDA,"KRN",%)) Q:'% S XPD=$G(^(%,0)) Q:'$P(XPD,U,2)
77 I '$P(XPD,U,2) D:$D(^XTMP("XPDI",XPDA,"KRN"))
78 .D BMES^XPDUTL(" Installing PACKAGE COMPONENTS: "),KRN^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
79 E D BMES^XPDUTL(" PACKAGE COMPONENTS already installed.")
80 Q
81 ;
82POST S XPDCP="INIT"
83 ;check if post-install has completed
84 I '$$VERCP^XPDUTL("XPD POSTINSTALL COMPLETED") D Q:$D(XPDABORT)
85 .;setup XPDQUES array with post-install questions/answers
86 .D QUES^XPDIQ("POS")
87 .;loop thru check points starting with INSTALL STARTED
88 .S XPDCHECK=1
89 .F S XPDCHECK=$O(^XPD(9.7,XPDA,"INIT",XPDCHECK)) Q:'XPDCHECK S XPD=^(XPDCHECK,0) D Q:$D(XPDABORT)
90 ..;if there is no call back, quit
91 ..Q:$G(^XPD(9.7,XPDA,"INIT",XPDCHECK,1))="" S XPDRTN=^(1)
92 ..;quit if checkpoint has completed time
93 ..Q:$P(XPD,U,2)
94 ..I XPDCHECK=2 D BMES^XPDUTL(" Running Post-Install Routine: "_XPDRTN)
95 ..;zero the progress bar
96 ..I $D(XPDIDVT) S XPDIDTOT=0 D UPDATE^XPDID(0)
97 ..D @XPDRTN
98 ..;write message and abort if developer wants
99 ..I $D(XPDABORT) D BMES^XPDUTL("Install ** ABORTED ** in Post-Install program") Q
100 ..S %=$$COMCP^XPDUTL(XPDCHECK)
101 .Q:$D(XPDABORT)
102 .;complete post-init check point
103 .S %=$$COMCP^XPDUTL("XPD POSTINSTALL COMPLETED")
104 E D BMES^XPDUTL(" Post-Install already finished.")
105 ;move routines to install file & Routine file
106 D BMES^XPDUTL(" Updating Routine file..."),SETTOT^XPDID(9.8),RTN^XPDIP
107 ;XPDIST is flag for site tracking^A/B install message, it is set in PKG^XPDIP
108 ;install Package file, OERR parameter multiple, and Build file
109 S XPDIST="" D BMES^XPDUTL(" Updating KIDS files..."),PKG^XPDIP
110 D BMES^XPDUTL(" "_XPDNM_" Installed. "),STMP(17)
111 ;sends install messages local/forum
112 S %=$$EN^XPDIST(XPDA,XPDIST) D BMES^XPDUTL(" "_$P("NO ",U,'$P(%,"#",2))_"Install Message sent "_%)
113 Q
114CHK(X) ;check checkpoints in file 9.7, X=field #, returns 1=completed, 0=not completed
115 Q $$GET1^DIQ(9.7,XPDA_",",X,"I")]""
116 ;
117STMP(X) ;timestamp checkpoints in file 9.7, X=field #
118 N XPD,%
119 S %=$$NOW^XLFDT,XPD(9.7,XPDA_",",X)=%
120 D MES^XPDUTL(" "_$$FMTE^XLFDT(%)),FILE^DIE("","XPD")
121 Q
122 ;
123INHIBIT(SET) ;Set/Clear the Inhibit logon field.
124 N VOL,IEN
125 F IEN=0:0 S IEN=$O(^%ZIS(14.5,IEN)) Q:IEN'>0 D
126 . I $P(^%ZIS(14.5,IEN,0),U,11)=1 S VOL(14.5,IEN_",",1)=SET
127 . Q
128 D FILE^DIE("","VOL")
129 Q
Note: See TracBrowser for help on using the repository browser.