Jump to content

Cisco VPN Installer


ken82m
 Share

Recommended Posts

This forum has me out plenty I hope I'm contributing something something can make use of.

This is a script a use to allow my end users without admin rights install the Cisco VPN Client.

It has been tested with 4.8 but should work with newer versions such as 5.0

Just update the code with the account information for the admin account you want to install with.

As is the script should be run from the folder that contains the setup files.

You can also copy your PCF file (VPN Connection Settings) into that same folder, and the installer will automatically import it. You can call it anything you want as long as you keep the PCF extension.

Global $UserProf
$UserProf = @UserProfileDir


If $CmdLine[0] = 2 Then
If $CmdLine[1] = "CopyFiles" Then
$UserProf = $CmdLine[2]
CopyFiles()
Exit
EndIf
EndIf

RunAsSet("Administrator", @ComputerName, "local admin password")
$MSIRun = Run(@ComSpec & ' /C start /wait msiexec /i "' & @ScriptDir & '\vpnclient_setup.msi" /qb', @ScriptDir, @SW_MINIMIZE)

Do
$1 = WinWait("Cisco Systems VPN Client 4.8.00.0440", "Please wait while Windows configures Cisco", 5)
$2 = ProcessExists($MSIRun)
Until $1 = 1 OR $2 = 0

If $2 = 0 Then 
MsgBox(4096+48, "CWD Cisco VPN Installer", "The VPN client installation has failed" & @CR & "for an unknown reason")
Exit
EndIf

$1 = 3
$2 = 3
Do
$1 = WinWait("Cisco Systems VPN Client 4.8.00.0440", "You must restart your system", 5)
$2 = ProcessExists($MSIRun)
Until $1 = 1 OR $2 = 0

If $1 = 1 Then ControlClick("Cisco Systems VPN Client 4.8.00.0440", "You must restart your system", 3002 , "left")

If FileExists("C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe") Then
RunWait(@ScriptFullPath & ' "CopyFiles" "' & $UserProf & '"')
$Msg = MsgBox(4096+64+4+262144, "CWD Cisco VPN Installer", "The VPN client installation has completed however your computer" & @CR & "must be restarted before using using it." & @Cr & @CR & "Would you like to restart your computer now?")
If $msg = 6 Then
Shutdown(4+2)
Else
MsgBox(4096+64+262144, "CWD Cisco VPN Installer", "Please restart your computer before attempting to connect.")
Exit
EndIf
Else
MsgBox(4096+48, "CWD Cisco VPN Installer", "The VPN client installation has failed" & @CR & "for an unknown reason")
Exit
EndIf

Exit

Func CopyFiles()
FileCopy(@ScriptDir & "\*.PNG", "C:\Program Files\Cisco Systems\VPN Client\Resources\*.*", 1)
FileCreateShortcut("C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe", $UserProf & "\Application Data\Microsoft\Internet Explorer\Quick Launch\CWD-VPN (Cisco).lnk", "C:\Program Files\Cisco Systems\VPN Client\", ' -c "CooperNAM (S)"', "", "C:\Program Files\Cisco Systems\VPN Client\Resources\connected.ico")
FileCreateShortcut("C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe", @DesktopCommonDir & "\CWD-VPN (Cisco).lnk", "C:\Program Files\Cisco Systems\VPN Client\", ' -c "CooperNAM (S)"', "", "C:\Program Files\Cisco Systems\VPN Client\Resources\connected.ico")
EndFunc
Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...