Last updated: 28th July, 2014, 10:48 AMOn my blog post
Latest Supported Visual C++ Downloads you a link to the Microsoft site
Latest Supported Visual C++ Downloads. Once downloaded, how to install all these updates?
I made a script that installs all the Microsoft C++ Runtime modules. On x86 only the x86 modules are installed. On x64, both x86 and x64 modules are installed.
The list has been populated on June, 14th, 2014. So the list of C++ Runtime modules might – and will be – change.
The folder list should be as follows:
Map PATH-lijst voor volume Data
Het volumenummer is 00690056 A65A:75E4
\\PATH\TO
| install_all_VisualCPlusPlusRuntimes_v100.vbs
|
+---1.Microsoft Visual C++ 2005 SP1 Redistributable Package
| vcredist_x64.exe
| vcredist_x86.exe
|
+---2.Microsoft Visual C++ 2005 SP1 Redistributable Package ATL Security Update
| vcredist_x64.exe
| vcredist_x86.exe
|
+---3.Microsoft Visual C++ 2005 SP1 Redistributable Package MFC Security Update
| vcredist_x64.EXE
| vcredist_x86.EXE
|
+---4.Microsoft Visual C++ 2008 SP1 Redistributable Package
| vcredist_x64.exe
| vcredist_x86.exe
|
+---5.Microsoft Visual C++ 2008 SP1 Redistributable Package MFC Security Update
| vcredist_x64.exe
| vcredist_x86.exe
|
+---6.Microsoft Visual C++ 2010 SP1 Redistributable Package
| vcredist_x64.exe
| vcredist_x86.exe
|
+---7.Microsoft Visual C++ 2010 SP1 Redistributable Package MFC Security Update
| vcredist_x64.exe
| vcredist_x86.exe
|
+---8.Microsoft Visual C++ 2012 Update 3
| vcredist_x64.exe
| vcredist_x86.exe
|
\---9.Microsoft Visual C++ 2013 Redistributable Package
vcredist_x64.exe
vcredist_x86.exe
The only thing you have to do is to download all the redistributable packages:
The code:
Visual Basic
==========================================================================
' Install all Microsoft C++ Runtimes
' Created by Willem-Jan Vroom
' Version history:
'
' 0.0.1
' Initial version
'
' 1.0.0
' Final version
'
' ================================================================================================
' ------------------------------------------------------------------------------------------------
' Declare the most variables.
' ------------------------------------------------------------------------------------------------
Option Explicit
Dim objShell : set objShell = WScript.CreateObject("WScript.Shell")
Dim objLogFileFSO : Set objLogFileFSO = CreateObject("Scripting.FileSystemObject")
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objProcessEnv : Set objProcessEnv = objShell.Environment("PROCESS")
Dim objWMIService : Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Dim fn_objWMIService : Set fn_objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Dim objReg : Set objReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
Dim objLogFile
Dim CurrentDir : CurrentDir = Left(Wscript.ScriptFullname, InstrRev(Wscript.ScriptFullname, "\"))
CurrentDir = Left(CurrentDir,len(CurrentDir)-1)
Dim strcomputerName : strcomputerName = objProcessEnv("COMPUTERNAME")
Dim strLogLocation : strLogLocation = "C:\WINDOWS\system32\Logfiles"
Dim strOutputFile : strOutputFile = strLogLocation and "\" and strcomputerName and "_Installation_C++Runtimes_" and Replace(FormatDateTime(Now(), 2),"/","-") and ".log"
Dim strArchitecture : strArchitecture = ""
Dim strCurrentUser : strCurrentUser = ""
Dim strCurrentUserSID : strCurrentUserSID = ""
Dim strOS : strOS = ""
Dim strCommand : strCommand = ""
Dim strLine : strLine = ""
Dim strQuery : strQuery = ""
Dim strCommonDesktop : strCommonDesktop = ""
Dim strArray : strArray = ""
Dim strAppDataFolder : strAppDataFolder = ""
Dim strProcess : strProcess = ""
Dim strValue : strValue = ""
Dim strKeyPath : strKeyPath = ""
Dim strValueName : strValueName = ""
Dim strLogFile
Dim dwValue : dwValue = 0
Dim arrFolderUnsorted : Redim arrFolderUnsorted(0)
Dim arrArguments
Dim arrLanguage
Dim valCounter
Dim valResult
Dim valReturnCode
Dim colProcess, objProcess
Dim valOSBuildNumber
Dim objSubfolder
Dim colItems, objItem, Subfolder
Dim colSoftware, objSoftware
Dim arrValues, strHolder
dim objFolders, objFolder, arrFolders, arrVersions, objVersion
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."
WriteToLog " "
' ------------------------------------------------------------------------------------------------
' 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%") and "\SysWOW64\Config") then
strArchitecture = "x64"
arrVersions=Array("x86","x64")
else
strArchitecture = "x86"
arrVersions=Array("x86")
end if
WriteToLog("########## Details regarding operating system ##########")
WriteToLog("Found Operating System: " and strOS)
WriteToLog("Found architecture: " and strArchitecture)
WriteToLog("########## End details regarding operating system ##########")
WriteToLog(" ")
WriteToLog("########## Installation ##########")
' ------------------------------------------------------------------------------------------------
' 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
' ------------------------------------------------------------------------------------------------
' Start the installation:
' 1. Loop throu all the subfolders, sorted.
' Source:
'
http://blogs.technet.com/b/heyscriptingg...order.aspx
' 2. Depending on the foldername the correct parameters are passed to the vcredit_xx.exe
' Logging enabled.
' ------------------------------------------------------------------------------------------------
' 1: Get all the subfolder of the parent folder.
valCounter = 0
set objFolders = objFSO.GetFolder(CurrentDir)
Set arrFolders = objFolders.SubFolders
For Each objFolder in arrFolders
arrFolderUnsorted(valCounter) = objFolder.Name
Redim Preserve arrFolderUnsorted(valCounter+1)
valCounter = valCounter + 1
Next
Redim Preserve arrFolderUnsorted(valCounter-1)
Dim j
' 2: Sort them:
For valCounter = (UBound(arrFolderUnsorted) - 1) to 0 Step -1
For j= 0 to valCounter
If UCase(arrFolderUnsorted(j)) > UCase(arrFolderUnsorted(j+1)) Then
strHolder = arrFolderUnsorted(j+1)
arrFolderUnsorted(j+1) = arrFolderUnsorted(j)
arrFolderUnsorted(j) = strHolder
End If
Next
Next
' 3: Install
For valCounter = 0 to ubound(arrFolderUnsorted) ' I know: the folders are sorted now....
if instr(arrFolderUnsorted(valCounter),"2005") > 0 Then InstallCPlusPlus2005Runtimes
if instr(arrFolderUnsorted(valCounter),"2008") > 0 Then InstallCPlusPlus2008Runtimes
if instr(arrFolderUnsorted(valCounter),"2010") > 0 Then InstallCPlusPlus2010Runtimes
if instr(arrFolderUnsorted(valCounter),"2012") > 0 Then InstallCPlusPlus2012Runtimes
if instr(arrFolderUnsorted(valCounter),"2013") > 0 Then InstallCPlusPlus2013Runtimes
next
WriteToLog("########## End Installation ##########")
WriteToLog("########## Summary of installed C++ Redistributables ##########")
WriteToLog(" ")
Set colSoftware = objWMIService.ExecQuery("Select * from Win32_Product Where Name LIKE '%Visual C++%' AND (Name LIKE '%Redistributable%' OR Name LIKE '%Runtime%')")
For Each objSoftware in colSoftware
WriteToLog("Name: " and objSoftware.Name)
WriteToLog("Version: " and objSoftware.Version)
WriteToLog(" ")
Next
WriteToLog(" ")
WriteToLog("########## End summary of installed C++ Redistributables ##########")
WriteToLog(" ")
CloseLogFile()
wscript.quit 0
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, ForWriting)
Else
Set objLogFile = objLogFileFSO.CreateTextFile(strOutputFile)
End If
End Sub
Sub CloseLogFile()
' ------------------------------------------------------------------------------------------------
' Subroutine: CloseLogFile()
' Close the log file.
' ------------------------------------------------------------------------------------------------
WriteToLog "- ACTION: script ended."
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 = " " and sLogMessage
objLogFile.WriteLine("Time: " and now and " " and sLogMessage)
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 and objFolderTMP
If NOT objFSO.FolderExists(strFolder) Then
objFSO.CreateFolder(strFolder)
end If
strFolder = strFolder and "\"
Next
End Sub
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 " and objProcess.Name, 0, False
objProcess.Terminate()
WriteToLog("Terminating application: " and objProcess.Name)
End If
Next
End Function
Sub InstallCPlusPlus2005Runtimes
' ------------------------------------------------------------------------------------------------
' Subroutine: InstallCPlusPlus2005Runtimes
' Installs the C++ 2005 Runtime modules.
' ------------------------------------------------------------------------------------------------
for Each objVersion in arrVersions
if instr(arrFolderUnsorted(valCounter),"MFC") > 0 Then
strLogFile = right(arrFolderUnsorted(valCounter),len(arrFolderUnsorted(valCounter))-2) and " (" and objVersion and ").log"
strCommand = chr(34) and CurrentDir and "\" and arrFolderUnsorted(valCounter) and "\vcredist_" and objVersion and ".exe" and chr(34) and " /t:c:\temp /q"
strCommand = strCommand and ":a /c:" and chr(34) and "msiexec /i vcredist.msi /qb! /l*v "
strCommand = strCommand and chr(34) and chr(34) and strLogLocation and "\" and strLogFile and chr(34) and chr(34) and chr(34)
WriteToLog("Running command: " and strCommand)
valResult = objShell.Run(strCommand, 6, True)
WriteToLog("Result: " and valResult)
else
strCommand = chr(34) and CurrentDir and "\" and arrFolderUnsorted(valCounter) and "\vcredist_" and objVersion and ".exe" and chr(34) and " /q"
WriteToLog("Running command: " and strCommand)
valResult = objShell.Run(strCommand, 6, True)
WriteToLog("Result: " and valResult)
end if
next
End sub
Sub InstallCPlusPlus2008Runtimes
' ------------------------------------------------------------------------------------------------
' Subroutine: InstallCPlusPlus2008Runtimes
' Installs the C++ 2008 Runtime modules.
' ------------------------------------------------------------------------------------------------
for Each objVersion in arrVersions
strLogFile = right(arrFolderUnsorted(valCounter),len(arrFolderUnsorted(valCounter))-2) and " (" and objVersion and ").log"
strCommand = chr(34) and CurrentDir and "\" and arrFolderUnsorted(valCounter) and "\vcredist_" and objVersion and ".exe" and chr(34) and " /q /l "
strCommand = strCommand and chr(34) and strLogLocation and "\" and strLogFile and chr(34)
WriteToLog("Running command: " and strCommand)
valResult = objShell.Run(strCommand, 6, True)
WriteToLog("Result: " and valResult)
next
End sub
Sub InstallCPlusPlus2010Runtimes
' ------------------------------------------------------------------------------------------------
' Subroutine: InstallCPlusPlus2010Runtimes
' Installs the C++ 2010 Runtime modules.
' ------------------------------------------------------------------------------------------------
for Each objVersion in arrVersions
strLogFile = right(arrFolderUnsorted(valCounter),len(arrFolderUnsorted(valCounter))-2) and " (" and objVersion and ").log"
strCommand = chr(34) and CurrentDir and "\" and arrFolderUnsorted(valCounter) and "\vcredist_" and objVersion and ".exe" and chr(34) and " /passive /norestart /log "
strCommand = strCommand and chr(34) and strLogLocation and "\" and strLogFile and chr(34)
WriteToLog("Running command: " and strCommand)
valResult = objShell.Run(strCommand, 6, True)
WriteToLog("Result: " and valResult)
next
End sub
Sub InstallCPlusPlus2012Runtimes
' ------------------------------------------------------------------------------------------------
' Subroutine: InstallCPlusPlus2012Runtimes
' Installs the C++ 2012 Runtime modules.
' ------------------------------------------------------------------------------------------------
for Each objVersion in arrVersions
strLogFile = right(arrFolderUnsorted(valCounter),len(arrFolderUnsorted(valCounter))-2) and " (" and objVersion and ").log"
strCommand = chr(34) and CurrentDir and "\" and arrFolderUnsorted(valCounter) and "\vcredist_" and objVersion and ".exe" and chr(34) and " /install /passive /norestart /log "
strCommand = strCommand and chr(34) and strLogLocation and "\" and strLogFile and chr(34)
WriteToLog("Running command: " and strCommand)
valResult = objShell.Run(strCommand, 6, True)
WriteToLog("Result: " and valResult)
next
End sub
Sub InstallCPlusPlus2013Runtimes
' ------------------------------------------------------------------------------------------------
' Subroutine: InstallCPlusPlus2013Runtimes
' Installs the C++ 2013 Runtime modules.
' ------------------------------------------------------------------------------------------------
for Each objVersion in arrVersions
strLogFile = right(arrFolderUnsorted(valCounter),len(arrFolderUnsorted(valCounter))-2) and " (" and objVersion and ").log"
strCommand = chr(34) and CurrentDir and "\" and arrFolderUnsorted(valCounter) and "\vcredist_" and objVersion and ".exe" and chr(34) and " /install /passive /norestart /log "
strCommand = strCommand and chr(34) and strLogLocation and "\" and strLogFile and chr(34)
WriteToLog("Running command: " and strCommand)
valResult = objShell.Run(strCommand, 6, True)
WriteToLog("Result: " and valResult)
next
End sub