Hi all,
How do you upgrade a BackupAssist installation? Well, up until now, the answer has been: manually.
But one of our Aussie helpdesk team, Aaron, has done a great job in writing a VB script that will download the latest BackupAssist installation to a temp directory, uninstall the old version and install the new version – thereby performing an automated upgrade.
We’ve tested this on a variety of machines – SBS 2003, Vista, XP, Server 2008, and SBS 2008 – and it has worked for us. Now it’s time to turn it over to the community and get some feedback on this.
To run the script – save the text below to a vbs file – say BAUpgrader.vbs – and then run it from the command prompt:
cscript BAUpgrader.vbs
Make sure you’re running the command prompt as the Administrator user, with elevated rights if you have UAC turned on.
If you have any feedback, please post a comment below. We have not yet tested it with management software like Kaseya – but if you’d like to give it a go (in a non-production environment!) please feel free.
Also note that this is a BETA script, so the usual disclaimers apply.
—- BEGIN SCRIPT BELOW – FOR ALL INSTALLATIONS APART FROM SERVER CORE AND HYPER-V SERVER —-
—- Note: this script is subject the same EULA as BackupAssist —-
sTarget = “C:\temp”
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
If Not objFSO.FolderExists(sTarget) Then
objFSO.CreateFolder(“c:\temp”)
End If
strFileURL = “http://www.backupassist.com/downloads/releases/latest/BackupAssistV5.msi”
strHDLocation = “c:\temp\BackupAssistV5.msi”
Set objXMLHTTP = CreateObject(“MSXML2.XMLHTTP”)
objXMLHTTP.open “GET”, strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
WScript.StdOut.Write “Downloading the latest version of BackupAssist…” & VbCrLf & VbCrLf
Set objADOStream = CreateObject(“ADODB.Stream”)
objADOStream.Open
objADOStream.Type = 1 ‘adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0
Set objFSO = Createobject(“Scripting.FileSystemObject”)
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
WScript.StdOut.Write “Download complete” & VbCrLf & VbCrLf
Set objADOStream = Nothing
End if
Dim installer
Set installer = CreateObject(“WindowsInstaller.Installer”)
strTempProdCode = “”
For Each strProductCode In installer.Products
If installer.ProductInfo(strProductCode, “InstalledProductName”) = “BackupAssist v5″ Then
strTempProdCode = strProductCode
End If
Next
set fso = Wscript.CreateObject(“Scripting.FileSystemObject”)
If Not strTempProdCode = “” Then
If fso.FileExists(“C:\Temp\BackupAssistV5.msi”) Then
Dim objShell
strTemp = strTempProdCode & ” /passive”
Set objShell = CreateObject(“WScript.Shell”)
objShell.Run “%comspec% /c msiexec /x ” & strTemp _
& “& msiexec /package c:\temp\BackupAssistV5.msi /passive”
WScript.StdOut.Write”Automated update was successful”
WScript.Quit
Else WScript.StdOut.Write”The BackupAssist update did not download. The automated update was unsuccessful”
End If
Else
WScript.StdOut.Write “BackupAssist is not currently installed on this machine!”& VbCrLf &”Automatic updating not available!” & VbCrLf & VbCrLf
End If