Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim wSH, FSO, startDir, utLoc, Arch, utExe, utRegLoc, Fld, dst, File, ret, forceNext
- Set FSO = CreateObject("Scripting.FileSystemObject")
- Set wSH = wScript.CreateObject("wScript.Shell")
- ret = msgbox("Do you want to install (also overwrites/updates) the" & vbcrlf & _
- "Stargate Atlantis map and all its dependancies?" & vbcrlf & vbcrlf & _
- " Yes - Installs and/or updates." & vbcrlf & _
- " No - Cancels request and exits." & vbcrlf & vbcrlf & _
- "A message box will signal completion." & vbcrlf & vbcrlf & _
- "Install?", vbYesNo + vbDefaultButton1 + vbInformation, "Install/Update SGA Map")
- If not ret = vbYes then wscript.Quit
- utLoc = "C:\UT2004"
- Arch = GetObject("winmgmts:root\cimv2:Win32_Processor='cpu0'").AddressWidth
- startDir = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName)))
- If Arch = "64" Then
- utRegLoc = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Unreal Technology\Installed Apps\UT2004\Folder"
- ElseIf Arch = "32" Then
- utRegLoc = "HKEY_LOCAL_MACHINE\SOFTWARE\Unreal Technology\Installed Apps\UT2004\Folder"
- Else
- ret = MsgBox("Cannot Determine OS Architecture! Try running again as admin?", vbCritical, "Error!")
- wScript.Quit
- End If
- utExe = utLoc & "\System\UT2004.exe"
- If Not FSO.FileExists(utExe) Then
- utLoc = wSH.RegRead(utRegLoc)
- utExe = utLoc & "\System\UT2004.exe"
- If Not FSO.FileExists(utExe) Then
- ret = MsgBox("Cannot find UT2004!", vbCritical, "Error!")
- wScript.quit
- End If
- End If
- Set Fld = FSO.getfolder(startDir)
- forceNext = false
- For Each File In fld.files
- Select Case ucase(right(File.Name, 4))
- Case ".USX"
- dst = utLoc & "\StaticMeshes\" & File.Name
- Case ".UTX"
- dst = utLoc & "\Textures\" & File.Name
- Case ".UT2"
- dst = utLoc & "\Maps\" & File.Name
- Case ".UCL", "RV.U"
- dst = utLoc & "\System\" & File.Name
- Case ".UKX"
- dst = utLoc & "\Animations\" & File.Name
- Case Else
- forceNext = true
- End Select
- If not forceNext then
- FSO.CopyFile File.Path, dst
- else
- forceNext = false
- end if
- next
- ret = Msgbox("File copy complete!", vbinformation, "SGA map install finished")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement