<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--
*************************************************************************
**           Copyright (c) 2015, Cisco Systems, All Rights Reserved
*************************************************************************
-->
<head>
<title>Cisco Secure Client Install Selector</title>
<meta http-equiv="MSThemeCompatible" content="Yes">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<HTA:APPLICATION 
     ID="installSelect" 
     APPLICATIONNAME="Cisco Secure Client - Installer"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     SELECTION="no"
     ICON="Setup\GUI.ico">
<script type="text/vbscript">
    'Window_OnLoad
    Window.ResizeTo 650, 670
    Window.moveto 0, 0

    Dim WshShell, objFSO, strVer, strTemp, Return, strReturn
    Dim bNeedsReboot, valNeedsReboot, valNumChecked
    Dim strLockDown, dblQuote
    
    strLockDown = ""
    dblQuote  = chr(34)
    valNeedsReboot = 3010

    Set WshShell = CreateObject("WScript.Shell")
    Set objFSO = CreateObject("Scripting.FileSystemObject")

    Dim strScriptDir
    strScriptDir = objFSO.GetParentFolderName(replace(installSelect.commandLine, dblQuote, ""))

    Sub Initialize
        Dim strVerFile
        strVerFile = strScriptDir & "\Setup\update.txt"
        If objFSO.FileExists(strVerFile) Then
            Set objTextFile = objFSO.OpenTextFile(strVerFile, 1)
            strVer = objTextFile.ReadAll
            objTextFile.Close
            strVer = Replace (strVer, ",", ".")
            strVer = Replace (strVer, vbNewLine, "")
        End If

        If Not IsEmpty(strVer) Then
            Version.InnerText = strVer
        Else
            Body.InnerHTML = "<p style='text-align:center'>Unable to determine Cisco Secure Client package version (missing update.txt).</p>"
        End If

        strTemp = objFSO.GetSpecialFolder(TemporaryFolder)
        strTemp = strTemp & "\Temp\"
    End Sub

    ' Main Subroutine
    Sub TestCheckboxes
        valNumChecked = 0
        strSelected = vbCrLf
        If CheckboxVPN.Checked Then
            strSelected = strSelected & "AnyConnect VPN" & vbCrLf
            blnInstallVPN = true
            valNumChecked = valNumChecked + 1
        End If
        If CheckboxSBL.Checked Then
            strSelected = strSelected & "Start Before Login" & vbCrLf
            blnInstallSBL = true
            valNumChecked = valNumChecked + 1
        End If
        If CheckboxDART.Checked Then
            strSelected = strSelected & "Diagnostic And Reporting Tool" & vbCrLf
            blnInstallDART = true
            valNumChecked = valNumChecked + 1
        End If
        If CheckboxPosture.Checked Then
            strSelected = strSelected & "Secure Firewall Posture" & vbCrLf
            blnInstallPosture = true
            valNumChecked = valNumChecked + 1
        End If
        If CheckboxISEPosture.Checked Then
            If blnInstallVPN Then
                strSelected = strSelected & "ISE Posture" & vbCrLf
                blnInstallISEPosture = true
                valNumChecked = valNumChecked + 1
            Else
                strSelected = strSelected & "Stand-Alone ISE Posture" & vbCrLf
                blnInstallISEPostureAlone = true
                valNumChecked = valNumChecked + 1
            End If
        End If
        If CheckboxNVM.Checked Then
            strSelected = strSelected & "Network Visibility Module" & vbCrLf
            blnInstallNVM = true
            valNumChecked = valNumChecked + 1
        End If
        If CheckboxNAM.Checked Then
            If blnInstallVPN Then
                strSelected = strSelected & "Network Access Manager" & vbCrLf
                blnInstallNAM = true
                valNumChecked = valNumChecked + 1
            Else
                strSelected = strSelected & "Stand-Alone Network Access Manager" & vbCrLf
                blnInstallNAMAlone = true
                valNumChecked = valNumChecked + 1
            End If
        End If
        If CheckboxUmbrella.Checked Then
            If blnInstallVPN Then
                strSelected = strSelected & "Umbrella" & vbCrLf
                blnInstallUmbrella = true
                valNumChecked = valNumChecked + 1
            Else
                strSelected = strSelected & "Stand-Alone Umbrella" & vbCrLf
                blnInstallUmbrellaAlone = true
                valNumChecked = valNumChecked + 1
            End If
        End If
        If CheckboxThousandEyes.Checked Then
            strSelected = strSelected & "ThousandEyes" & vbCrLf
            blnInstallThousandEyes = true
            valNumChecked = valNumChecked + 1
        End If
        If CheckboxZTA.Checked Then
            If blnInstallVPN Then
                strSelected = strSelected & "Zero Trust Access" & vbCrLf
                blnInstallZTA = true
                valNumChecked = valNumChecked + 1
            Else
                strSelected = strSelected & "Stand-Alone Zero Trust Access" & vbCrLf
                blnInstallZTAAlone = true
                valNumChecked = valNumChecked + 1
            End If
        End If
        If valNumChecked > 0 Then
            blnAnswer = window.confirm( "You selected the following Cisco Secure Client " & strVer & " modules to install: " & vbCrLf & strSelected & vbCrLf & "Do you wish to install these now?")
            If Not blnAnswer Then
                Exit Sub
            End If
           
            blnAcceptedEULA = window.showModalDialog(strScriptDir & "/Setup/eula_dialog.html","","dialogwidth=650px;dialogheight=450px;status:no")
            If blnAcceptedEULA Then
                If blnInstallVPN Then
                    InstallVPN
                End If
                If blnInstallDART Then
                    InstallDART
                End If
                If blnInstallNAM Then
                    InstallNAM
                End If
                If blnInstallPosture Then
                    InstallPosture
                End If
                If blnInstallISEPosture Then
                    InstallISEPosture
                End If
                If blnInstallNVM Then
                    InstallNVM
                End If
                If blnInstallUmbrella Then
                    InstallUmbrella
                End If
                If blnInstallThousandEyes Then
                    InstallThousandEyes
                End If
                If blnInstallSBL Then
                    InstallSBL
                End If
                If blnInstallZTA Then
                    InstallZTA
                End If
                If blnInstallNAMAlone Then
                    InstallAnyConnectDisableVPN
                    InstallNAM
                End If
                If blnInstallUmbrellaAlone Then
                    InstallAnyConnectDisableVPN
                    InstallUmbrella
                End If
                If blnInstallISEPostureAlone Then
                    InstallAnyConnectDisableVPN
                    InstallISEPosture
                End If
                If blnInstallZTAAlone Then
                    InstallAnyConnectDisableVPN
                    InstallZTA
                End If

                If bNeedsReboot Then
                    Msgbox "You must reboot your system for the installed changes to take effect.", vbOKOnly, "Cisco Secure Client Install Selector"
                Else
                    Msgbox "Installation complete.", vbOKOnly, "Cisco Secure Client Install Selector"
                End If

                ExitHTA
            End If
        End If
    End Sub

    ' Checkbox Dependencies Subroutines
    Sub CheckAll
        CheckboxVPN.Checked = CheckboxALL.Checked
        CheckboxSBL.Checked = CheckboxALL.Checked
        CheckboxNAM.Checked = CheckboxALL.Checked
        CheckboxPosture.Checked = CheckboxALL.Checked
        CheckboxISEPosture.Checked = CheckboxALL.Checked
        CheckboxNVM.Checked = CheckboxALL.Checked
        CheckboxUmbrella.Checked = CheckboxALL.Checked
        CheckboxThousandEyes.Checked = CheckboxALL.Checked
        CheckboxZTA.Checked = CheckboxALL.Checked
    End Sub

    Sub CheckDependsVPN
        CheckSBLChecked
        If CheckboxVPN.Checked=False Then
            CheckboxPosture.Checked = False
            CheckboxISEPosture.Checked = False
            CheckboxNVM.Checked = False
            CheckboxAll.Checked = False
        End If
    End Sub
    
    Sub CheckSBLDependsOnSBLClick
        If CheckboxSBL.Checked Then
            CheckboxVPN.Checked = True
        End If
    End Sub

    Sub CheckSBLChecked
        If CheckboxVPN.Checked=False And CheckboxNAM.Checked=False Then
            CheckboxSBL.checked=False
        End If
    End Sub
    
    Sub CheckDependsNAM
        CheckSBLChecked
        If CheckboxNAM.Checked=False Then
            CheckboxAll.Checked = False
        End If
    End Sub

    Sub CheckPostureDepends
        If CheckboxPosture.Checked Then
            CheckboxVPN.Checked = True
        End If
        If CheckboxPosture.Checked=False Then
            CheckboxALL.Checked = False
        End If
    End Sub
 
    Sub CheckNVMDepends
        If CheckboxNVM.Checked Then
            CheckboxVPN.Checked = True
        End If
        If CheckboxNVM.Checked=False Then
            CheckboxALL.Checked = False
        End If
    End Sub
 
    Sub CheckALLFalse
        If CheckboxNAM.Checked=False or CheckboxISEPosture.Checked=False or CheckboxNVM.Checked=False or CheckboxUmbrella.Checked=False or CheckboxThousandEyes.Checked=False or CheckboxZTA.Checked=False Then
            CheckboxALL.Checked = False
        End If
    End Sub
    
    Sub SetLockDownFlag
        If CheckboxLOCKDOWN.Checked Then
            strLockDown = "LOCKDOWN=1"
        Else
            strLockDown = ""
        End If
    End Sub
   
    ' Install Subroutines
    Function GetDateTimeString()
        Dim dd, MM, yy, hh, nn, ss
        Dim dateValue, timeValue, dtsNow

        'Store DateTimeStamp once.
        dtsNow = Now()

        'Individual date components
        MM = Right("00" & Month(dtsNow), 2)
        dd = Right("00" & Day(dtsNow), 2)
        yy = Year(dtsNow)
        hh = Right("00" & Hour(dtsNow), 2)
        nn = Right("00" & Minute(dtsNow), 2)
        ss = Right("00" & Second(dtsNow), 2)

        'Build the date string in the format mm-dd-yyyy
        dateValue = MM & dd & yy

        'Build the time string in the format hh:mm:ss
        timeValue = hh & nn & ss

        'Concatenate both together to build the timestamp MMddyyyy_hhmmss
        GetDateTimeString = dateValue & "_" & timeValue
    End Function

REM  Returns name of first file found in directory that matches the first and second 
REM  segments of the strFilenameMatch as delimited by the strDelimiter
    Function GetFileNameSingleWildcard(strDirectory, strFilenameMatch, strDelimiter)
    Dim objFS, objDir, objFiles, objFile, strMatchArray

    Set objFS = CreateObject("Scripting.FileSystemObject")

    ' This function expects a single delimiter
    strMatchArray=Split(strFilenameMatch,strDelimiter)
    if UBound(strMatchArray) <> 1 then
        ' return empty string for invalid number of wildcards
        Exit Function
    End if

    Set objDir = objFS.GetFolder(strDirectory)
    Set objFiles = objDir.Files

    For Each objFile in ObjFiles
        ' check first segment and then second segment for match
        if (instr(1,objFile.Name, strMatchArray(0)) > 0) And (instr(Len(strMatchArray(0)),objFile.Name, strMatchArray(1)) > 0) then
            GetFileNameSingleWildcard = objFile.Name
            Exit For
        End if
    Next

    End Function

    Sub InstallVPN
        strInstallFile = "cisco-secure-client-win-" & strVer & "-core-vpn-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive PRE_DEPLOY_DISABLE_VPN=0 " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallSBL
        strInstallFile = "cisco-secure-client-win-" & strVer & "-sbl-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallDART
        strInstallFile = "cisco-secure-client-win-" & strVer & "-dart-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallNAM
        strInstallFile = "cisco-secure-client-win-" & strVer & "-nam-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallUmbrella
        strInstallFile = "cisco-secure-client-win-" & strVer & "-umbrella-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallAnyConnectDisableVPN
        strInstallFile = "cisco-secure-client-win-" & strVer & "-core-vpn-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive PRE_DEPLOY_DISABLE_VPN=1 " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub
        
    Sub InstallPosture
        strInstallFile = "cisco-secure-client-win-" & strVer & "-posture-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallISEPosture
        strInstallFile = "cisco-secure-client-win-" & strVer & "-iseposture-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallNVM
        strInstallFile = "cisco-secure-client-win-" & strVer & "-nvm-predeploy-k9"
        strLogFile = strInstallFile & "-install-" & GetDateTimeString & ".log"
        strInstallFile = strInstallFile & ".msi"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallThousandEyes
        strInstallFile = GetFileNameSingleWildcard(strScriptDir, "cisco-secure-client-win-*-thousandeyes-predeploy-k9.msi", "*")
        strLogFile = objFSO.GetBaseName(strInstallFile) & "-install-" & GetDateTimeString & ".log"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub InstallZTA
        strInstallFile = GetFileNameSingleWildcard(strScriptDir, "cisco-secure-client-win-*-zta-predeploy-k9.msi", "*")
        strLogFile = objFSO.GetBaseName(strInstallFile) & "-install-" & GetDateTimeString & ".log"
        strMsiexecCmdLine = "msiexec /package " & dblQuote & strScriptDir & "\" & strInstallFile & dblQuote & " /norestart /passive " & strLockDown & " /lvx* " & strTemp & strLogFile
        Return = WshShell.Run(strMsiexecCmdLine,1,True)
        If Return=valNeedsReboot Then
            bNeedsReboot=True
        End If
    End Sub

    Sub ExitHTA
        self.close()
    End Sub
