183 lines
5.3 KiB
Plaintext
183 lines
5.3 KiB
Plaintext
Option Explicit
|
||
Dim pName, pVersion, pLang, pRevision, pCustomer, pVersionold, pBrandingName, pAES
|
||
|
||
pName = "Audi_JavaSecurityConfig"
|
||
pVersion = "4.2"
|
||
pVersionold = "4.01"
|
||
pLang = "NTR"
|
||
pRevision = "91"
|
||
pCustomer = "VWG"
|
||
pAES = "AES-1-001680-A"
|
||
pBrandingName = pName &"_"& pVersion &"_"& pLang &"_"& pRevision
|
||
|
||
'----- Functions.vbs einbinden
|
||
Dim olibfso : Set olibfso = CreateObject("Scripting.FileSystemObject")
|
||
ExecuteGlobal olibfso.OpenTextFile(olibfso.GetParentFolderName(Wscript.ScriptFullName) + "\_Functions.vbs", 1, false).ReadAll
|
||
Set olibfso = nothing
|
||
|
||
LogEnabled = True
|
||
|
||
ClientInfo()
|
||
|
||
'----- Clients (Delete this block if not needed)
|
||
AC1_32_O = 1
|
||
AC2_32_O = 1
|
||
AC2_64_O = 1
|
||
|
||
AC2_32_N = 1
|
||
AC2_64_N = 1
|
||
|
||
AC3_Alpha = 1
|
||
AC4_64_N = 1
|
||
AC4_64_O = 1
|
||
|
||
ClientCheck()
|
||
|
||
'----- START Installation -----
|
||
Dim TrustWare32 : TrustWare32 = """" & ProgramFiles & "\IT Solution GmbH\trustWare CSP+ v1.1.0.12\32\itcspsrv.exe"""
|
||
Dim TrustWare64 : TrustWare64 = """" & ProgramFiles & "\IT Solution GmbH\trustWare CSP+ v1.1.0.12\64\itcspsrv.exe"""
|
||
|
||
' Altes Paket entfernen
|
||
|
||
VbsLog "----- Start Deinstallation " & pName & " " & pVersion
|
||
|
||
DeleteReg "KEY","HKLM\Software\AudiAG\InstalledProducts\" & pName & "\",32
|
||
DeleteReg "KEY","HKLM\Software\VWG\InstalledProducts\" & pName & "\",32
|
||
|
||
'Kopieren systemweite deployment.properties
|
||
CreateFolder WinDir & "\Sun\Java\Deployment"
|
||
CopyFile "Source\Deployment\*.*",WinDir & "\Sun\Java\Deployment"
|
||
|
||
'Disable Java Deployment Expiration Check
|
||
Dim HighestJavaPath : HighestJavaPath = GetHighestJavaPath(ProgramFiles & "\Java")
|
||
If Not IsNull(HighestJavaPath) Then
|
||
run "Disable Expiration Check","""" & HighestJavaPath & "\bin\javaws"" -userConfig deployment.expiration.check.enabled false",""
|
||
End If
|
||
|
||
'Kopieren der Zertifikate
|
||
CopyCerts(ProgramFiles & "\Java")
|
||
If GetOSBit()=64 Then CopyCerts(ProgramFiles64 & "\Java")
|
||
|
||
'Trustware
|
||
If CheckFile(TrustWare32) Then run "CSP+ 32",TrustWare32 & " installjava","0"
|
||
If GetOSBit() = 64 Then
|
||
If CheckFile(TrustWare64) Then run "CSP+ 64",TrustWare64 & " installjava","0"
|
||
End If
|
||
|
||
WriteRegInfo "0"
|
||
|
||
' Notwendiger RegKey f<>r die permanente Neuinstallations-M<>glichkeit sorgt
|
||
'WriteReg "REG_DWORD", "HKLM\Software\ApplicationPacks\JavaConfig", 1, 32
|
||
|
||
' Ausf<73>hren von C:\PROGRAM FILES\Java\[any Java Runtime]\bin\ssvagent.exe -new
|
||
RunAgent ProgramFiles & "\Java"
|
||
|
||
' Write Branding
|
||
Dim pBrandingNameOld : pBrandingNameold = pName &"_"& pVersionOld &"_"& pLang &"_"& pRevision
|
||
Dim Regpath : Regpath = "HKLM\Software\"&pCustomer&"\InstalledProducts"
|
||
dim regType : regType = "KEY"
|
||
'DIM pNow: pNow = Now
|
||
DeleteReg regType, regpath &"\"& pBrandingNameOld , 32
|
||
CreateBrandingInformation pName, pVersion, pLang, pRevision
|
||
|
||
'----- ENDE Installation -----
|
||
FinishScript()
|
||
|
||
Sub RunAgent(Folder)
|
||
Dim Dir,SubDir,JavaVer
|
||
If Not CheckFolder(Folder) Then Exit Sub
|
||
Set Dir = FSO.GetFolder(Folder)
|
||
|
||
For Each SubDir In Dir.SubFolders
|
||
JavaVer=Null
|
||
If Left(LCase(SubDir.Name),4)="jre7" Or Left(LCase(SubDir.Name),6)="jre1.7" Then
|
||
JavaVer="jre7"
|
||
ElseIf Left(LCase(SubDir.Name),4)="jre8" Or Left(LCase(SubDir.Name),6)="jre1.8" Then
|
||
JavaVer="jre8"
|
||
ElseIf Left(LCase(SubDir.Name),4)="jre9" Then
|
||
JavaVer="jre9"
|
||
Else
|
||
VbsLog "Information | '" & SubDir.Path & "' ist unbekannte Java Version"
|
||
End If
|
||
|
||
If Not IsNull(JavaVer) Then
|
||
VbsLog "Information | '" & SubDir.Path & "' ist " & JavaVer
|
||
|
||
If CheckFolder(SubDir.Path & "\bin") Then
|
||
RunNoWait "Run", SubDir.Path & "\bin\ssvagent.exe -new"
|
||
End If
|
||
End If
|
||
Next
|
||
|
||
|
||
End Sub
|
||
|
||
|
||
Sub CopyCerts(Folder)
|
||
Dim Dir,SubDir,JavaVer
|
||
If Not CheckFolder(Folder) Then Exit Sub
|
||
Set Dir = FSO.GetFolder(Folder)
|
||
|
||
For Each SubDir In Dir.SubFolders
|
||
JavaVer=Null
|
||
If Left(LCase(SubDir.Name),4)="jre7" Or Left(LCase(SubDir.Name),6)="jre1.7" Then
|
||
JavaVer="jre7"
|
||
ElseIf Left(LCase(SubDir.Name),4)="jre8" Or Left(LCase(SubDir.Name),6)="jre1.8" Then
|
||
JavaVer="jre8"
|
||
ElseIf Left(LCase(SubDir.Name),4)="jre9" Then
|
||
JavaVer="jre9"
|
||
Else
|
||
VbsLog "Information | '" & SubDir.Path & "' ist unbekannte Java Version"
|
||
End If
|
||
|
||
If Not IsNull(JavaVer) Then
|
||
VbsLog "Information | '" & SubDir.Path & "' ist " & JavaVer
|
||
If CheckFolder(SubDir.Path & "\lib\security") Then
|
||
''' !jetzt nach c:\windows\sun\java\deployment
|
||
''' CopyFile "Source\CA-Trusted-Certs_VWG\*.*",SubDir.Path & "\lib\security\"
|
||
If CheckFolder("Source\JCE_VWG\" & JavaVer) Then
|
||
CopyFile "Source\JCE_VWG\" & JavaVer & "\*.*",SubDir.Path & "\lib\security\"
|
||
End If
|
||
End If
|
||
End If
|
||
Next
|
||
End Sub
|
||
|
||
Function GetHighestJavaPath(Folder)
|
||
Dim Dir,Item,Name,Version,VersionMax,Path
|
||
VersionMax = 0
|
||
|
||
If Not CheckFolder(Folder) Then
|
||
VbsLog "Kein Java gefunden in '" & Folder & "'"
|
||
GetHighestJavaPath = Null
|
||
Exit Function
|
||
End If
|
||
|
||
Set Dir = FSO.GetFolder(Folder)
|
||
For Each Item In Dir.SubFolders
|
||
If CheckFile(Item.Path & "\bin\java.exe") Then
|
||
Version=GetFileVersion(Item.Path & "\bin\java.exe")
|
||
End If
|
||
If VersionCheck(VersionMax,Version) < 0 Then
|
||
VersionMax = Version
|
||
Path = Item.Path
|
||
End If
|
||
Next
|
||
|
||
If VersionMax > 0 Then
|
||
GetHighestJavaPath = Path
|
||
Else
|
||
GetHighestJavaPath = Null
|
||
End If
|
||
End Function
|
||
|
||
Sub WriteRegInfo(ErrorLevel)
|
||
Dim RegRoot
|
||
RegRoot = "HKLM\Software\VWG\InstalledProducts\" & pName
|
||
|
||
If UBound(errorList0)>=0 Then
|
||
WriteReg "SZ",RegRoot & "\ErrorLevel",Join(errorList0,","),32
|
||
Else
|
||
WriteReg "SZ",RegRoot & "\ErrorLevel",ErrorLevel,32
|
||
End If
|
||
End Sub |