You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.4 KiB
Plaintext

Option Explicit
Dim wshshell,fso,i,Fnct
Dim strPath,strSystemFolder,strWinFolder,strTempFolder
Dim Arguments
'----------------------------- Objekte erzeugen --------------------------------
i = 0
On Error Resume Next
Do
err.Clear
i = i+1
Set wshshell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
WScript.Sleep 1000
Loop Until Err.Number = 0 OR i > 30
If Err.Number <> 0 Then
WScript.Quit
End If
On Error Goto 0
'--------------------------- Standardpfade -------------------------------------
strPath = GetCurrentPath()
strSystemFolder = fso.GetSpecialFolder(1) & "\"
strWinFolder = fso.GetSpecialFolder(0) & "\"
strTempFolder = fso.GetSpecialFolder(2) & "\"
'------------------------------ Main -------------------------------------------
Set Arguments = WScript.Arguments
If Arguments.Count > 0 Then
Reply = Arguments(0)
End If
'Systemdateien kopieren
Call wshshell.Run(strPath & "PrepareStart1.vbs",1,True)
Set Dlg = CreateObject("Install.YesNoDlg")
Set Fnct = CreateObject("Install.Functions")
'Startbildschirm
Dim Dlg,Reply,TmpResult
Set Dlg = CreateObject("Install.StartPictureDlg")
Call Dlg.SetLine(0, "Installation")
Call Dlg.SetLine(1, "CD 2/2")
If Reply <> "SILENT" Then
Dlg.Show
TmpResult = Dlg.Result
Else
TmpResult = vbYes
End If
'Installation
If TmpResult = vbYes Then
Call wshshell.Run(strPath & "Warning.vbs")
'Infodateien kopieren
Dim strMainVolume
strMainVolume = ExpandPath("%MAIN_VOLUME%","c:\")
Call fso.CopyFile(strPath & "Software.txt",strMainVolume)
Call wshshell.Run(strPath & "SaveSerNo.vbs",1,True)
Call wshshell.Run(strPath & "Install1.vbs",1,True)
Call wshshell.Run(strPath & "PrepareRestart1.vbs",1,True)
Dim Key
key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\VbStart"
wshshell.RegWrite key,"wscript.exe " & strPath & "Start2.vbs"
Call Fnct.ExitWindows(2)
End If
'------------------------------- 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