-
Notifications
You must be signed in to change notification settings - Fork 0
/
Installer.cls
30 lines (24 loc) · 979 Bytes
/
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
Class Advent.Installer
{
XData MyInstall [ XMLNamespace = INSTALLER ]
{
<Manifest>
<Default Name="AppDir" Value="#{$system.Process.CurrentDirectory()}"/>
<Default Name="SourceDir" Value="${AppDir}src"/>
<Default Name="DbDir" Value="${AppDir}db"/>
<Default Name="NAMESPACE" Value="ADVENT"/>
<Default Name="DBNAME" Value="${NAMESPACE}"/>
<Namespace Name="${NAMESPACE}" Code="${DBNAME}" Data="${DBNAME}" Create="yes" Ensemble="0">
<Configuration>
<Database Name="${DBNAME}" Dir="${DbDir}" Create="yes"/>
</Configuration>
<Import File="${SourceDir}" 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 ]
{
do %code.WriteLine($char(9)_"set pVars(""CURRENTCLASS"")="""_%classname_"""")
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "MyInstall")
}
}