Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XPDIJ

XPDIJ.m

Go to the documentation of this file.
  1. XPDIJ ;SFISC/RSD - Install Job ;08/14/2008
  1. ;;8.0;KERNEL;**2,21,28,41,44,68,81,95,108,124,229,275,506,672,796**;Jul 10, 1995;Build 4
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. EN ;install all packages
  1. ;XPDA=ien of first package
  1. ;this is needed to restore XPDIJ1
  1. D LNRF("XPDUTL") ;p275 SAVE calls RTNLOG^XPDUTL
  1. D LNRF("XPDIJ1") ;See that XPDIJ1 is loaded befor it is called
  1. N IEN,XPDI,XPD0,XPDSET,XPDABORT,XPDMENU,XPDQUIT,XPDVOL,X,Y,ZTRTN,ZTDTH,ZTIO,ZTDESC,ZTSK
  1. M X=DUZ N DUZ M DUZ=X S DUZ(0)="@" ;See that install has full FM priv.
  1. I $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D ERR^XPDIJ"
  1. E S X="ERR^XPDIJ",@^%ZOSF("TRAP")
  1. ;check that Install entry exists, set status to "Start of Install"
  1. Q:'$D(^XPD(9.7,+$G(XPDA),0)) S XPD0=^(0),$P(^(0),U,9)=2
  1. D INIT^XPDID
  1. ;See if need to Inhibit Logons
  1. I $$ANSWER^XPDIQ("XPI1") D INHIBIT^XPDIJ1("Y")
  1. ;disable options & protocols for setname, XPDSET=1/0^setname^out of order msg.
  1. S Y=$P(XPD0,U,8),XPDSET=+Y_U_$E(Y,2,99)_U_$S($L(Y):$P($G(^XTMP("XQOO",$E(Y,2,99),0)),U),1:"")
  1. ;hang the number of seconds given in 0;10
  1. I XPDSET D OFF^XQOO1($P(XPDSET,U,2)) I $P(XPD0,U,10) H ($P(XPD0,U,10)*60)
  1. ;check that Install still exists, wasn't unloaded p672
  1. I '$D(^XPD(9.7,XPDA,0))!'$D(^XTMP("XPDI",XPDA)) D EXIT^XPDID(" Build NOT installed, Transport Global missing!!!!") Q
  1. S Y=0
  1. ;XPDABORT can be set in pre or post install to abort install
  1. F S Y=$O(^XPD(9.7,"ASP",XPDA,Y)) Q:'Y S %=$O(^(Y,0)) D:% Q:$D(XPDABORT)
  1. .N XPD,XPDA,XPDNM,XPDV,XPDV0,XPDVOL,XPDX,XPDY,Y
  1. .;Now do the Install
  1. .S XPDA=%,XPDNM=$P($G(^XPD(9.7,XPDA,0)),U) D IN^XPDIJ1 Q:$D(XPDABORT)
  1. ;
  1. ;Now do Master Build Post INIT.
  1. I '$D(XPDABORT),$D(XPDT("MASTER")) D
  1. .N XPDBLD,XPDGREF
  1. .S XPDBLD=$O(^XTMP("XPDI",XPDA,"BLD",0)),XPDGREF="^XTMP(""XPDI"","_XPDA_",""TEMP"")"
  1. .D POST^XPDIJ1
  1. ;ZTREQ tells taskman to delete task
  1. I $G(ZTSK) S ZTREQ="@" D
  1. .;remove task # from Install File
  1. .N XPD S XPD(9.7,XPDA_",",5)="@"
  1. .D FILE^DIE("","XPD")
  1. ;quit if install was aborted
  1. I $D(XPDABORT) D EXIT^XPDID("Install Aborted!!"),^%ZISC Q
  1. ;put option back in order
  1. I $P(XPDSET,U,2)]"" D ON^XQOO1($P(XPDSET,U,2)) K ^XTMP("XQOO",$P(XPDSET,U,2))
  1. ;check if menu rebuild is wanted (only if option has been added to any installs)
  1. ;XPDMENU is used to check that it is only done once
  1. S (Y,XPDMENU)=0
  1. F S Y=$O(^XPD(9.7,"ASP",XPDA,Y)) Q:'Y S %=$O(^(Y,0)) D:% Q:XPDMENU
  1. .N XPDA,Y
  1. .S XPDA=%
  1. .I $$ANSWER^XPDIQ("XPO1") D BMES^XPDUTL(" Call MENU rebuild"),KIDS^XQ81 S XPDMENU=1
  1. .;There should be no reason to check other CPUs anymore, patch 496
  1. .Q
  1. .;check if need to queue menu rebuild on other CPUs
  1. .D:$O(^XPD(9.7,XPDA,"VOL",0))
  1. ..N XPDU,XPDY,XPDV,XPDV0,ZTUCI,ZTCPU
  1. ..X ^%ZOSF("UCI") S XPDU=$P(Y,","),XPDY=$P(Y,",",2),XPDV=0
  1. ..;loop thru VOLUMES SET and don't do current volume set
  1. ..F S XPDV=$O(^XPD(9.7,XPDA,"VOL",XPDV)) Q:'XPDV S XPDV0=$P(^(XPDV,0),U) D:XPDV0'=XPDY
  1. ...S ZTUCI=XPDU,ZTDTH=$H,ZTIO="",ZTDESC="Install Menu Rebuild",ZTCPU=XPDV0,ZTRTN="KIDS^XQ81" D ^%ZTLOAD
  1. ;
  1. ;See if need to reset inhibit logons
  1. I $$ANSWER^XPDIQ("XPI1") D INHIBIT^XPDIJ1("N")
  1. ;
  1. ;clean up globals
  1. S Y=0
  1. F S Y=$O(^XPD(9.7,"ASP",XPDA,Y)) Q:'Y S XPDI=$O(^(Y,0)) D:XPDI
  1. . N %,Y,XPD,X
  1. . ;See if need to delete Env,Pre,Post routines.
  1. . S %=$O(^XTMP("XPDI",XPDI,"BLD",0)),XPD=$G(^XTMP("XPDI",XPDI,"BLD",%,"INID"))
  1. . I '$$GET^XUPARAM("XPD NO_EPP_DELETE") F %=1:1:3 I $P(XPD,U,%)="y" D
  1. . . S X=^XTMP("XPDI",XPDI,$P("PRE^INIT^INI",U,%)) S:X[U X=$P(X,U,2) X:X]"" ^%ZOSF("DEL")
  1. . ;kill transport global
  1. . K ^XTMP("XPDI",XPDI)
  1. . ;update the status field
  1. . S XPD(9.7,XPDI_",",.02)=3
  1. . D FILE^DIE("","XPD")
  1. D EXIT^XPDID("Install Completed"),^%ZISC
  1. Q
  1. ;
  1. SAVE(X) ;restore routine X
  1. N %,DIE,XCM,XCN,XCS
  1. S DIE="^XTMP(""XPDI"",XPDA,""RTN"",X,",XCN=0
  1. X ^%ZOSF("SAVE") D RTNLOG^XPDUTL(X)
  1. Q
  1. RTN(XPDA) ;restore all routines for package XPDA
  1. ;^XPD("XPDI",XPDA,"RTN",routine name)=0-install, 1-delete, 2-skip^checksum
  1. Q:$G(XPDA)=""
  1. N X,XPDI,XPDJ S XPDI=""
  1. F S XPDI=$O(^XTMP("XPDI",XPDA,"RTN",XPDI)) Q:XPDI="" S XPDJ=^(XPDI) D
  1. .;if we are doing VT graphic display, set counter
  1. .I $D(XPDIDVT) S XPDIDCNT=XPDIDCNT+1 D:'(XPDIDCNT#XPDIDMOD) UPDATE^XPDID(XPDIDCNT)
  1. .I 'XPDJ D SAVE(XPDI) Q
  1. .;set checksum to null, since routine wasn't loaded
  1. .I $P(XPDJ,U,2) S $P(^XTMP("XPDI",XPDA,"BLD",XPDBLD,"KRN",9.8,"NM",$P(XPDJ,U,2),0),U,4)=""
  1. .I $P(XPDJ,U)=1 S X=XPDI X ^%ZOSF("DEL")
  1. ;if graphic display, update full count
  1. I $D(XPDIDVT) D UPDATE^XPDID(XPDIDCNT)
  1. Q
  1. ;
  1. VOLERR(V,F) ;volume set not updated,V=volume set, F=flag
  1. N XQA,XQAMSG,XPDMES
  1. S XPDMES(1)=" ",XPDMES(2)=" ** Job on VOLUME SET "_V_$S(F:" never started **",1:" has been idle for an hour.")
  1. S XPDMES(3)=" ** "_V_" has NOT been updated! **"
  1. S XQA(DUZ)="",XQAMSG="VOLUME SET "_V_" NOT updated for Install "_$E($P($G(^XPD(9.7,+$G(XPDA),0)),"^"),1,30)
  1. D MES^XPDUTL(.XPDMES),SETUP^XQALERT
  1. Q
  1. ;come here on error, record error in Install file and cleanup var.
  1. ERR N XPDERROR,XQA,XQAMSG
  1. S XPDERROR=$$EC^%ZOSV
  1. ;record error
  1. D ^%ZTER
  1. ;reset primary device back to home device
  1. I $G(IO(0))]"" U IO(0) ;p796
  1. ;write message, reset terminal
  1. D BMES^XPDUTL(XPDERROR),EXIT^XPDID()
  1. S XQA(DUZ)="",XQAMSG="Install "_$E($P($G(^XPD(9.7,+$G(XPDA),0)),"^"),1,30)_" has encountered an Error."
  1. D SETUP^XQALERT G UNWIND^%ZTER
  1. ;
  1. LNRF(RN) ;Load needed routines first
  1. I $D(^XTMP("XPDI",XPDA,"RTN",RN)) D
  1. .N X
  1. .D SAVE(RN)
  1. .S XCN=$$RTNUP^XPDUTL(RN,2)
  1. Q