Freigeben über


Mailbag: How to perform a silent install of the Visual C++ 8.0 runtime files (vcredist) packages

Question:

Visual Studio 2005 includes redistributable setup packages to install the Visual C++ 8.0 runtime files such as msvcr80.dll, atl80.dll, etc. I would like to run this setup in fully silent mode, but when I run it normally, it displays a progress page. How can I run this setup package in fully silent mode?

Answer:

The Visual C++ 8.0 redist packages (vcredist_x86.exe, vcredist_x64.exe and vcredist_ia64.exe) support the following command line installation options. The examples below use the file named vcredist_x86.exe, but you can substitute the 64-bit versions of the EXEs with equivalent command lines to achieve the same behavior for them as well.

Unattended install

This option will run setup and display a progress dialog but requires no user interaction.

vcredist_x86.exe /q:a

Unattended install with no cancel button

This option is the same as the previous option, except that the user will not have the option to press cancel during installation.

vcredist_x86.exe /q:a /c:"msiexec /i vcredist.msi /qb! /l*v %temp%\vcredist_x86.log"

Silent install

This option will suppress all UI during installation.

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

Note about standalone VC++ redistributable packages

The instructions above apply to the copies of the VC++ redistributable packages that ship with Visual Studio 2005. If you are downloading and trying to install the standalone versions of the VC++ redistributable packages instead of using the copies included with Visual Studio 2005, you will need to use slightly different command line parameters. Please refer to this blog post for information about the command line parameters you will need to use in that case.

<update date="10/16/2009"> Added a link to a separate blog post with command line syntax for the standalone versions of the VC++ 2005 redistributable packages. </update>

Comments

  • Anonymous
    August 23, 2006
    PingBack from http://blogs.msdn.com/astebner/articles/574618.aspx

  • Anonymous
    October 05, 2006
    Hello Aaron,I am having trouble trying to embed the vcredist_x64/x86.exe files into an InstallShield-built MSI installer.I use a Custom action to run an exe copying the command you used as an example. The msi fails at the custom action after PublishProducts with an error 1721 stating that there is a problem with the msi package.The command works perfectly from a command prompt.Alternatively, is it better to extract the contents of the vcredist.exe (vcredist.msi and vcredist1.cab) and use a nested MSI custom action?Thanks for your help.Didier

  • Anonymous
    October 10, 2006
    Hi Didier - You should not try to install this vcredist package using a nested install.  Performing nested installs causes problems with installing hotfixes for the child packages.  You will need to use some kind of chainer to launch the vcredist setup package in silent mode, and then launch your main MSI setup afterwards.

  • Anonymous
    February 07, 2007
    A while back, I posted this item on my blog that describes options for silent installation of the Visual

  • Anonymous
    February 08, 2007
    Aaron has a post on his blog that describes way of silent install of VCRedist.EXE. I though I would cross-link

  • Anonymous
    March 13, 2007
    I have previously posted a few items about deploying the Visual C++ 8.0 runtime redistributable packages

  • Anonymous
    April 24, 2007
    I previously wrote a blog post about updated versions of the Visual C++ 8.0 runtime files that shipped

  • Anonymous
    July 18, 2007
    The comment has been removed

  • Anonymous
    December 11, 2008
    The comment has been removed

  • Anonymous
    December 12, 2008
    Hi Kamalsofteng - From what I can tell, the HRESULT in that error log you attached is indicating that Windows Installer ran into a problem finding the MSI at the path in your %temp% directory.  I'm not sure what would cause that to happen though - does the same thing happen if you run VC redist installation manually, or is it only when you launch it programatically via your application?  Also, is there anything special about the %temp% directory on the system where this is failing (is it encrypted, compressed, read-only or anything like that)?

  • Anonymous
    March 25, 2009
    The comment has been removed

  • Anonymous
    March 26, 2009
    The comment has been removed

  • Anonymous
    May 13, 2009
    I am trying to run vcredist_x86.exe as Silent install but I cannot find vcredist.msi anywhere. Can you please tell me where to get it. Thanks alot!


