VistA-GuiMail/p/CWMAINI.m

74 lines
2.8 KiB
Mathematica
Raw Permalink Normal View History

2011-04-10 22:44:11 -04:00
CWMAINI ;INDPLS/PLS - KIDS INITS FOR GUIMail INSTALL ;20-Jul-2005 14:46;CLC;
;;2.3;CWMAIL;;Jul 19, 2005
2011-04-10 14:13:17 -04:00
; Environment Check
EC D VCHK("RPC BROKER",1.1) ;RPC Broker
D PCHK("DI*21.0*34") ;Fileman/Delphi Components
D PCHK("XM*7.1*50") ;MailMan Patch
D PCHK("XM*7.1*73") ;MailMan Patch to $$CONVERT^XMXUTIL1
D PCHK("XU*8.0*71") ;Kernel date formatting patch
D PCHK("XT*7.3*26") ;Kernel Tool-Kit Generic Parameters
S:$G(XPDENV) XPDDIQ("XPZ1")=0 ;force Disable Options/Protocols prompt to NO
Q
VCHK(CWP,CWV) ;CHECK VERSION OF PASSED PACKAGE
D:$$VERSION^XPDUTL(CWP)<CWV MES("Requires at least version "_CWV_" of the "_CWP_".")
Q
PCHK(CWPATCH) ;CHECK PATCH INSTALLATION
D:'$$PATCH^XPDUTL(CWPATCH) MES("Requires that patch "_CWPATCH_" be installed.")
Q
MES(X) D BMES^XPDUTL(X)
S XPDQUIT=1
Q
;Post Installation
EN ;entry point for post installation functions
;
D ^CWMAPP ;populate package parameters
D EN^CWMACPPI ;convert CWMAIL1 to Generic Parameter Utility
2011-04-10 22:44:11 -04:00
D UPCURVER(2.3) ;make sure current version is updated
;D PDEL890 ;prompt for deletion of File 890 CW GUI VISTA MAIL USER
2011-04-10 14:13:17 -04:00
D MMSG ;send mail message indicating package installation
Q
MMSG ;send mail message to Indianapolis indicating CW GUIMail installation
;
N CWSUBJ,CWRECP,CWBODY
S CWBODY=$NA(^TMP($J,"CWBODY"))
S CWSUBJ="GUIMail Installation at "_$G(^XMB("NETNAME"))
S ^TMP($J,"CWBODY",1)="GUIMail has just been installed at: "_$G(^XMB("NETNAME"))_"."
2011-04-10 22:44:11 -04:00
S ^TMP($J,"CWBODY",2)="Version #: 2.3" ;_$$VERSION^XPDUTL("CWMA") ;set version number
2011-04-10 14:13:17 -04:00
S ^TMP($J,"CWBODY",3)="Installer: "_$P($G(^VA(200,+$G(DUZ),0)),U)
S CWRECP("G.GUIMAIL@INDIANAPOLIS.VA.GOV")=""
D SENDMSG^XMXAPI(DUZ,CWSUBJ,CWBODY,.CWRECP)
K ^TMP($J,"CWBODY")
Q
;
PDEL890 ;I $$READY("Do you wish to remove the file at this time","NO") D
;. N DIU
;. S DIU="^CWMAIL1(",DIU(0)="DST" D EN^DIU2
;E D
;. W !,"OK. You may delete later by executing D PDEL890^CWMAINI."
D BMES^XPDUTL("Removing CW GUI VISTA MAIL USER (890) File ...")
N DIU
S DIU="^CWMAIL1(",DIU(0)="DST" D EN^DIU2
Q
2011-04-10 22:44:11 -04:00
UPCURVER(VER) ;
N IEN,CWFDA
S IEN=$$FIND1^DIC(9.4,"","B","CW GUIMail","B","","OUT")
I IEN D
.Q:$G(^DIC(9.4,IEN,"VERSION"))=VER
.S CWFDA(9.4,IEN_",",13)=VER
.D FILE^DIE("","CWFDA")
Q
2011-04-10 14:13:17 -04:00
READY(CWPRMPT,CWDEF) ; Prompts user for input
;Input - CWPRMPT - will set DIR("A" to this value
; CWDEF - will set DIR("B" to this value
;Output - returns a 1(yes) or 0(no)
N DIR,X,Y
W !!," * * * * WARNING * * * *"
W !!," You are about to remove file 890. This file held"
W !!," personal preferences for GUIMail v2.0. All of the settings"
W !!," should have been moved to the Generic Parameter File"
W !!," during installation.",!!
S DIR("B")=$G(CWDEF,"NO")
S DIR(0)="Y"
D ^DIR Q:Y 1 ; answered YES
Q 0 ; answered NO