Oct 22 2017

How to save money on Oracle Java Client Licenses

image_pdfimage_print

Oracle has multiple software for Java Clients. You can use the Enterprise version (JEE), but also the Runtime Engine (JRE). There is one big difference: you have to pay for the commercial use of the JEE. But I will give a work around that will save you money!

  1. On the Licensing and Distribution FAQs you find additional license information about the Java Runtime Engine:

    Yes, you may make unlimited copies for internal use for the purpose of running applications on Java-enabled general purpose desktop computers and servers.

    No, you may make unlimited copies for internal use for the purpose of running applications on Java-enabled general purpose desktop computers and servers.

  2. However, the JEE has different license conditions. It is mentioned on the Java Platform, Standard Edition MSI Enterprise JRE Installer Guide:

    The MSI Enterprise JRE Installer requires a commercial license for use in production.

However, there is a work around. Use the regular JRE installation instead.

  1. Download the latest JRE from Java Downloads for All Operating Systems.
  2. Run the installer, but stop when this screen appears:

    Installation screen

  3. The MSI is extracted from the installer in one of the subfolders of C:\Users\%UserName%\AppData\LocalLow\Oracle\Java.
  4. Quit the installer.
  5. Use Orca to create a transform file, based on the MSI. In this case it is jre1.8.0_151.msi.

    Orca

    Orca

  6. And the enterprise version is not used:

    Orca – enterprise no.

  7. A vbscript to uninstall previous versions and install the latest version

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    
    ' ================================================================================================
    ' Installs Java Runtime 8 Update 151
    ' Created by Willem-Jan Vroom
    ' Version history:
    '
    ' 1.0.0
    '   Initial version
    ' 
    ' ================================================================================================
     
     
    ' ------------------------------------------------------------------------------------------------
    ' Declare the most variables. 
    ' ------------------------------------------------------------------------------------------------
     
      Option Explicit
     
      Dim objShell                          : set objShell                      = WScript.CreateObject("WScript.Shell")
      Dim objNetWork                        : set objNetWork                    = Wscript.CreateObject("WScript.Network")
      Dim objLogFileFSO                     : Set objLogFileFSO                 = CreateObject("Scripting.FileSystemObject")
      Dim objFSO                            : Set objFSO                        = CreateObject("Scripting.FileSystemObject")
      Dim objProcessEnv                     : Set objProcessEnv                 = objShell.Environment("PROCESS")
      Dim objFolder
      Dim objFile
      Dim colFiles
      Dim objWMIService                     : Set objWMIService                 = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
      Dim fn_objWMIService                  : Set fn_objWMIService              = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
      Dim objReg                            : Set objReg                        = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
      Dim objLogFile
      Dim colListOfServices
      Dim objService 	
      Dim strCurrentDir                     : strCurrentDir                     = Left(Wscript.ScriptFullname, InstrRev(Wscript.ScriptFullname, "\"))
                                              strCurrentDir                     = Left(strCurrentDir,len(strCurrentDir)-1)
      Dim strcomputerName                   : strcomputerName                   = objProcessEnv("COMPUTERNAME")
      Dim strLogLocation                    : strLogLocation                    = "C:\WINDOWS\system32\Logfiles"
      Dim strOutputFile                     : strOutputFile                     = strLogLocation & "\" & strcomputerName & "_JavaRuntime1.8.0_151_Install_" & Replace(FormatDateTime(Now(), 2),"/","-") & ".log"
      Dim strCurrentUser                    : strCurrentUser                    = ""
      Dim strCurrentUserSID                 : strCurrentUserSID                 = "" 
      Dim strOS                             : strOS                             = ""
      Dim strValueName                      : strValueName                      = ""
      Dim strValue                          : strValue                          = ""
      Dim strArchitecture                   : strArchitecture                   = ""
      Dim strMSI                            : strMSI                            = ""
      Dim strMST                            : strMST                            = ""
      Dim strMSILogFile                     : strMSILogFile                     = ""
      Dim strCommand                        : strCommand                        = ""
      Dim strSoftwareName                   : strSoftwareName                   = "%Java 6 %,%Java 7 %,%Java 8 %"
      Dim arrSoftwareToUninstall            : arrSoftwareToUninstall             = split(strSoftwareName,",")
      Dim strFileNamesToKill                : strFileNamesToKill                = "iexplore.exe,chrome.exe,firefox.exe,javaw.exe,webstart.exe"
      Dim arrFileNamesToKill                : arrFileNamesToKill                = split(strFileNamesToKill,",")
      Dim objSoftwareToUninstall
     
      Dim arrValues,arrSubKeys, arrArguments, strFileName, strCommonPrograms
     
      Dim colProcess, objProcess 
      Dim valResult, valOSBuildNumber, valCounter
      Dim objSubfolder
      Dim objItem, colItems
      Dim strKeyPath
     
      Const ForWriting           = 2
      Const ForReading           = 1
      Const ForAppending         = 8
      Const OverWriteFiles       = True
      const HKEY_CURRENT_USER    = &H80000001
      const HKEY_LOCAL_MACHINE   = &H80000002
      Const HKEY_USERS           = &H80000003 
     
     
    ' ------------------------------------------------------------------------------------------------
    ' Create the log location (if not exists)
    ' Open the logfile.  
    ' ------------------------------------------------------------------------------------------------
     
      CreateFolderStructure(strLogLocation)
      OpenLogFile()
      WriteToLog "- ACTION: script started."
     
    ' ------------------------------------------------------------------------------------------------
    ' Detect the current OS.  
    ' ------------------------------------------------------------------------------------------------
     
      Set colItems = objWMIService.ExecQuery("Select Caption,BuildNumber from Win32_OperatingSystem")
      For Each objItem in colItems
          strOS            = objItem.Caption
          valOSBuildNumber = objItem.BuildNumber
      next
     
    ' ------------------------------------------------------------------------------------------------
    ' Detect the current processor architecture.  
    ' ------------------------------------------------------------------------------------------------
     
      if objFSO.FolderExists(objShell.ExpandEnvironmentStrings("%windir%") & "\SysWOW64\Config") then  
         strArchitecture = "x64"
           else
         strArchitecture = "x86"
      end if
     
      WriteToLog("########## Details regarding operating system and logged on user        ##########")
      WriteToLog("Found Operating System:    " & strOS)
      WriteToLog("Found architecture:        " & strArchitecture)
     
    ' ------------------------------------------------------------------------------------------------
    ' Find pending reboots and write it to the log file.  
    ' ------------------------------------------------------------------------------------------------
     
      if PendingRebootRequired Then
         WriteToLog("Pending restarts:          Yes")
           else
         WriteToLog("Pending restarts:          No")
      End if
      WriteToLog("########## End details regarding operating system and logged on user    ##########")
      WriteToLog(" ")
     
    ' ------------------------------------------------------------------------------------------------
    ' Sets SEE_MASK_NOZONECHECKS to 1.  
    ' That will avoid a screen that asks for permission to run an application from
    ' a share or mapped drive. 
    ' ------------------------------------------------------------------------------------------------
     
      objProcessEnv("SEE_MASK_NOZONECHECKS") = 1
     
    ' ------------------------------------------------------------------------------------------------
    ' Check if the parameter /uninstall is given.
    ' In that case: remove the product and quit.
    ' ------------------------------------------------------------------------------------------------
     
      if wscript.arguments.count > 0 Then
         Set arrArguments = wscript.arguments
         for valCounter = 0 to wscript.arguments.count - 1
             if instr(lcase(arrArguments(valCounter)),"/uninstall") > 0 or instr(lcase(arrArguments(valCounter)),"/remove") > 0 Then
                UninstallJavaAllVersions
                CloseLogFile()
                wscript.Quit(0)
             end if
         next
      end if
     
      KillProcess()
     
      UninstallJavaAllVersions
     
    ' ------------------------------------------------------------------------------------------------
    ' Install Java 8 (x86 version only)
    ' ------------------------------------------------------------------------------------------------
     
      strMSI=FindFileInTheFolder(strCurrentDir & "\x86", "msi")
      strMST=FindFileInTheFolder(strCurrentDir & "\x86", "mst")
     
      KillProcess()
      strMSILogFile = left(strMST,len(strMST)-4) & " ('x86').log"
     
      WriteToLog("########## Start installing Java 8.0.151.                               ##########")
      WriteToLog(" ")
     
      strCommand = "msiexec /i " & chr(34) & strCurrentDir & "\x86\" & strMSI & chr(34)
      strCommand = strcommand & " TRANSFORMS=" & chr(34) & strCurrentDir & "\x86\" & strMST & chr(34)
      strCommand = strCommand & " /qn /l*v " & chr(34) & strLogLocation & "\" & strMSILogFile & chr(34)
      WriteToLog ("Running command: " & strCommand)
      valResult = objShell.Run(strCommand,6,True)
      WriteToLog ("Result: " & valResult)
      WriteToLog(" ")
      WriteToLog("########## End installing Java 8.0.151.                                 ##########")
      WriteToLog(" ")
     
     
    ' ------------------------------------------------------------------------------------------------
    ' Uninstall the Automatic Update function (msi)
    ' ------------------------------------------------------------------------------------------------
     
      WriteToLog("########## Start uninstalling the Java Update Manager.                  ##########")
      WriteToLog(" ")
     
      strMSI        = "au.msi"
      strMST        = "Oracle_JavaRuntime_DisableAutomaticUpdate_8.0.1510.1_ENG_W7_1.0.0.mst"
      strMSILogFile = left(strMST,len(strMST)-4) & ".log"
     
      strCommand = "msiexec /x " & chr(34) & strCurrentDir & "\AutoUpdater\" & strMSI & chr(34)
      strCommand = strCommand & " /qn /l*v " & chr(34) & strLogLocation & "\" & strMSILogFile & chr(34)
      WriteToLog ("Running command: " & strCommand)
      valResult = objShell.Run(strCommand,6,True)
     
      if valResult = 1605 then
         valResult = 0  ' 1605 -> This action is only valid for products that are currently installed.
      end if
     
      WriteToLog ("Result: " & valResult)
     
      WriteToLog(" ")
      WriteToLog("########## End uninstalling the Java Update Manager.                    ##########")
      WriteToLog(" ")
     
      ModifyIcons()
     
      CloseLogFile()
     
     
    ' ================================================================================================
    ' All the subroutines and functions.
    ' ================================================================================================
     
    Function fnKillProcess(strProcessName)
     
    ' ------------------------------------------------------------------------------------------------
    ' Function: fnKillProcess(strProcessName)
    ' Terminates the given processname.
    ' ------------------------------------------------------------------------------------------------
     
      Set colProcess = fn_objWMIService.ExecQuery ("Select * From Win32_Process")
      For Each objProcess In colProcess
        If Instr(LCase(objProcess.Name),LCase(strProcessName)) > 0 Then
           objShell.Run "TASKKILL /F /T /IM " & objProcess.Name, 0, False
           objProcess.Terminate()
           WriteToLog("Terminating application: " & objProcess.Name)
        End If
      Next
     
    End Function
     
    Sub OpenLogFile() 
     
    ' ------------------------------------------------------------------------------------------------
    ' Subroutine: OpenLogFile() 
    ' The name of the logfile is mentinoed in the variabele strOutputFile.
    ' ------------------------------------------------------------------------------------------------
     
      If objLogFileFSO.FileExists(strOutputFile) Then
         Set objLogFile = objLogFileFSO.OpenTextFile(strOutputFile, ForAppending)
             Else
         Set objLogFile = objLogFileFSO.CreateTextFile(strOutputFile)
      End If
     
    End Sub
     
    Sub CloseLogFile()
     
    ' ------------------------------------------------------------------------------------------------
    ' Subroutine: CloseLogFile()
    ' Close the log file.
    ' ------------------------------------------------------------------------------------------------
      WriteToLog("########## End installation of Java 8.                                  ##########")
      WriteToLog("- ACTION: script ended.")
      WriteToLog(" ")
      objLogFile.Close
      Set objLogfileFSO = Nothing
     
    End Sub
     
    Function WriteToLog(sLogMessage)
     
    ' ------------------------------------------------------------------------------------------------
    ' Function: WriteToLog(sLogMessage)
    ' Writes an entry 'sLogMessage' in the logfile.
    ' ------------------------------------------------------------------------------------------------
     
      if instr(sLogMessage, "- ACTION: ") = 0 then sLogMessage = "          " & sLogMessage
      objLogFile.WriteLine("Time: " & now & "  " & sLogMessage)
     
    End Function
     
    Function PendingRebootRequired()
     
    ' ------------------------------------------------------------------------------------------------
    ' Function: PendingRebootRequired()
    ' Detects if there are pending reboots by querying the registry:
    ' * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing
    '   Key: RebootPending    (Only on Vista and above)
    ' * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update
    '   Key: RebootRequired
    ' * HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
    '   Value: PendingFileRenameOperations
    '
    ' (C) by Peter Fonk
    ' ------------------------------------------------------------------------------------------------
     
      PendingRebootRequired = False
     
      If valOSBuildNumber >= 6001 Then 
         PendingRebootRequired = KeyExists("RebootPending", "SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\")
         if PendingRebootRequired Then
            Exit Function
         end if
      End If 
     
      PendingRebootRequired = KeyExists("RebootRequired", "SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\")   
      if PendingRebootRequired Then
         Exit Function
      end if   
     
      PendingRebootRequired = ValueExists("PendingFileRenameOperations", "SYSTEM\CurrentControlSet\Control\Session Manager\")
     
    End Function
     
     
    Function KeyExists(Key, KeyPath)
     
    ' ------------------------------------------------------------------------------------------------
    ' Function: KeyExists(Key, KeyPath)
    ' Checks to see if the 'Key' in 'KeyPath' exists.
    ' ------------------------------------------------------------------------------------------------
     
      Dim arrSubKeys
      Dim oReg: Set oReg = GetObject("winmgmts:!root/default:StdRegProv")
      Dim regReadResult : regReadResult = oReg.EnumKey(HKEY_LOCAL_MACHINE, KeyPath, arrSubKeys)
      Dim i
     
      KeyExists = False
     
      If regReadResult = 0 And IsArray(arrSubKeys) Then
         For i = 0 To UBound(arrSubKeys)
             If InStr(arrSubKeys(i), Key) <> 0 Then
           	    KeyExists = True
        	    i = UBound(arrSubKeys)
    	 End If
         Next	
      End If
     
      Set oReg = Nothing
     
    End Function
     
    Function ValueExists(Key, KeyPath)
     
    ' ------------------------------------------------------------------------------------------------
    ' Function: ValueExists(Key, KeyPath)
    ' Checks to see if the value 'Key' in 'KeyPath' exists.
    ' ------------------------------------------------------------------------------------------------
     
      Dim arrSubValues
      Dim oReg: Set oReg = GetObject("winmgmts:!root/default:StdRegProv")
      Dim regReadResult : regReadResult = oReg.EnumValues(HKEY_LOCAL_MACHINE, KeyPath, arrSubValues)
      Dim i
     
      ValueExists = False
     
      If regReadResult = 0 And IsArray(arrSubValues) Then
         For i = 0 To UBound(arrSubValues)
             If InStr(arrSubValues(i), Key) <> 0 Then
        	    ValueExists = True
        	    i = UBound(arrSubValues)
             End If
         Next	
      End If
     
      Set oReg = Nothing
     
    End Function
     
    Sub CreateFolderStructure(strFolderNameToBeCreated)
     
    ' ------------------------------------------------------------------------------------------------
    ' Subroutine: CreateFolderStructure(strFolderNameToBeCreated)
    ' Creates the map as mentioned in strFolderNameToBeCreated.
    ' ------------------------------------------------------------------------------------------------
     
      Dim arrFoldersTMP : arrFoldersTMP = split (strFolderNameToBeCreated,"\")
      Dim strFolder  : strFolder  = ""
      Dim objFolderTMP
     
      For Each objFolderTMP in arrFoldersTMP
          strFolder = strFolder & objFolderTMP
          If NOT objFSO.FolderExists(strFolder) Then
                 objFSO.CreateFolder(strFolder)
          end If
          strFolder = strFolder & "\"
      Next
     
    End Sub
     
    Function GetSIDFromUser(UserName)
     
    ' ------------------------------------------------------------------------------------------------
    ' Function: GetSIDFromUser(UserName)
    ' Gets the SID from the give username.
    ' We use the registry to avoid an empty result if run under the SYSTEM account.
    ' ------------------------------------------------------------------------------------------------
     
      Dim DomainName, Result, WMIUser
     
      If InStr(UserName, "\") > 0 Then
        DomainName = Mid(UserName, 1, InStr(UserName, "\") - 1)
        UserName = Mid(UserName, InStr(UserName, "\") + 1)
      Else
        DomainName = CreateObject("ADSystemInfo").DomainShortName
      End If
     
      On Error Resume Next
      Set WMIUser = GetObject("winmgmts:{impersonationlevel=impersonate}!" _
        & "/root/cimv2:Win32_UserAccount.Domain='" & DomainName & "'" _
        & ",Name='" & UserName & "'")
      If Err.Number = 0 Then
        Result = WMIUser.SID
      Else
        Result = ""
      End If
      On Error GoTo 0
     
      GetSIDFromUser = Result
     
    End Function
     
    Function UninstallJavaAllVersions()
    	Dim result
    	Dim objSoftware
    	Dim colSoftware
     
            WriteToLog("########## Start uninstalling all previous Java versions.               ##########")
     
            For Each objSoftwareToUninstall in arrSoftwareToUninstall
               Set colSoftware = objWMIService.ExecQuery("Select * from Win32_Product Where Name LIKE '" & objSoftwareToUninstall & "'" )
    	   For Each objSoftware in colSoftware
                    WriteToLog "- ACTION: Uninstalling " & objSoftware.Name & "."
    		result = objShell.Run("msiexec.exe /x " & objSoftware.IdentifyingNumber & " REBOOT=ReallySuppress /qn /l*v " & chr(34) & "c:\windows\system32\logfiles\Uninstalling " & objSoftware.Name & ".log" & chr(34),0,True)
    		WriteToLog "- ACTION: " & objSoftware.Name & " removed." & vbcrlf
    	   Next
           Next
     
           WriteToLog("########## End uninstalling all previous Java versions.                 ##########")
           WriteToLog(" ")
     
           Set objSoftware = Nothing
           Set colSoftware = Nothing
    End Function
     
    Function KillProcess()
    	Dim objProcess
    	Dim colProcess : Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process")
    	For Each objProcess in colProcess
    		Dim strFileName, strTemp
    		For Each strFileName In arrFileNamesToKill
        		If LCase(objProcess.Name) = LCase(strFileName) Then
                                    On Error Resume Next
    				objWshShell.Run "TASKKILL /F /T /IM " & objProcess.Name, 0, False
    				objProcess.Terminate()
    				WriteToLog "- ACTION: " & objProcess.Name & " terminated"
                                    On Error Goto 0
    			End If
    		Next	
    	Next
     
    	Set objProcess = Nothing
    	Set colProcess = Nothing
    End Function
     
    Sub ModifyIcons()
     
    ' ------------------------------------------------------------------------------------------------
    ' Subroutine: ModifyIcons()
    ' Removes all the Java icons from both the Desktop and Start Menu and replace it by a modified
    ' version
    ' ------------------------------------------------------------------------------------------------
     
      WriteToLog(" ")
      WriteToLog("---------- Modify the Start Menu and remove unneeded icons.             ----------")
      WriteToLog(" ")
     
      strKeyPath       = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
      strValueName     = "Common Programs"
      objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strCommonPrograms
     
      if objFSO.FolderExists(strCommonPrograms & "\Java") Then 
         objFSO.DeleteFolder(strCommonPrograms & "\Java")
         WriteToLog("The folder '" & strCommonPrograms & "\Java' has been deleted.")
          else
         WriteToLog("The folder '" & strCommonPrograms & "\Java' does not exists thus not deleted.")
      End if
     
      WriteToLog(" ")
      WriteToLog("---------- End modifying Start Menu.                                    ----------")
      WriteToLog(" ")
     
     
    End Sub
     
    Function FindFileInTheFolder(strFolderName, strExtension)
     
      ' -----------------------------------------------------------------------------------------------------------------
      ' Function: FindFileInTheFolder(strFolderName, strExtension)
      ' Returns the full file name in the folder strFolderName and the extension strExtension
      ' -----------------------------------------------------------------------------------------------------------------
     
      Set objFolder = objFSO.GetFolder(strFolderName)
      Set colFiles  = objFolder.Files
      FindFileInTheFolder = ""
     
      For Each objFile in colFiles
          if lcase(right(objFile.Name,3)) = lcase(strExtension) Then
             FindFileInTheFolder  = objFile.Name
          end if
      Next
     
    End Function

    You can download the script – excluding the MSI – here.

Permanent link to this article: https://www.vroom.cc/wordpress/how-to-save-money-on-oracle-java-client-licenses/