This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Scripted Install

Hello

I am trying to do a scripted install of the Sophos Endpoint Security and Control Client on a windows XP machine. From what I can see the install comes in two parts; The Sophos Antivirus software and the Sophos Auto Updater software. I can install the Sophos Anti-Virus software using MSIEXEC. But the Auto-Update software requires credentials so that it can update from the web. I can not enter these credentials when installing the software silently.

Can anybody shed any light on this?

Regards

Steve

:715


This thread was automatically locked due to age.
Parents
  • If it's useful below is a VBScript that we are using to install Sophos. Edit and use at your own risk! :smileywink: To obfuscate the username and password use the ObfuscateUtil with the -w argrument and if using a [Active Directory] domain account for access specify the username as username@domain.com and NOT domain.com\username since the ObfuscateUtil tool doesn't like the backslash (\) and screws it up!

    Option Explicit
    Dim oShell, oFSO
    Dim sProgramFiles, sRemoteDistribution, sLocalAutoUpdatePath, sRemoteAutoUpdatePath, sLocalVersion, sRemoteVersion, sInstallArgs, sSetupPath
    Dim bCheckVersion, bInstall
    
    ' ==========================================================================
    ' Retrieve location of Program Files directory
    ' ==========================================================================
    Set oShell = CreateObject("WScript.Shell")
    sProgramFiles = oShell.ExpandEnvironmentStrings("%ProgramFiles%")
    
    ' ==========================================================================
    ' Set paths
    ' ==========================================================================
    '   sRemoteDistribution   = Path to Sophos CID for Windows Installation
    '   sLocalAutoUpdatePath  = Path and filename to check for install
    '   sRemoteAutoUpdatePath = Path and filename to compare installed version
    '   sSetupPath            = Path and filename for installation
    ' ==========================================================================
    sRemoteDistribution = "\\SERVERNAME\SophosUpdate\CIDs\S000\SAVSCFXP"
    sLocalAutoUpdatePath = sProgramFiles  + "\Sophos\AutoUpdate\ALsvc.exe"
    sRemoteAutoUpdatePath = sRemoteDistribution + "\sau\program files\Sophos\AutoUpdate\ALsvc.exe"
    sSetupPath = sRemoteDistribution + "\setup.exe"
    
    ' ==========================================================================
    ' Set arguments for installation setup
    ' ==========================================================================
    '   sInstallArgs          = List of arguments:
    '                            -ni          Non-interactive setup
    '                            -mng yes     Managed computer
    '                            -updp        Location of update packages
    '                            -ouser       Obfuscated username
    '                            -opwd        Obfuscated password
    ' ==========================================================================
    sInstallArgs = "-ni -mng yes -updp """ + sRemoteDistribution + """ -ouser <obfuscatedusername> -opwd <obfuscatedpassword>"
    
    ' ==========================================================================
    ' Is Sophos AutoUpdate Service already installed?
    ' ==========================================================================
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    
    If oFSO.FileExists(sLocalAutoUpdatePath) Then
        ' Already Installed
        bCheckVersion = True
    Else
        ' Install
        bCheckVersion = False
    End If
    
    ' ==========================================================================
    ' Is Sophos AutoUpdate Service the same version as the distribution?
    ' ==========================================================================
    If bCheckVersion = True Then
        ' Check to see if remote version is available
        If oFSO.FileExists(sRemoteAutoUpdatePath) Then
            ' Check Version
            sLocalVersion = oFSO.GetFileVersion(sLocalAutoUpdatePath)
            sRemoteVersion = oFSO.GetFileVersion(sRemoteAutoUpdatePath)
            If sLocalVersion <> sRemoteVersion Then
                ' The versions don't match
                bInstall = True
            Else
                ' The versions are the same
                bInstall = False
            End If
        Else
            ' Remote version not available
            bInstall = False
        End If
    Else
        ' No version installed
        bInstall = True
    End If
    
    ' ==========================================================================
    ' Do we need to do the install?
    ' ==========================================================================
    If bInstall = True Then
        ' Check to see if installation is available
        If oFSO.FileExists(sSetupPath) Then
            ' Install the latest version of Sophos Anti-Virus
            oShell.Run """" + sSetupPath + """" + " " + sInstallArgs, 0, true
        Else
            'Do Nothing
        End If
    Else
        ' Do Nothing
    End If
    
    ' ==========================================================================
    ' Dispose of objects
    ' ==========================================================================
    On Error Resume Next
    oShell = Nothing
    oFSO = Nothing
    sProgramFiles = Nothing
    sRemoteDistribution = Nothing
    sLocalAutoUpdatePath = Nothing
    sRemoteAutoUpdatePath = Nothing
    sLocalVersion = Nothing
    sRemoteVersion = Nothing
    sInstallArgs = Nothing
    sSetupPath = Nothing
    bCheckVersion = Nothing
    bInstall = Nothing
    :1291
Reply
  • If it's useful below is a VBScript that we are using to install Sophos. Edit and use at your own risk! :smileywink: To obfuscate the username and password use the ObfuscateUtil with the -w argrument and if using a [Active Directory] domain account for access specify the username as username@domain.com and NOT domain.com\username since the ObfuscateUtil tool doesn't like the backslash (\) and screws it up!

    Option Explicit
    Dim oShell, oFSO
    Dim sProgramFiles, sRemoteDistribution, sLocalAutoUpdatePath, sRemoteAutoUpdatePath, sLocalVersion, sRemoteVersion, sInstallArgs, sSetupPath
    Dim bCheckVersion, bInstall
    
    ' ==========================================================================
    ' Retrieve location of Program Files directory
    ' ==========================================================================
    Set oShell = CreateObject("WScript.Shell")
    sProgramFiles = oShell.ExpandEnvironmentStrings("%ProgramFiles%")
    
    ' ==========================================================================
    ' Set paths
    ' ==========================================================================
    '   sRemoteDistribution   = Path to Sophos CID for Windows Installation
    '   sLocalAutoUpdatePath  = Path and filename to check for install
    '   sRemoteAutoUpdatePath = Path and filename to compare installed version
    '   sSetupPath            = Path and filename for installation
    ' ==========================================================================
    sRemoteDistribution = "\\SERVERNAME\SophosUpdate\CIDs\S000\SAVSCFXP"
    sLocalAutoUpdatePath = sProgramFiles  + "\Sophos\AutoUpdate\ALsvc.exe"
    sRemoteAutoUpdatePath = sRemoteDistribution + "\sau\program files\Sophos\AutoUpdate\ALsvc.exe"
    sSetupPath = sRemoteDistribution + "\setup.exe"
    
    ' ==========================================================================
    ' Set arguments for installation setup
    ' ==========================================================================
    '   sInstallArgs          = List of arguments:
    '                            -ni          Non-interactive setup
    '                            -mng yes     Managed computer
    '                            -updp        Location of update packages
    '                            -ouser       Obfuscated username
    '                            -opwd        Obfuscated password
    ' ==========================================================================
    sInstallArgs = "-ni -mng yes -updp """ + sRemoteDistribution + """ -ouser <obfuscatedusername> -opwd <obfuscatedpassword>"
    
    ' ==========================================================================
    ' Is Sophos AutoUpdate Service already installed?
    ' ==========================================================================
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    
    If oFSO.FileExists(sLocalAutoUpdatePath) Then
        ' Already Installed
        bCheckVersion = True
    Else
        ' Install
        bCheckVersion = False
    End If
    
    ' ==========================================================================
    ' Is Sophos AutoUpdate Service the same version as the distribution?
    ' ==========================================================================
    If bCheckVersion = True Then
        ' Check to see if remote version is available
        If oFSO.FileExists(sRemoteAutoUpdatePath) Then
            ' Check Version
            sLocalVersion = oFSO.GetFileVersion(sLocalAutoUpdatePath)
            sRemoteVersion = oFSO.GetFileVersion(sRemoteAutoUpdatePath)
            If sLocalVersion <> sRemoteVersion Then
                ' The versions don't match
                bInstall = True
            Else
                ' The versions are the same
                bInstall = False
            End If
        Else
            ' Remote version not available
            bInstall = False
        End If
    Else
        ' No version installed
        bInstall = True
    End If
    
    ' ==========================================================================
    ' Do we need to do the install?
    ' ==========================================================================
    If bInstall = True Then
        ' Check to see if installation is available
        If oFSO.FileExists(sSetupPath) Then
            ' Install the latest version of Sophos Anti-Virus
            oShell.Run """" + sSetupPath + """" + " " + sInstallArgs, 0, true
        Else
            'Do Nothing
        End If
    Else
        ' Do Nothing
    End If
    
    ' ==========================================================================
    ' Dispose of objects
    ' ==========================================================================
    On Error Resume Next
    oShell = Nothing
    oFSO = Nothing
    sProgramFiles = Nothing
    sRemoteDistribution = Nothing
    sLocalAutoUpdatePath = Nothing
    sRemoteAutoUpdatePath = Nothing
    sLocalVersion = Nothing
    sRemoteVersion = Nothing
    sInstallArgs = Nothing
    sSetupPath = Nothing
    bCheckVersion = Nothing
    bInstall = Nothing
    :1291
Children
No Data