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 (47)

  1. Didier Donner says:

    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

  2. astebner says:

    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.

  3. A while back, I posted this item on my blog that describes options for silent installation of the Visual

  4. Aaron has a post on his blog that describes way of silent install of VCRedist.EXE. I though I would cross-link

  5. I have previously posted a few items about deploying the Visual C++ 8.0 runtime redistributable packages

  6. I previously wrote a blog post about updated versions of the Visual C++ 8.0 runtime files that shipped

  7. This guide is intended to serve as a collection of links to articles, tools, tips and tricks that explain

  8. kamalsofteng says:

    Hi Aron;

    I am having trouble getting this redistributable to work(the way I want). I was able to issue your command:

    Vcredist_x86.exe /q:a /c:"msiexec /i vcredist.msi /qn /l*v %temp%vcredist_x86.log" and it succeeds some on some machines but fails on others. I tried to redirect the log so I can take a peek but I could  not understand anything from it. It is like this:

    === Verbose logging started: 9/11/2001  9:28:31  Build type: SHIP UNICODE 3.01.4001.5512  Calling process: C:WINDOWSsystem32msiexec.exe ===

    MSI (c) (24:78) [09:28:31:796]: Resetting cached policy values

    MSI (c) (24:78) [09:28:31:796]: Machine policy value ‘Debug’ is 0

    MSI (c) (24:78) [09:28:31:796]: ******* RunEngine:

              ******* Product: vcredist.msi

              ******* Action:

              ******* CommandLine: **********

    MSI (c) (24:78) [09:28:31:796]: Client-side and UI is none or basic: Running entire install on the server.

    MSI (c) (24:78) [09:28:31:796]: Grabbed execution mutex.

    MSI (c) (24:78) [09:28:31:921]: Cloaking enabled.

    MSI (c) (24:78) [09:28:31:921]: Attempting to enable all disabled priveleges before calling Install on Server

    MSI (c) (24:78) [09:28:31:937]: Incrementing counter to disable shutdown. Counter after increment: 0

    MSI (s) (BC:00) [09:28:31:968]: Grabbed execution mutex.

    MSI (s) (BC:34) [09:28:31:968]: Resetting cached policy values

    MSI (s) (BC:34) [09:28:31:968]: Machine policy value ‘Debug’ is 0

    MSI (s) (BC:34) [09:28:31:968]: ******* RunEngine:

              ******* Product: C:DOCUME~1TomLOCALS~1TempIXP000.TMPvcredist.msi

              ******* Action:

              ******* CommandLine: **********

    MSI (s) (BC:34) [09:28:32:015]: Note: 1: 2203 2: C:DOCUME~1TomLOCALS~1TempIXP000.TMPvcredist.msi 3: -2147287038

    MSI (s) (BC:34) [09:28:32:031]: MainEngineThread is returning 2

    MSI (c) (24:78) [09:28:32:031]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1

    MSI (c) (24:78) [09:28:32:031]: MainEngineThread is returning 2

    === Verbose logging stopped: 9/11/2001  9:28:32 ===

    My goal is to be able to silently issue the command from a Java application prior to calling another command that uses a DLL which depends on this redistributable package.

    Your help is greatly appreciated.

    Kamal

  9. astebner says:

    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)?

  10. Sangeeta says:

    Do you have any idea about VC++ 2008 SP1 silent install command line.

  11. astebner says:

    Hi Sangeeta – I thought I had already posted something like this, but I can’t find it so I think I may have forgotten.  I’ll work on a post about this topic in the next couple of days.

    The command line will be simpler in the 2008 version.  All you should need is something like the following for a silent install:

    vcredist_x86.exe /q

    Or the following for an unattended install:

    vcredist_x86.exe /qb

  12. dduong says:

    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"

    *****************************************

  13. astebner says:

    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.

  14. devpamit says:

    how can i do silent install without admin Privilege user? Is it possible?

    Thanks

    Ams

  15. astebner says:

    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.

  16. Vidya says:

    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.

  17. astebner says:

    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?

  18. Jerry says:

    Hi:

      I use your command line, however, it every time show msi help UI.

    vcredist_x86.exe /q:a /c:"msiexec vcredist.msi /qn"

      I can see vcredist_x86.exe is running, and then it will pop up msiexec help UI page, it does not do install really. What's wrong?

  19. astebner says:

    Hi Jerry – The command line you listed doesn't match the one listed above in this blog post.  You need a /i after msiexec.exe.  It should look like this:

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

  20. Muan says:

    When I tried a normal install of the vcredist_x86.exe with ATL security it showed a restart dialog at the end of the installation. What action will the silent install take for this, will it hide the restart dialog box and not do the restart. Or will it do the restart by default.

  21. astebner says:

    Hi Muan – I believe that a silent install will not reboot in this case, but there are some types of reboot requests that can cause Windows Installer to automatically reboot, even during a silent install.  To be safe, I'd suggest adding the REBOOT=ReallySuppress property to the command line.  That would look like the following:

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

  22. Mike says:

    wondering does anyone have experience silently installing Visual Basic 6 runtime?

    from:

    http://www.microsoft.com/…/details.aspx

  23. Kevin says:

    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.

  24. astebner says:

    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.

  25. Sekhar says:

    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

  26. astebner says:

    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?

  27. vikash says:

    what will happen if we run this command when c++ redist is already installed ?

            vcredist_x86.exe /q

  28. astebner says:

    Hi Vikash – If you re-run the VC++ redistributable when it is already installed, it will repair/re-install it.

  29. Shan says:

    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.

  30. astebner says:

    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.

  31. Shan says:

    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.

  32. Adrian Sheard says:

    How about the silent install flags for VS2013 version?

    Thanks

  33. Jamie says:

    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

  34. astebner says:

    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.

  35. Jamie says:

    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

  36. astebner says:

    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.

  37. astebner says:

    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.

  38. Woojin says:

    HI Aaron,

    I'm trying to silently install Microsoft Visual C++ 2005 Redistributable through C# process.start() but no luck for me

    I had the following code

     string path = mypath;                          

     startInfo = new System.Diagnostics.ProcessStartInfo();

     startInfo.Arguments = "/q:a /c:"msiexec /i vcredist.msi /qn /l*v temp%\vcredist_x86.log"";

     startInfo.FileName = path + @"vcredist_x86.exe";

     System.Diagnostics.Process exeProcess = System.Diagnostics.Process.Start(startInfo);

     exeProcess.WaitForExit();

     //next line

    I verified this argument works perfect in cmd, but the code never works. it seems to be never running the process and  goes to next line of code

    My test environment for this app is Windows XP, and  it runs always with admin privilege.

    Any help would be very thankful

  39. Woojin says:

    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

  40. astebner says:

    Hi Woojin – Running via Process.Start worked for me.  The %temp% variable doesn't get expanded with that syntax, so you'll need to expand it yourself prior to setting the arguments.  Also, some versions of the VC redistributable are double-wrapped.  In other words, they have another .exe inside of vcredist_x86.exe that you'll need to extract first before you'll be able to run this type of command line.

  41. WooJin says:

    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  

  42. ranu says:

    Tried to install vcredist.exe_x64 but after extracting I am getting nothing. no window is showing.

  43. astebner says:

    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?

  44. T killinen says:

    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

  45. astebner says:

    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.

  46. T Killinen says:

    @Aaron, many thx for instructions. However none of the fixes worked, so had to do reinstall.