</script>
</head>
<style>
p  {
    margin: 8px;
}
</style>
<body id="body" style="background-image=url('Setup/cues_bg.jpg');font-family:'Times New Roman',serif;font-size:24;color=white" onload="Initialize">
Select the Cisco Secure Client <span id="version">0.0.0</span> modules you wish to install:
<p>
<span class="tooltip" title="Installs the module that enables VPN capabilities.">
<input type="checkbox" id="vpn" name="CheckboxVPN" checked onclick="CheckDependsVPN">
<label for="vpn">Core & AnyConnect VPN</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the module that allows a VPN session and/or network logon to be established prior to a user logging onto the system.">
<input type="checkbox" id="sbl" name="CheckboxSBL" checked onclick="CheckSBLDependsOnSBLClick">
<label for="sbl">Start Before Login</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the module that provides Layer 2 device management and authentication for access to both wired and wireless networks.">
<input type="checkbox" id="nam" name="CheckboxNAM" checked onClick="CheckDependsNAM">
<label for="nam">Network Access Manager</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the module that provides the Cisco Secure Client with the ability to identify the operating system, antivirus, antispyware, and firewall software installed on the host prior to creating a remote access connection to the secure gateway.">
<input type="checkbox" id="posture" name="CheckboxPosture" checked onclick="CheckPostureDepends">
<label for="posture">Secure Firewall Posture</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the Network Visibility module which collects application telemetry data.">
<input type="checkbox" id="NVM" name="CheckboxNVM" checked onclick="CheckNVMDepends">
<label for="NVM">Network Visibility Module</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the module that enables Umbrella.">
<input type="checkbox" id="umbrella" name="CheckboxUmbrella" checked onclick="CheckAllFalse">
<label for="umbrella">Umbrella</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the module that provides the Cisco Secure Client with the functionality needed to authenticate to wired or wireless networks controlled by the Identity Services Engine, including examination and any needed remediation of the connecting host environment.">
<input type="checkbox" id="iseposture" name="CheckboxISEPosture" checked onclick="CheckAllFalse">
<label for="iseposture">ISE Posture</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the module that enables ThousandEyes.">
<input type="checkbox" id="thousandeyes" name="CheckboxThousandEyes" checked onclick="CheckAllFalse">
<label for="thousandeyes">ThousandEyes</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the module that enables ZTA.">
<input type="checkbox" id="zta" name="CheckboxZTA" checked onclick="CheckAllFalse">
<label for="zta">Zero Trust Access</label>
</span>
</p>
<p>
<span class="tooltip" title="Installs the entire suite of Cisco Secure Client software components.">
<input type="checkbox" id="all" name="CheckboxALL" checked onClick="CheckAll">
<label for="all">Select All</label>
</span>
</p>
<p style="margin-top:28px">
<span class="tooltip" title="Installs the diagnostics module that collects Cisco Secure Client troubleshooting information.">
<input type="checkbox" id="dart" name="CheckboxDART" checked>
<label for="dart">Diagnostic And Reporting Tool</label>
</span>
</p>
<br>
<p style="text-align:right">
<span class="tooltip" title="Locks down the permissions of the Windows Services for each module that is installed. This will prevent any user from stopping the service, including local administrators.">
<input type="checkbox" id="lockdown" name="CheckboxLOCKDOWN" onclick="SetLockDownFlag">
<label for="lockdown">Lock Down Component Services</label>
</span>
</p>
<p>
<input type="submit" value="Install Selected" id="run_button" style="font-size:20;" onClick="TestCheckboxes">
</p>
</body>
</html>
