Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Update regarding silent install of the VC 8.0 runtime (vcredist) packages

Update regarding silent install of the VC 8.0 runtime (vcredist) packages

Rate This
  • Comments 44

A while back, I posted this item on my blog that describes options for silent installation of the Visual C++ 8.0 runtime redistributable setup packages.  When I investigated this issue and wrote that blog post, I based the command line parameters on the versions of vcredist_x86.exe, vcredist_x64.exe and vcredist_ia64.exe that are included in the directory %ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0\Bootstrapper\Packages when installing Visual Studio 2005.

However, a customer recently alerted me to an issue that I wasn't aware of previously.  The standalone versions of the VC runtime redistributable packages that are available for download via the web are packaged differently, and so the command lines that I previously documented for silent installation will not work with those versions of the packages.  Essentially, the standalone versions are wrapped in a second self-extracting EXE that displays a EULA before allowing extraction and execution of the main setup package, whereas the packages included as part of Visual Studio 2005 directly launch setup and are not doubly wrapped.

Therefore, here are some amended silent install instructions for the VC 8.0 runtime redistributable packages.  If you are using the packages included as a part of Visual Studio 2005, you can continue to use the silent install switches from my previous blog post.

However, if you have downloaded the standalone VC 8.0 redistributable packages, you will need to modify the command lines slightly.  The following command lines can be used to install the original release of the standalone VC 8.0 redistributable packages:

  • For x86: vcredist_x86.exe /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
  • For x64: vcredist_x64.exe /q:a /c:"VCREDI~2.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
  • For ia64: vcredist_ia64.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "

The following command lines can be used to install the Visual Studio 2005 SP1 release of the standalone VC 8.0 redistributable packages:

  • For x86: vcredist_x86.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
  • For x64: vcredist_x64.exe /q:a /c:"VCREDI~2.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
  • For ia64: vcredist_ia64.exe /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "

The following command lines can be used to install the Visual Studio 2005 SP1 ATL Security Update release of the standalone VC 8.0 redistributable packages:

  • For x86: vcredist_x86.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
  • For x64: vcredist_x64.exe /q:a /c:"VCREDI~2.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "
  • For ia64: vcredist_ia64.exe /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qn"" "

If you would like to install the VC runtime packages in unattended mode (which will show a small progress bar but not require any user interaction), you can change the /qn switch above to /qb.  If you would like the progress bar to not show a cancel button, then you can change the /qn switch above to /qb!

<update date="4/25/2007"> Added new command lines for the VS 2005 SP1 version of the VC 8.0 redistributable packages </update>

<update date="7/29/2007"> Updated command line switches to distinguish between unattended install mode and silent install mode </update>

<update date="10/16/2009"> Added information about the command lines for the VC++ 2005 SP1 ATL Security Update package. </update>

 

  • Aaron, sorry for delay ...

    This is link for KB2467175: download.microsoft.com/.../vcredist_x86.exe

    This is link for 'older'  : download.microsoft.com/.../vcredist_x86.exe

    Adrian

  • Hi Adrian Sheard - You're right - the "older" redistributable package has a higher version number than the "newer" one, and it is configured to automatically uninstall previous version numbers.  You'll need to install the "older" one before the "newer" one to avoid this behavior.  If you get a chance, can you please also report this issue on the Connect site as well - connect.microsoft.com/visualstudio

  • Hi, What are the silent install command line options for the KB2538242 update , @

    support.microsoft.com/.../2538242

    None of the above seem to help..

  • Hi,

    what are the command line options for the KB2538242 update available at

    www.microsoft.com/.../details.aspx

  • For the Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update (x86) the command line arguments should be:

    /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qn

    Why is Microsoft changing the number in the VCREDI~.EXE all the time?

  • Hi StuckAgain and Joost van Zoest - It doesn't look like the VC++ 2005 SP1 Redistributable MFC Security Update has an EXE inside the main vcredist_x86.exe.  As a result, the command line would look something like this:

    vcredist_x86.exe /q:a /c:"msiexec /i vcredist.msi /qn /l*v %temp%\vcredist_log.txt"

    Unfortunately, the names appear to change from release to release, so you'll have to extract the vcredist_x86.exe and check the exact contents to figure out the command line each time.  I'm sorry for the hassles with that naming.  :-(

  • Hi Aaron,

    Thanks for informative post. Couple of questions:

    1.) Does installing this VC redist actually return valid exit code? It seems to me that it is always returning exist code 0. How can we print reurn code of running this exe in silent mode on command prompt?

    2.) Is there any separate switch option of running this vcredist exe in 'repair' mode in case it is already installed on system? or using same options always and it would automatically run in 'repair' mode upon detecting it already installed on system?

  • Hi Michel - Yes, the VC++ redistributable should return valid return codes.  You can use the %ERRORLEVEL% variable in a cmd prompt to check the return code.  If you do a search for that variable, you can find several different examples of how to do that.

    You can run the install command line and it should do a new install if the VC++ redistributable is not yet installed or a repair if it is already installed.

  • I checked the %ERRORLEVEL% variable but it is always '0' even if the installtion failed. I have a system where vcredist 2008 x86 install is failing always due to some registry issues (error 1603). The MSI log also says failure, but running this vcredist_x86.exe in silent mode always return '0'. Any pointers?

  • Hi Michel - I've seen setup programs that chain in the VC++ Redistributable and they are able to correctly detect whether or not the install succeeds by examining the exit code.  I think this might just be something in how the ERRORLEVEL value is being assigned or something like that.  I'm not an expert in batch scripting, so I'm not sure what to suggest to solve this though.  Is it an option for you to install the VC++ Redistributable via a setup chainer as opposed to a batch script?

  • theres a new version.

    www.microsoft.com/.../details.aspx

    it doesn't appear to have the double wrapper so i think the comman lines from the first post should work with these:

    blogs.msdn.com/.../715755.aspx

  • Yes, the new installer does not has a double wrapper. So the command used for double wrapper installation does not work on some systems. The command for this should be the one used for single wrapper Exe i.e.

    /q:a /c:"msiexec /i vcredist.msi /qn /norestart"

    It's quite surprising to see that Microsoft keeps changing the format of VC 2005 redist EXE's - sometimes they are posted with double wrapper; while sometimes without the double wrapper. They shoould stick to one format!

  • Why not just unpack it with 7zip, and do a single "msiexec /i vcredist.msi" ?

  • Hi Martin - That is a valid way of installing the VC++ redistributable too.  The command lines in this blog post are intended for scenarios where a developer wants to automate the installation in a single step instead of unpacking in a separate step.

Page 3 of 3 (44 items) 123
Leave a Comment
  • Please add 5 and 7 and type the answer here:
  • Post