|
|
'BDE-Konfiguration im Rahmen von SaveAndRestore
|
|
|
|
|
|
Option Explicit
|
|
|
Dim wshshell,fso,i,Fnct
|
|
|
Dim strPath,strSystemFolder,strWinFolder,strTempFolder
|
|
|
'----------------------------- Objekte erzeugen --------------------------------
|
|
|
Set wshshell = CreateObjectSafely("WScript.Shell")
|
|
|
Set fso = CreateObjectSafely("Scripting.FileSystemObject")
|
|
|
Set Fnct = CreateObjectSafely("Install.Functions")
|
|
|
|
|
|
'--------------------------- Standardpfade -------------------------------------
|
|
|
strPath = GetCurrentPath()
|
|
|
strSystemFolder = fso.GetSpecialFolder(1) & "\"
|
|
|
strWinFolder = fso.GetSpecialFolder(0) & "\"
|
|
|
strTempFolder = fso.GetSpecialFolder(2) & "\"
|
|
|
|
|
|
|
|
|
'------------------------------ Main -------------------------------------------
|
|
|
Dim strFockeTools
|
|
|
Dim strFdcs
|
|
|
strFockeTools = ExpandPath("%FOCKETOOLSDIR%","C:\FockeTools") & "\"
|
|
|
strFdcs = ExpandPath("%FOCKEDCSDIR%","C:\FockeDcs") & "\"
|
|
|
|
|
|
'Firewall konfigurieren
|
|
|
If fso.FileExists(strFockeTools & "\fwprgadd.bat") Then
|
|
|
Call wshshell.Run(strFockeTools & "\fwprgadd.bat " + strFDCS + "\FDas.exe ""Focke Data Server""",1,True)
|
|
|
Call wshshell.Run(strFockeTools & "\fwportadd.bat " + "TCP 135 RPC_TCP",1,True)
|
|
|
Call wshshell.Run("regedit /s " & strFDCS & "fdcs_changes.reg",1,True)
|
|
|
End If
|
|
|
|
|
|
'Datenbank
|
|
|
'Vorher muss auf jeden Fall die Visualisierung konfiguriert worden sein
|
|
|
Call wshshell.Run(strFdcs & "indcpy32.exe -a")
|
|
|
|
|
|
'Autostart Eintrag
|
|
|
Dim scut
|
|
|
set scut = wshshell.CreateShortcut(wshshell.SpecialFolders(3) & "\StartUp.exe.lnk")
|
|
|
scut.TargetPath = "c:\FockeTools\StartUp.exe"
|
|
|
scut.Arguments = ""
|
|
|
scut.Save
|
|
|
|
|
|
|
|
|
|
|
|
'------------------------------- Funktionen ------------------------------------
|
|
|
Function GetCurrentPath()
|
|
|
Dim l_strScriptName
|
|
|
Dim l_strTemp
|
|
|
|
|
|
l_strScriptName = WScript.ScriptFullName
|
|
|
l_strTemp = WScript.ScriptName
|
|
|
GetCurrentPath = Left(l_strScriptName, Len(l_strScriptName) - Len(l_strTemp))
|
|
|
End Function
|
|
|
|
|
|
Function ExpandPath(p_strEnvironment,p_strDefault)
|
|
|
Dim l_strTemp
|
|
|
l_strTemp = wshshell.ExpandEnvironmentStrings(p_strEnvironment)
|
|
|
If l_strTemp = p_strEnvironment Then
|
|
|
l_strTemp = p_strDefault
|
|
|
End If
|
|
|
ExpandPath = l_strTemp
|
|
|
End Function
|
|
|
|
|
|
'Hilfsfunktion zum Erzeugen von Objekten
|
|
|
'Ist die Erzeugung nicht m<>glich, wird das Skript beendet
|
|
|
Function CreateObjectSafely(p_strObject)
|
|
|
Dim i
|
|
|
i = 0
|
|
|
On Error Resume Next
|
|
|
Do
|
|
|
err.Clear
|
|
|
i = i+1
|
|
|
Set CreateObjectSafely = CreateObject(p_strObject)
|
|
|
WScript.Sleep 1000
|
|
|
Loop Until Err.Number = 0 OR i > 30
|
|
|
|
|
|
If Err.Number <> 0 Then
|
|
|
MsgBox "Unable to Create Object: " & p_strObject
|
|
|
WScript.Quit
|
|
|
End If
|
|
|
|
|
|
On Error Goto 0
|
|
|
End Function
|
|
|
'------------------------------ Sub -------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|