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
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
' 
' $Id: Win32Installer.vbs,v 1.13 2008/10/20 09:09:56 wellhard Exp $ 
' 
' Companion file to RoxenUI.wxs with custom actions. 
' 
' 2004-11-29 Henrik Grubbström 
' 
 
' At call time the CustomActionData property has been set to [TARGETDIR]. 
' 
' Remove any previously installed service. 
Function RemoveOldService() 
  Dim WshShell, serverdir 
 
  targetdir = Session.Property("CustomActionData") 
 
  Set WshShell = CreateObject("WScript.Shell") 
  WshShell.CurrentDirectory = targetdir 
 
  WshShell.Run """" & targetdir & "ntstart"" --remove", 0, True 
 
  RemoveOldService = 1 
End Function 
 
' At call time the CustomActionData property has been set to [SERVERDIR]. 
' 
' Creates "[SERVERDIR]pikelocation.txt" with the 
' content "[SERVERDIR]pike\bin\pike" 
Function CreatePikeLocation() 
  Dim fso, tf, serverdir 
  Set fso = CreateObject("Scripting.FileSystemObject") 
 
  serverdir = Session.Property("CustomActionData") 
 
  Set tf = fso.CreateTextFile(serverdir & "pikelocation.txt", True) 
  tf.WriteLine(serverdir & "pike\bin\pike") 
  tf.Close 
 
  CreatePikeLocation = 1 
End Function 
 
' At call time the CustomActionData property has been set to 
' [SERVERDIR];[SERVER_NAME];[SERVER_PROTOCOL];[SERVER_PORT];[ADM_USER];[ADM_PASS1] 
' 
' Create a new configinterface. 
Function CreateConfigInterface() 
  Dim re, matches, match, WshShell, serverdir 
  Set re = New RegExp 
  re.Pattern = "[^;]*" 
  re.Global = False 
  Set matches = re.Execute(Session.Property("CustomActionData")) 
  For Each match in matches 
    serverdir = match.Value 
  Next 
 
  Set WshShell = CreateObject("WScript.Shell") 
  WshShell.Run """" & serverdir & "pike\bin\pike"" """ & serverdir &_ 
    "bin\create_configif.pike"" --batch __semicolon_separated__ """ &_ 
    Session.Property("CustomActionData") & """ ok y update n", 0, True 
 
  CreateConfigInterface = 1 
End Function 
 
Function CreateEnvironment() 
  Dim envfile, fso, tf 
  Set fso = CreateObject("Scripting.FileSystemObject") 
 
  envfile = Session.Property("CustomActionData") 
 
  If (Not fso.FileExists(envfile)) Then 
    Set tf = fso.CreateTextFile(envfile, True) 
    tf.WriteLine("[Parameters]") 
    tf.WriteLine("default= ") 
    tf.WriteLine("[Environment]") 
    tf.WriteLine("_JAVA_OPTIONS=-Xmx256M") 
    tf.Close 
  End If 
End Function