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

XPDIL.m

Go to the documentation of this file.
  1. XPDIL ;SFISC/RSD - load Distribution Global ;05/05/2008
  1. ;;8.0;KERNEL;**15,44,58,68,108,422,525**;Jul 10, 1995;Build 16
  1. ;
  1. EN1 N POP,XPDA,XPDST,XPDIT,XPDT,XPDGP,XPDQUIT,XPDREQAB,XPDSKPE
  1. S:'$D(DT) DT=$$DT^XLFDT S:'$D(U) U="^"
  1. S XPDST=0
  1. D ST I $G(XPDQUIT) D ABRTALL^XPDI(1) G NONE
  1. ;XPDST= starting Build
  1. ;XPDT("DA",ien)=seq # to install
  1. ;XPDT("NM",build name)=seq #
  1. ;XPDT(seq #)=ien^Build name
  1. ;XPDT("GP",global)= 1-replace, 0-overwrite^ien
  1. ;XPDGP=globals from a Global Package
  1. ;XPDSKPE=1 don't run Environment Check^has question been asked
  1. S XPDIT=0,XPDSKPE="0^0"
  1. F S XPDIT=$O(XPDT(XPDIT)) Q:'XPDIT S XPDA=+XPDT(XPDIT) D I '$D(XPDT) Q
  1. .;check if this Build has an Envir. Check
  1. .I $G(^XTMP("XPDI",XPDA,"PRE"))]"" D I $G(XPDQUIT) D ABRTALL^XPDI(1) Q
  1. ..;quit if we already asked this question
  1. ..Q:$P(XPDSKPE,U,2)
  1. ..S $P(XPDSKPE,U,2)=1
  1. ..N DIR,DIRUT
  1. ..S DIR(0)="Y",DIR("A")="Want to RUN the Environment Check Routine",DIR("B")="YES"
  1. ..S DIR("A",1)="Build "_$P(XPDT(XPDIT),U,2)_" has an Environmental Check Routine"
  1. ..D ^DIR I $D(DIRUT) S XPDQUIT=1 Q
  1. ..S:'Y XPDSKPE="1^1"
  1. .D PKG^XPDIL1(XPDA)
  1. ;Global Package
  1. G:$D(XPDGP) ^XPDIGP
  1. I $D(XPDT),$D(^XPD(9.7,+XPDST,0)) W !,"Use INSTALL NAME: ",$P(^(0),U)," to install this Distribution.",!
  1. Q
  1. ST ;global input
  1. N DIR,DIRUT,GR,IOP,X,Y,Z,%ZIS
  1. G:'$D(^DD(3.5,0)) OPEN
  1. I '$D(^%ZIS(1,"B","HFS")) W !!,"You must have a device called 'HFS' in order to load a distribution!",*7 S XPDQUIT=1 Q
  1. D HOME^%ZIS
  1. S DIR(0)="F^3:75",DIR("A")="Enter a Host File",DIR("?")="Enter a filename and/or path to input Distribution."
  1. D ^DIR I $D(DIRUT) S XPDQUIT=1 Q
  1. S %ZIS="",%ZIS("HFSNAME")=Y,%ZIS("HFSMODE")="R",IOP="HFS"
  1. D ^%ZIS I POP W !,"Couldn't open file or HFS device!!",*7 S XPDQUIT=1 Q
  1. ;don't close device if we have a global package, we need to bring in the globals now
  1. D GI,^%ZISC:'$D(XPDGP)!$G(XPDQUIT)
  1. Q
  1. ;
  1. ;if no device file, Virgin Install
  1. OPEN ;use open command
  1. N IO,IOPAR,DIR,DIRUT,DTOUT,DUOUT
  1. S DIR(0)="F^1:79",DIR("A")="Device Name"
  1. S DIR("?",1)="Device Name is either the name of the HFS file or the name of the HFS Device.",DIR("?",2)="i.e. for MSM enter 51",DIR("?")=" for DSM enter DISK$USER::[ANONYMOUS]:KRN8.KID"
  1. D ^DIR I $D(DIRUT) S POP=1 Q
  1. S IO=Y,DIR(0)="FO^1:79",DIR("A")="Device Parameters"
  1. S DIR("?",1)="Device Parameter is the Open parameter this M operating system needs to",DIR("?",2)="open the Device Name.",DIR("?",3)="i.e. for MSM enter (""B:\KRN8.KID"":""R"")",DIR("?")=" for DSM enter READONLY"
  1. D ^DIR I $D(DTOUT)!$D(DUOUT) S POP=1 Q
  1. S IOPAR=Y
  1. X "O IO:"_IOPAR_":10" E U $P W !,"Couldn't open ",IO S POP=1 Q
  1. S IO(0)=$P
  1. D GI D ^%ZISC
  1. Q
  1. ;
  1. GI N X,XPDSEQ,Y,Z
  1. U IO R X:10,Y:10 ;rwf was :0
  1. U IO(0) W !!,X,!,"Comment: ",Y
  1. S XPDST("H")=Y,XPDST("H1")=Y_" ;Created on "_$P(X,"KIDS Distribution saved on ",2)
  1. ;Z is the string of Builds in this file
  1. U IO F X=1:1 R Z:1 S Z=$P(Z,"**KIDS**",2,99) Q:Z="" S X(X)=Z
  1. U IO(0) I $G(X(1))="" W !!,"This is not a Distribution HFS File!" S XPDQUIT=1 Q
  1. ;global package, set XPDGP=flag;global^flag;global^... flag=1 replace
  1. I $P(X(1),":")="GLOBALS" S XPDGP=$P(X(1),U,2,99),X(1)=$P(X(1),U)
  1. S XPDIT=0,X(1)=$P(X(1),":",2,99)
  1. W !!,"This Distribution contains Transport Globals for the following Package(s):"
  1. F X=1:1:X-1 F Z=1:1 S Y=$P(X(X),U,Z) Q:Y="" D Q:$G(XPDQUIT)
  1. . ;can't install if global exist, that means Build never finish install
  1. . ;INST will show name
  1. . S XPDIT=XPDIT+1 I '$$INST^XPDIL1(Y) S XPDQUIT=1 Q
  1. Q:$G(XPDQUIT)
  1. W !,"Distribution OK!",!
  1. D:$D(XPDGP) DISP^XPDIGP
  1. S DIR(0)="Y",DIR("A")="Want to Continue with Load",DIR("B")="YES"
  1. D ^DIR I $D(DIRUT)!'Y S XPDQUIT=1 Q
  1. W !,"Loading Distribution...",!
  1. ;reset expiration date to T+7 on transport global
  1. S ^XTMP("XPDI",0)=$$FMADD^XLFDT(DT,7)_U_DT
  1. ;start reading the HFS again
  1. U IO R X:10,Y:10 ;rwf was :0
  1. ;the next read must be the INSTALL NAME
  1. I X'="**INSTALL NAME**"!'$D(XPDT("NM",Y)) U IO(0) W !!,"ERROR in HFS file format!" S XPDQUIT=1 Q
  1. ;XPDSEQ is the disk sequence number
  1. S %=XPDT("NM",Y),GR="^XTMP(""XPDI"","_+XPDT(%)_",",XPDSEQ=1
  1. ;X=global ref, Y=global value. DIRUT is when user aborts
  1. ;rwf next line was :0
  1. F R X:10,Y:10 Q:X="**END**" D I $D(DIRUT) S XPDQUIT=1 Q
  1. .I X="**INSTALL NAME**" D Q
  1. ..S %=+$G(XPDT("NM",Y)) I '% S DIRUT=1 Q
  1. ..S GR="^XTMP(""XPDI"","_+XPDT(%)_","
  1. .S @(GR_X)=Y
  1. U IO(0)
  1. Q
  1. ;
  1. NONE W !!,"**NOTHING LOADED**",!
  1. Q