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

XPDIJ1Z.m

Go to the documentation of this file.
  1. XPDIJ1 ;SFISC/RSD - Cont. of Install Job ;11/13/97 09:12
  1. ;;8.0;KERNEL;**1005**;FEB 09, 1999
  1. ;;8.0;KERNEL;**41,68**;Jul 10, 1995
  1. IN ;install XPDA
  1. ;XPDA=ien of file 9.7, XPDNM=package name
  1. Q:'$D(^XTMP("XPDI",XPDA))!'$D(^XPD(9.7,XPDA,0))
  1. ;check if already installed
  1. I $P($G(^XPD(9.7,XPDA,1)),U,3) D BMES^XPDUTL(" "_XPDNM_" Already Installed ") Q
  1. N DIFROM,XPD,XPDBLD,XPDCHECK,XPDCP,XPDI,XPDGREF,XPDIST,XPDIDTOT,XPDIDCNT,XPDIDMOD,XPDRTN
  1. ;XPDBLD subscript for build entry i.e. ^XTMP("XPDI",XPDA,"BLD",XPDBLD
  1. S DIFROM=$$VER^XPDUTL(XPDNM),XPDBLD=$O(^XTMP("XPDI",XPDA,"BLD",0)),XPDGREF="^XTMP(""XPDI"","_XPDA_",""TEMP"")"
  1. D TITLE^XPDID(XPDNM)
  1. ;the $T is there only for installing patch 41 to prevent a noline error
  1. ;check that Package file has entry
  1. I $T(PKGADD^XPDIP)]"" S Y=$$PKGADD^XPDIP
  1. I '$$CHK(11) D
  1. .D BMES^XPDUTL(" Install Started for "_XPDNM_" : "),STMP(11)
  1. .;update status and installed by fields
  1. .S XPD(9.7,XPDA_",",.02)=2,XPD(9.7,XPDA_",",9)=DUZ
  1. .D FILE^DIE("","XPD")
  1. E D BMES^XPDUTL(" Install Restarted for "_XPDNM_" at "_$$HTE^XLFDT($H))
  1. I '$$CHK(12) D
  1. .D BMES^XPDUTL(" Installing Routines:"),SETTOT^XPDID(9.8),RTN^XPDIJ(XPDA),STMP(12)
  1. E D BMES^XPDUTL(" Routines already installed.")
  1. S XPDCP="INI"
  1. ;check if pre-install has completed
  1. I '$$VERCP^XPDUTL("XPD PREINSTALL COMPLETED") D Q:$D(XPDABORT)
  1. .;setup XPDQUES array with pre-install questions/answers
  1. .D QUES^XPDIQ("PRE")
  1. .;XPDCHECK=ien of current checkpoint, (0)=name of checkpoint
  1. .;XPDCP="INI"-pre install or "INIT"-post install
  1. .;loop thru check points starting with INSTALL STARTED
  1. .S XPDCHECK=1
  1. .F S XPDCHECK=$O(^XPD(9.7,XPDA,"INI",XPDCHECK)) Q:'XPDCHECK S XPD=^(XPDCHECK,0) D Q:$D(XPDABORT)
  1. ..;if there is no call back, quit
  1. ..Q:$G(^XPD(9.7,XPDA,"INI",XPDCHECK,1))="" S XPDRTN=^(1)
  1. ..;check if checkpoint has been completed
  1. ..Q:$P(XPD,U,2)
  1. ..I XPDCHECK=2 D BMES^XPDUTL(" Running Pre-Install Routine: "_XPDRTN)
  1. ..;zero the progress bar
  1. ..I $D(XPDIDVT) S XPDIDTOT=0 D UPDATE^XPDID(0)
  1. ..D @XPDRTN
  1. ..;write message and abort if developer wants
  1. ..I $D(XPDABORT) D BMES^XPDUTL("Install ** ABORTED ** in Pre-Install program") Q
  1. ..S %=$$COMCP^XPDUTL(XPDCHECK)
  1. .Q:$D(XPDABORT)
  1. .;complete pre-init check point
  1. .S %=$$COMCP^XPDUTL("XPD PREINSTALL COMPLETED")
  1. E D BMES^XPDUTL(" Pre-Install already finished.")
  1. ;build XPDQUES arrays for all of the FM Files
  1. D QUES^XPDIQ("XPF")
  1. ;check the last file and see if it's already installed
  1. S XPD=$G(^(+$O(^XPD(9.7,XPDA,4,"A"),-1),0))
  1. I '$P(XPD,U,2) D:$D(^XTMP("XPDI",XPDA,"FIA"))
  1. .D BMES^XPDUTL(" Installing Data Dictionaries: "),SETTOT^XPDID(4),FIA^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
  1. E D BMES^XPDUTL(" Data Dictionaries already installed.")
  1. S %=+$O(^XTMP("XPDI",XPDA,"DATA",""),-1),XPD=$G(^XPD(9.7,XPDA,4,%,0))
  1. I '$P(XPD,U,3) D:%
  1. .D BMES^XPDUTL(" Installing Data: "),DAT^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
  1. E D BMES^XPDUTL(" Data already installed.")
  1. S (%,XPD)=""
  1. F S %=+$O(^XPD(9.7,XPDA,"KRN",%)) Q:'% S XPD=$G(^(%,0)) Q:'$P(XPD,U,2)
  1. I '$P(XPD,U,2) D:$D(^XTMP("XPDI",XPDA,"KRN"))
  1. .D BMES^XPDUTL(" Installing PACKAGE COMPONENTS: "),KRN^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
  1. E D BMES^XPDUTL(" PACKAGE COMPONENTS already installed.")
  1. S XPDCP="INIT"
  1. ;check if post-install has completed
  1. I '$$VERCP^XPDUTL("XPD POSTINSTALL COMPLETED") D Q:$D(XPDABORT)
  1. .;setup XPDQUES array with post-install questions/answers
  1. .D QUES^XPDIQ("POS")
  1. .;loop thru check points starting with INSTALL STARTED
  1. .S XPDCHECK=1
  1. .F S XPDCHECK=$O(^XPD(9.7,XPDA,"INIT",XPDCHECK)) Q:'XPDCHECK S XPD=^(XPDCHECK,0) D Q:$D(XPDABORT)
  1. ..;if there is no call back, quit
  1. ..Q:$G(^XPD(9.7,XPDA,"INIT",XPDCHECK,1))="" S XPDRTN=^(1)
  1. ..;quit if checkpoint has completed time
  1. ..Q:$P(XPD,U,2)
  1. ..I XPDCHECK=2 D BMES^XPDUTL(" Running Post-Install Routine: "_XPDRTN)
  1. ..;zero the progress bar
  1. ..I $D(XPDIDVT) S XPDIDTOT=0 D UPDATE^XPDID(0)
  1. ..D @XPDRTN
  1. ..;write message and abort if developer wants
  1. ..I $D(XPDABORT) D BMES^XPDUTL("Install ** ABORTED ** in Post-Install program") Q
  1. ..S %=$$COMCP^XPDUTL(XPDCHECK)
  1. .Q:$D(XPDABORT)
  1. .;complete post-init check point
  1. .S %=$$COMCP^XPDUTL("XPD POSTINSTALL COMPLETED")
  1. E D BMES^XPDUTL(" Post-Install already finished.")
  1. ;move routines to install file & Routine file
  1. D BMES^XPDUTL(" Updating Routine file..."),SETTOT^XPDID(9.8),RTN^XPDIP
  1. ;XPDIST is flag for site tracking^A/B install message, it is set in PKG^XPDIP
  1. ;install Package file, OERR parameter multiple, and Build file
  1. S XPDIST="" D BMES^XPDUTL(" Updating KIDS files..."),PKG^XPDIP
  1. D BMES^XPDUTL(" "_XPDNM_" Installed. "),STMP(17)
  1. ;sends install messages
  1. I $L(XPDIST) S %=$$EN^XPDIST(XPDA,XPDIST) D BMES^XPDUTL(" "_$P("NO ",U,'$P(%,"#",2))_"Install Message sent "_%)
  1. Q
  1. CHK(X) ;check checkpoints in file 9.7, X=field #, returns 1=completed, 0=not completed
  1. Q $$GET1^DIQ(9.7,XPDA_",",X,"I")]""
  1. ;
  1. STMP(X) ;timestamp checkpoints in file 9.7, X=field #
  1. N XPD,%
  1. S %=$$NOW^XLFDT,XPD(9.7,XPDA_",",X)=%
  1. D MES^XPDUTL(" "_$$FMTE^XLFDT(%)),FILE^DIE("","XPD")
  1. Q