599f332004-11-29Henrik Grubbström (Grubba) '
7d2cb52005-11-02Anders Johansson ' $Id: Win32Installer.vbs,v 1.11 2005/11/02 15:39:22 anders Exp $
599f332004-11-29Henrik Grubbström (Grubba) ' ' Companion file to RoxenUI.wxs with custom actions. ' ' 2004-11-29 Henrik Grubbström '
fdb92e2004-12-07Henrik Grubbström (Grubba) ' At call time the CustomActionData property has been set to [TARGETDIR].
c4b35e2004-11-30Henrik Grubbström (Grubba) '
f4de172004-12-07Henrik Grubbström (Grubba) ' Remove any previously installed service. Function RemoveOldService()
e359f22004-12-07Henrik Grubbström (Grubba)  Dim WshShell, serverdir
fdb92e2004-12-07Henrik Grubbström (Grubba)  targetdir = Session.Property("CustomActionData")
f4de172004-12-07Henrik Grubbström (Grubba)  Set WshShell = CreateObject("WScript.Shell")
fdb92e2004-12-07Henrik Grubbström (Grubba)  WshShell.CurrentDirectory = targetdir
f4de172004-12-07Henrik Grubbström (Grubba) 
fdb92e2004-12-07Henrik Grubbström (Grubba)  WshShell.Run """" & targetdir & "ntstart"" --remove", 0, True
f4de172004-12-07Henrik Grubbström (Grubba)  RemoveOldService = 1 End Function ' At call time the CustomActionData property has been set to [SERVERDIR]. '
599f332004-11-29Henrik Grubbström (Grubba) ' Creates "[SERVERDIR]pikelocation.txt" with the ' content "[SERVERDIR]pike\bin\pike" Function CreatePikeLocation()
c4b35e2004-11-30Henrik Grubbström (Grubba)  Dim fso, tf, serverdir Set fso = CreateObject("Scripting.FileSystemObject")
599f332004-11-29Henrik Grubbström (Grubba) 
c4b35e2004-11-30Henrik Grubbström (Grubba)  serverdir = Session.Property("CustomActionData")
599f332004-11-29Henrik Grubbström (Grubba) 
c4b35e2004-11-30Henrik Grubbström (Grubba)  Set tf = fso.CreateTextFile(serverdir & "pikelocation.txt", True) tf.WriteLine(serverdir & "pike\bin\pike") tf.Close
599f332004-11-29Henrik Grubbström (Grubba) 
c4b35e2004-11-30Henrik Grubbström (Grubba)  CreatePikeLocation = 1
599f332004-11-29Henrik Grubbström (Grubba) End Function
2379162004-12-01Henrik Grubbström (Grubba)  ' 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
2b19d42004-12-01Henrik Grubbström (Grubba)  Set WshShell = CreateObject("WScript.Shell")
2379162004-12-01Henrik Grubbström (Grubba)  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
f4de172004-12-07Henrik Grubbström (Grubba) End Function
7d2cb52005-11-02Anders Johansson  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