0f1fb22004-11-29Henrik Grubbström (Grubba) '
0917d32013-03-04Anders Johansson ' $Id$
0f1fb22004-11-29Henrik Grubbström (Grubba) ' ' Companion file to RoxenUI.wxs with custom actions. ' ' 2004-11-29 Henrik Grubbström '
c37bfd2004-12-07Henrik Grubbström (Grubba) ' At call time the CustomActionData property has been set to [TARGETDIR].
bc028d2004-11-30Henrik Grubbström (Grubba) '
46bb612004-12-07Henrik Grubbström (Grubba) ' Remove any previously installed service. Function RemoveOldService()
f4d5142004-12-07Henrik Grubbström (Grubba)  Dim WshShell, serverdir
c37bfd2004-12-07Henrik Grubbström (Grubba)  targetdir = Session.Property("CustomActionData")
46bb612004-12-07Henrik Grubbström (Grubba)  Set WshShell = CreateObject("WScript.Shell")
c37bfd2004-12-07Henrik Grubbström (Grubba)  WshShell.CurrentDirectory = targetdir
46bb612004-12-07Henrik Grubbström (Grubba) 
c37bfd2004-12-07Henrik Grubbström (Grubba)  WshShell.Run """" & targetdir & "ntstart"" --remove", 0, True
46bb612004-12-07Henrik Grubbström (Grubba)  RemoveOldService = 1 End Function
353aa02009-05-26Henrik Grubbström (Grubba) ' Start the Roxen Service. ' ' This kludge is needed to delay the start of the service until ' after COMMIT, which is needed to allow the side-by-side assemblies ' to complete installation before we try to use them. ' ' Why couldn't MS do the senisible thing and have inodes instead of ' having kludges upon kludges to work around their design bugs? ' Both side-by-side assemblies and their activation after COMMIT ' are kludges around the lack of inodes. Function StartRoxenService() Dim WshShell Set WshShell = CreateObject("WScript.Shell") WshShell.Run "NET START RoxenService", 0, True StartRoxenService = 1 End Function
62f1d02009-02-12Henrik Grubbström (Grubba) ' At call time the CustomActionData property has been set to
7547a82009-03-04Henrik Grubbström (Grubba) ' [SERVERDIR];[MYSQLBASE];[MYSQLDEXE];[MYISAMCHKEXE];[MYSQLADMINEXE].
62f1d02009-02-12Henrik Grubbström (Grubba) ' ' Creates "[SERVERDIR]mysql-location.txt" with the
74842a2009-02-12Henrik Grubbström (Grubba) ' content "basedir=[MYSQLBASE]"
ed47ad2009-02-16Henrik Grubbström (Grubba) ' "mysqld=[MYSQLDEXE]" ' "myisamchk=[MYISAMCHKEXE]"
7547a82009-03-04Henrik Grubbström (Grubba) ' "mysqladmin=[MYSQLADMINEXE]"
62f1d02009-02-12Henrik Grubbström (Grubba) Function CreateMysqlLocation()
d59cc12009-02-17Henrik Grubbström (Grubba)  Dim re, matches, match, fso, tf, serverdir, mysqlbase, mysqld, myisamchk, i
61b6c22009-02-17Henrik Grubbström (Grubba)  Dim rest
62f1d02009-02-12Henrik Grubbström (Grubba) 
ed47ad2009-02-16Henrik Grubbström (Grubba)  serverdir = "" mysqlbase = "" mysqld = "" myisamchk = ""
7547a82009-03-04Henrik Grubbström (Grubba)  mysqladmin = ""
62f1d02009-02-12Henrik Grubbström (Grubba) 
61b6c22009-02-17Henrik Grubbström (Grubba)  rest = ""
62f1d02009-02-12Henrik Grubbström (Grubba)  Set re = New RegExp re.Pattern = "[^;]*" re.Global = True Set matches = re.Execute(Session.Property("CustomActionData"))
d59cc12009-02-17Henrik Grubbström (Grubba)  i = 0
62f1d02009-02-12Henrik Grubbström (Grubba)  For Each match in matches
9e7a672009-02-18Henrik Grubbström (Grubba)  ' NOTE: For some reason we get an empty match after each true match. ' Therefore we only look at the matches where i is even. If i = 0 Then
62f1d02009-02-12Henrik Grubbström (Grubba)  serverdir = match.Value
d8fc2b2009-02-13Henrik Grubbström (Grubba)  Else
9e7a672009-02-18Henrik Grubbström (Grubba)  If i = 2 Then
d8fc2b2009-02-13Henrik Grubbström (Grubba)  mysqlbase = match.Value Else
9e7a672009-02-18Henrik Grubbström (Grubba)  If i = 4 Then
d8fc2b2009-02-13Henrik Grubbström (Grubba)  mysqld = match.Value Else
9e7a672009-02-18Henrik Grubbström (Grubba)  If i = 6 Then
d8fc2b2009-02-13Henrik Grubbström (Grubba)  myisamchk = match.Value
61b6c22009-02-17Henrik Grubbström (Grubba)  Else
7547a82009-03-04Henrik Grubbström (Grubba)  If i = 8 Then mysqladmin = match.Value Else rest = rest & ";" & match.Value End If
d8fc2b2009-02-13Henrik Grubbström (Grubba)  End If End If End If
62f1d02009-02-12Henrik Grubbström (Grubba)  End If
5f79b12009-02-18Henrik Grubbström (Grubba)  i = i + 1
62f1d02009-02-12Henrik Grubbström (Grubba)  Next Set fso = CreateObject("Scripting.FileSystemObject") Set tf = fso.CreateTextFile(serverdir & "mysql-location.txt", True)
0917d32013-03-04Anders Johansson  tf.writeLine("# Created by $Id$")
d59cc12009-02-17Henrik Grubbström (Grubba)  tf.writeLine("# DEBUG: " & Session.Property("CustomActionData"))
61b6c22009-02-17Henrik Grubbström (Grubba)  tf.writeLine("# DEBUG: " & rest & ";")
7547a82009-03-04Henrik Grubbström (Grubba)  tf.writeLine("") tf.writeLine("# Configuration file for locating the MySQL installation.") tf.writeLine("") tf.writeLine("# Note that the keys are case-sensitive and must be") tf.writeLine("# provided in lower-case.") tf.writeLine("") tf.writeLine("# basedir is the base directory for the MySQL installation.")
c8c0e82009-02-16Henrik Grubbström (Grubba)  tf.writeLine("basedir=" & mysqlbase)
7547a82009-03-04Henrik Grubbström (Grubba)  tf.writeLine("# mysqld is the full path to the mysqld binary.")
ed47ad2009-02-16Henrik Grubbström (Grubba)  If mysqld <> "" Then
c8c0e82009-02-16Henrik Grubbström (Grubba)  tf.writeLine("mysqld=" & mysqld)
7547a82009-03-04Henrik Grubbström (Grubba)  Else tf.writeLine("#mysqld=")
c8c0e82009-02-16Henrik Grubbström (Grubba)  End If
7547a82009-03-04Henrik Grubbström (Grubba)  tf.writeLine("# myisamchk is the full path to the myisamchk binary.")
ed47ad2009-02-16Henrik Grubbström (Grubba)  If myisamchk <> "" Then
c8c0e82009-02-16Henrik Grubbström (Grubba)  tf.writeLine("myisamchk=" & myisamchk)
7547a82009-03-04Henrik Grubbström (Grubba)  Else tf.writeLine("#myisamchk=") End If tf.writeLine("# mysqladmin is the full path to the mysqladmin binary.") If mysqladmin <> "" Then
2442fc2009-04-23Jonas Wallden  tf.writeLine("mysqladmin=" & mysqladmin)
7547a82009-03-04Henrik Grubbström (Grubba)  Else tf.writeLine("#mysqladmin=")
c8c0e82009-02-16Henrik Grubbström (Grubba)  End If
62f1d02009-02-12Henrik Grubbström (Grubba)  tf.Close CreateMysqlLocation = 1 End Function
46bb612004-12-07Henrik Grubbström (Grubba) ' At call time the CustomActionData property has been set to [SERVERDIR]. '
0f1fb22004-11-29Henrik Grubbström (Grubba) ' Creates "[SERVERDIR]pikelocation.txt" with the ' content "[SERVERDIR]pike\bin\pike" Function CreatePikeLocation()
bc028d2004-11-30Henrik Grubbström (Grubba)  Dim fso, tf, serverdir Set fso = CreateObject("Scripting.FileSystemObject")
0f1fb22004-11-29Henrik Grubbström (Grubba) 
bc028d2004-11-30Henrik Grubbström (Grubba)  serverdir = Session.Property("CustomActionData")
0f1fb22004-11-29Henrik Grubbström (Grubba) 
bc028d2004-11-30Henrik Grubbström (Grubba)  Set tf = fso.CreateTextFile(serverdir & "pikelocation.txt", True) tf.WriteLine(serverdir & "pike\bin\pike") tf.Close
0f1fb22004-11-29Henrik Grubbström (Grubba) 
bc028d2004-11-30Henrik Grubbström (Grubba)  CreatePikeLocation = 1
0f1fb22004-11-29Henrik Grubbström (Grubba) End Function
d37c602004-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
daad0e2008-10-20Marcus Wellhardh  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
d37c602004-12-01Henrik Grubbström (Grubba)  CreateConfigInterface = 1
46bb612004-12-07Henrik Grubbström (Grubba) End Function
0be28d2005-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