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.

68 lines
1.7 KiB
Plaintext

Option Explicit
Dim wshshell,fso,Fnct
Dim Key,i
Dim DoNothing
Const ComputerIni = "C:\Computer.ini"
Const ComuterTxt = "c:\Computer.txt"
On Error Resume Next
set wshshell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set Fnct = CreateObject("Install.Functions")
if err.Number <> 0 Then
WScript.Quit
End If
err.Clear
On Error Goto 0
If Not fso.FileExists(ComputerIni) And Not fso.FileExists(ComuterTxt) Then WScript.Quit
DoNothing = FALSE
If fso.FileExists(ComputerIni) Then
If Fnct.GetIniString("CD1_Setup","Preinstalled",ComputerIni) = 0 Then
DoNothing = TRUE
End If
End If
If fso.FileExists("c:\Servicepacks\InstallSp.ini") Then
DoNothing = TRUE
End If
If DoNothing Then
If Not wshshell.AppActivate("SaveAndRestore") Then
Call wshshell.Run ("C:\SaveAndRestore\SaveAndRestore.exe")
End If
WScript.Quit
End If
If fso.FileExists(GetCurrentPath & "Servicepacks\Servicepacks\SaveAndRestore\SaveAndRestore_XP\SaveAndRestore.msi") Then
Call wshshell.Run(GetCurrentPath() & "UpgradingSAR.vbs")
i = 0
Do
i = i+1
wscript.Sleep(1000)
Loop Until wshshell.AppActivate("Busy!") OR i>20
If wshshell.AppActivate("SaveAndRestore") Then
Call wshshell.SendKeys("%{F4}")
End If
Call wshshell.Run(GetCurrentPath() & "Servicepacks\Servicepacks\SaveAndRestore\Setup.vbs",1,true)
End If
WScript.Sleep(3000)
If(wshshell.AppActivate("Busy!")) Then wshshell.SendKeys("%{F4}")
If Not wshshell.AppActivate("SaveAndRestore") Then
Call wshshell.Run ("C:\SaveAndRestore\SaveAndRestore.exe")
End If
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