-
Notifications
You must be signed in to change notification settings - Fork 5
/
Installer.cls
36 lines (28 loc) · 1.34 KB
/
Installer.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Class Demo.Installer
{
XData MyInstall [ XMLNamespace = INSTALLER ]
{
<Manifest>
<Default Name="SourceDir" Value="#{$system.Process.CurrentDirectory()}"/>
<Default Name="NAMESPACE" Value="DEMO"/>
<Default Name="DBNAME" Value="DEMO"/>
<Default Name="APPPATH" Dir="${SourceDir}" />
<Default Name="CSPAPPPATH" Dir="/csp/demo/" />
<Default Name="CSPAPPDIR" Dir="${CSPDIR}/demo/" />
<Default Name="SOURCESPATH" Dir="${APPPATH}src" />
<Default Name="RESOURCE" Value="%DB_${DBNAME}" />
<Namespace Name="${NAMESPACE}" Code="${DBNAME}-CODE" Data="${DBNAME}-DATA" Create="yes" Ensemble="0">
<Configuration>
<Database Name="${DBNAME}-CODE" Dir="${APPPATH}code" Create="yes" Resource="${RESOURCE}" MountRequired="1" />
<Database Name="${DBNAME}-DATA" Dir="${APPPATH}data" Create="yes" Resource="${RESOURCE}" MountRequired="1" />
</Configuration>
<CSPApplication Url="${CSPAPPPATH}" Directory="${CSPAPPDIR}" Grant="${RESOURCE}" CookiePath="${CSPAPPPATH}" AuthenticationMethods="64" />
<Import File="${SOURCESPATH}" Recurse="1"/>
</Namespace>
</Manifest>
}
ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
{
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "MyInstall")
}
}