Silent install This option will suppress all UI during installation. Vcredist_x86.exe /q:a /c:"msiexec /i vcredist.msi /qn /l*v %temp%vcredist_x86.log"


  • Anonymous
    May 13, 2009
    Hi DDuong - The file vcredist_x86.exe is a self-extracting EXE, and the MSI is contained inside that EXE.  The command lines I listed in this blog post will extract the MSI to a temporary location and install it from there.   If you need to just extract the MSI, you can run vcredist_x86.exe /c and choose a path to extract the files to.

  • Anonymous
    March 29, 2010
    how can i do silent install without admin Privilege user? Is it possible? Thanks Ams

  • Anonymous
    March 30, 2010
    Hi Devpamit - No, this isn't possible.  The Visual C++ Redistributable requires administrator permissions to be able to install correctly.  If you attempt to run it as a non-administrator it will prompt you for elevation if your OS is Windows Vista or higher.  It will block you from installing on earlier versions of Windows.  You could use the runas command and provide user credentials and then pass in the command lines from my blog posts to install the Visual C++ Redistributable in silent mode, but doing that requires that you have a hard-coded username and password in your automation process.

  • Anonymous
    July 18, 2010
    I have an issue distributing VC redistributables in windows vista and above OS. i have attached the redistributable as a setup prerequisite with /q switch. When UAC is ON and a non admin runs the setup, the elevation dialog is displayed. This is OK situation. The problem arises when UAC is OFF and a non admin tries to run setup. In this condition the vcredist_x86, is called repeatedly, and the system hangs. How do i control this situation. Is there any switch to quit setup when non admin runs setup.

  • Anonymous
    July 19, 2010
    Hi Vidya - The VC redistributable setup packages should block you from installing if you run as a non-administrator, and then they will exit and return error code 1603.  How exactly are you launching the redistributable setup in this scenario?  Is it possible that your installer has some kind of retry logic that causes it to try to launch it again after it fails to install or something like that?

  • Anonymous
    April 25, 2011
    The comment has been removed

  • Anonymous
    April 25, 2011
    The comment has been removed

  • Anonymous
    June 08, 2011
    The comment has been removed

  • Anonymous
    June 08, 2011
    The comment has been removed

  • Anonymous
    June 20, 2011
    wondering does anyone have experience silently installing Visual Basic 6 runtime? from: www.microsoft.com/.../details.aspx

  • Anonymous
    July 23, 2011
    Hey There. I Really Need to Install this for Sony Vegas 8.0.exe Can you tell me what I have to do, like extract it from where I downloaded it? My e-mail is scareme687@gmail.com Incase you need it.

  • Anonymous
    July 25, 2011
    Hi Kevin - If you just need to install the VC++ Redistributable to use another program, you can download the installer, save it to your desktop and run it from there.  You don't need any of the steps in this blog post because they are used for silent installs, and you don't need any special extraction steps.

  • Anonymous
    September 27, 2011
    i a want to do a clean up action when i install VC++ Redistributable....... I am not getting ways for doing that...can u help me out... Thanks

  • Anonymous
    September 28, 2011
    Hi Sekhar - I'm sorry, but I'm not sure I understand this question.  Do you need to uninstall the VC++ Redistributable on your computer?  Can you please explain your scenario in more detail so I can get a better idea what you're trying to do and see if I can offer any suggestions?

  • Anonymous
    July 18, 2012
    what will happen if we run this command when c++ redist is already installed ?         vcredist_x86.exe /q

  • Anonymous
    July 18, 2012
    Hi Vikash - If you re-run the VC++ redistributable when it is already installed, it will repair/re-install it.

  • Anonymous
    September 09, 2012
    Hi Aron, When I am trying to install  VC Redist 2005 (8.0.61001) with the below mentioned command, I couldn't install it ( even the log file was not created) vcredist_x86.exe /q:a /c:"vcredi~3.exe /q:a /c:""msiexec /i vcredist.msi /qn /l*v C:DOCUME~1ADMINI~1LOCALS~1Tempvcredist_x86.log""" Can you please help me out in understanding why is it failing ? Thnks in advance Regards, Shan.

  • Anonymous
    September 10, 2012
    Hi Shan - The most likely problem is that the name of the executable inside of vcredist_x86.exe is not vcredi~3.exe, but I can't tell for sure because I'm not sure which exact version of the VC++ redistributable you downloaded in this scenario.  Can you please post a link that I can use to download the exact version of the VC++ redistributable that you're trying to install? Also, you can double-check the name of the .exe for yourself by running vcredist_x86.exe /c to extract the package, then going to the folder that you extracted the package to and looking at the name of the .exe in that folder.

  • Anonymous
    September 19, 2012
    Hi Aaron, Thanks for your quick reply (sorry couldn't reply you immediately )... And you are correct..there is no vcredi~3.exe inside the vcredist_x86.exe. The following command  has solved my probelm: Vcredist_x86.exe /q:a /c:"msiexec /i vcredist.msi /qn /l*v c:vcredist.log" Thanks once again for your quick reply Regards Shan.

  • Anonymous
    November 21, 2013
    How about the silent install flags for VS2013 version? Thanks

  • Anonymous
    February 04, 2014
    Hi Aaron, vcredist of version 9.0.30729.6161 is already installed on the system - Windows 2008 R2. And when my package is installing the same vcredist via custom action in UI sequence, it fails. But when i install the vcredist directly it works fine. Only fails when reinstalled by custom action. If i remove the existing vcredist on system via add/remove programs - then my installer does not fail at vcredist_custom_action. Command used by Custom action to install vcredist - [SourceDir]prerequisitesvcredist_x64.exe /s /v/qn Custom action returns 1721 error code. Please let me know why this is happening. Thanks, Jamie

  • Anonymous
    February 04, 2014
    Hi Jamie - I'm not sure why this is happening.  Do you have a verbose log file from one of the failing vcredist installs that you can share so I can take a closer look? Also, in general, it is not recommended to try to install the vcredist from another MSI via a custom action like this.  The recommended solution is to use a multi-package setup chainer.

  • Anonymous
    February 05, 2014
    Hi Aaron, Thanks for your quick response. I am pasting the log file details where i error comes.


Action ended 11:59:53: CostFinalize. Return value 1. MSI (c) (44:10) [11:59:53:093]: Doing action: VM_InstallVCREDIST_x64 Action 11:59:53: VM_InstallVCREDIST_x64. Configuring Microsoft Visual C++ Redistributable Package (x64)... Action start 11:59:53: VM_InstallVCREDIST_x64. CustomAction VM_InstallVCREDIST_x64 returned actual error code 1638 (note this may not be 100% accurate if translation happened inside sandbox) MSI (c) (44:10) [11:59:54:543]: Note: 1: 1722 2: VM_InstallVCREDIST_x64 3: D: 4: F:VMware-VIMSetup-all-5.5.0-1312299Single Sign-Onprerequisitesvcredist_x64.exe /s /v/qn Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action VM_InstallVCREDIST_x64, location: D:, command: F:VMware-VIMSetup-all-5.5.0-1312299Single Sign-Onprerequisitesvcredist_x64.exe /s /v/qn MSI (c) (44:10) [11:59:56:259]: Product: vCenter Single Sign-On -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action VM_InstallVCREDIST_x64, location: D:, command: F:VMware-VIMSetup-all-5.5.0-1312299Single Sign-Onprerequisitesvcredist_x64.exe /s /v/qn Action ended 11:59:56: VM_InstallVCREDIST_x64. Return value 3. MSI (c) (44:10) [11:59:56:259]: Doing action: FatalError Action 11:59:56: FatalError. Action start 11:59:56: FatalError.

Sorry for the type in my previous comment, custom action is returning error 1638. Does this help ? Thanks, Monish

  • Anonymous
    February 06, 2014
    Hi Jamie - Error code 1638 means "Another version of this product is already installed."  I would expect this type of error to happen on this computer if you ran the vcredist_x64.exe manually outside of a custom action too.  Can you check to see which exact version is currently installed?  You can use a tool like the one described at blogs.msdn.com/.../434814.aspx to do that.

  • Anonymous
    February 06, 2014
    Hi Jamie - Also, if possible, please collect and share a verbose MSI log from the vcredist install that is failing.  The log from your installer that calls the vcredist as a custom action doesn't help all that much to narrow this problem down.

  • Anonymous
    April 24, 2014
    The comment has been removed

  • Anonymous
    April 24, 2014
    Let me correct the above code. There is typo It should be: startInfo.Arguments = "/q:a /c:"msiexec /i vcredist.msi /qn /l*v %temp%\vcredist_x86.log""; but the code still doesn't work Thanks, Woojin

  • Anonymous
    April 25, 2014
    The comment has been removed

  • Anonymous
    April 25, 2014
    Hi Aaron, Thank you for answering my question. I solve this problem by taking out the log file going into %temp%. I used "/q:a /c:"msiexec /i vcredist.msi /qn" as process start info argument, and this working well. Thanks again for your help, Woojin  

  • Anonymous
    June 15, 2014
    Tried to install vcredist.exe_x64 but after extracting I am getting nothing. no window is showing.

  • Anonymous
    June 15, 2014
    Hi Ranu - I need more information in order to be able to help here.  Which exact version of the VC redist are you trying to install here - can you post the download link that you used?  Are you trying to install it in silent mode like this blog post is talking about, or are you just double-clicking it and trying to install normally?  Do you see any log files created in the %temp% directory on your computer when this happens?

  • Anonymous
    September 28, 2014
    Hi ! My vc++2008 problem is related to installation error of Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.4148. This is a prerequisite for CCM client and the vc++ install fails during overnight self-healing task of ccmeval to "Error 1935.An error occurred during the installation of assembly 'Microsoft.VC90.ATL or 'Microsoft.VC80.ATL'" I cannot install .4148 or upgrade to .6161 since all fail to same error. Microsoft Fix-it tool support.microsoft.com/.../970652 didn't help. Any ideas what is causing this and how to fix it ? Any help appreciated :)  -Tk

  • Anonymous
    September 29, 2014
    Hi T killinen - Here are the steps that I suggest for this type of error:

  1.  Install the latest Windows service pack and updates if you haven't yet.
  2.  Try to run the System Update Readiness Tool from support.microsoft.com/.../947821.
  3.  Try to repair the files that are a part of your OS by using the steps listed at blogs.msdn.com/.../how-to-repair-the-net-framework-2-0-and-3-0-on-windows-vista.aspx. If none of the above help, you might need to repair/re-install Windows to fix this type of error.  It might also help to post a question on one of the Windows forums to see if someone there has any additional suggestions for you to try before you resort to re-installing Windows.
  • Anonymous
    October 01, 2014
    @Aaron, many thx for instructions. However none of the fixes worked, so had to do reinstall.