diff --git a/Scripts/Install-MicrosoftVisualC++x86x64.wsf b/Scripts/Install-MicrosoftVisualC++x86x64.wsf index 737e210..d2e6ca6 100644 --- a/Scripts/Install-MicrosoftVisualC++x86x64.wsf +++ b/Scripts/Install-MicrosoftVisualC++x86x64.wsf @@ -13,6 +13,7 @@ '// Version: 2.4 - September 6, 2017 - Christoph Voigt '// Version: 2.5 - October 4, 2018 - Johan Arwidmark '// Version: 2.5.1 - August 12, 2019 - Baard Hermansen +'// Version: 2.6 - November 27, 2019 - Ramón Isasi '// '// Twitter: @jarwidmark '// Blog : http://deploymentresearch.com @@ -62,9 +63,13 @@ Function ZTIProcess() '// (Visual C++ 2017 is a binary-compatible in-place upgrade of Visual C++ 2015) 'Dim sSetupFile2015x86 'Dim sSetupFile2015x64 - '// - Dim sSetupFile2017x86 - Dim sSetupFile2017x64 + '// Removed Visual C++ 2017 since it's replaced with 2019 + '// (Visual C++ 2019 is a binary-compatible in-place upgrade of Visual C++ 2015 and 2017) + 'Dim sSetupFile2017x86 + 'Dim sSetupFile2017x64 + + Dim sSetupFile2019x86 + Dim sSetupFile2019x64 Dim sArguments @@ -92,8 +97,10 @@ Function ZTIProcess() '// Removed Visual C++ 2015 since it's replaced with 2017 'sSetupFile2015x86 = oUtility.ScriptDir & "\Source\VS2015\mu_visual_cpp_2015_redistributable_update_3_x86_9052536.exe" 'sSetupFile2015x64 = oUtility.ScriptDir & "\Source\VS2015\mu_visual_cpp_2015_redistributable_update_3_x64_9052538.exe" - sSetupFile2017x86 = oUtility.ScriptDir & "\Source\VS2017\mu_visual_cpp_redistributable_for_visual_studio_2017_version_15.3_x86_11100229.exe" - sSetupFile2017x64 = oUtility.ScriptDir & "\Source\VS2017\mu_visual_cpp_redistributable_for_visual_studio_2017_version_15.3_x64_11100230.exe" + 'sSetupFile2017x86 = oUtility.ScriptDir & "\Source\VS2017\mu_visual_cpp_redistributable_for_visual_studio_2017_version_15.3_x86_11100229.exe" + 'sSetupFile2017x64 = oUtility.ScriptDir & "\Source\VS2017\mu_visual_cpp_redistributable_for_visual_studio_2017_version_15.3_x64_11100230.exe" + sSetupFile2019x86 = oUtility.ScriptDir & "\Source\VS2019\vcredist_x86.exe" + sSetupFile2019x64 = oUtility.ScriptDir & "\Source\VS2019\vcredist_x64.exe" sArguments = "/Q" @@ -140,8 +147,15 @@ Function ZTIProcess() ' Exit Function 'End if - If not oFSO.FileExists(sSetupFile2017x86) then - oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile2017x86 & " was not found, unable to install", LogTypeError + '// Removed Visual C++ 2017 since it's replaced with 2019 + 'If not oFSO.FileExists(sSetupFile2017x86) then + ' oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile2017x86 & " was not found, unable to install", LogTypeError + ' ZTIProcess = Failure + ' Exit Function + 'End if + + If not oFSO.FileExists(sSetupFile2019x86) then + oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile2019x86 & " was not found, unable to install", LogTypeError ZTIProcess = Failure Exit Function End if @@ -236,10 +250,21 @@ Function ZTIProcess() 'oLogging.CreateEntry oUtility.ScriptName & ": Return code from command = " & iRetVal, LogTypeInfo 'oLogging.CreateEntry oUtility.ScriptName & ": Finished installation", LogTypeInfo - + + '// Removed Visual C++ 2017 since it's replaced with 2019 '// Installing Visual C++ 2017 x86 - oLogging.CreateEntry oUtility.ScriptName & ": About to install " & sSetupFile2017x86, LogTypeInfo - iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile2017x86 & """ " & sArguments) + 'oLogging.CreateEntry oUtility.ScriptName & ": About to install " & sSetupFile2017x86, LogTypeInfo + 'iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile2017x86 & """ " & sArguments) + ' + 'if (iRetVal = 0) or (iRetVal = 3010) then + ' ZTIProcess = Success + 'Else + ' ZTIProcess = Failure + 'End If + + '// Installing Visual C++ 2019 x86 + oLogging.CreateEntry oUtility.ScriptName & ": About to install " & sSetupFile2019x86, LogTypeInfo + iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile2019x86 & """ " & sArguments) if (iRetVal = 0) or (iRetVal = 3010) then ZTIProcess = Success @@ -297,18 +322,24 @@ Function ZTIProcess() ' Exit Function 'End if - If not oFSO.FileExists(sSetupFile2017x64) then - oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile2017x64 & " was not found, unable to install", LogTypeError + '// Removed Visual C++ 2017 since it's replaced with 2019 + 'If not oFSO.FileExists(sSetupFile2017x64) then + ' oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile2017x64 & " was not found, unable to install", LogTypeError + ' ZTIProcess = Failure + ' Exit Function + 'End if + + If not oFSO.FileExists(sSetupFile2019x64) then + oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile2019x64 & " was not found, unable to install", LogTypeError ZTIProcess = Failure Exit Function End if - + 'Installing x64 files '// Reverting back to old silent installation switch sArguments = "/Q" - '// Removed Visual C++ 2005 since it's no longer supported (and don't get security updates) '// Installing Visual C++ 2005 x64 'oLogging.CreateEntry oUtility.ScriptName & ": About to install " & sSetupFile2005x64, LogTypeInfo @@ -369,7 +400,7 @@ Function ZTIProcess() '// Modified installation switch due to changes introduced from version 2013 and newer sArguments = "/quiet /norestart" - '// Installing Visual C++ 2013 x64 + '// Installing Visual C++ 2013 x64 oLogging.CreateEntry oUtility.ScriptName & ": About to install " & sSetupFile2013x64, LogTypeInfo iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile2013x64 & """ " & sArguments) @@ -396,9 +427,20 @@ Function ZTIProcess() 'oLogging.CreateEntry oUtility.ScriptName & ": Return code from command = " & iRetVal, LogTypeInfo 'oLogging.CreateEntry oUtility.ScriptName & ": Finished installation", LogTypeInfo + '// Removed Visual C++ 2017 since it's replaced with 2019 '// Installing Visual C++ 20017x64 - oLogging.CreateEntry oUtility.ScriptName & ": About to install " & sSetupFile2017x64, LogTypeInfo - iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile2017x64 & """ " & sArguments) + 'oLogging.CreateEntry oUtility.ScriptName & ": About to install " & sSetupFile2017x64, LogTypeInfo + 'iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile2017x64 & """ " & sArguments) + ' + 'if (iRetVal = 0) or (iRetVal = 3010) then + ' ZTIProcess = Success + 'Else + ' ZTIProcess = Failure + 'End If + + '// Installing Visual C++ 20019x64 + oLogging.CreateEntry oUtility.ScriptName & ": About to install " & sSetupFile2019x64, LogTypeInfo + iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile2019x64 & """ " & sArguments) if (iRetVal = 0) or (iRetVal = 3010) then ZTIProcess = Success @@ -406,6 +448,7 @@ Function ZTIProcess() ZTIProcess = Failure End If + oLogging.CreateEntry oUtility.ScriptName & ": Return code from command = " & iRetVal, LogTypeInfo oLogging.CreateEntry oUtility.ScriptName & ": Finished installation", LogTypeInfo