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 has a post on his blog that describes way of silent install of VCRedist.EXE. I though I would cross-link

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

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

  • It looks like in the SP1 version of the libraries, the internal files have different names:

    For x86: vcredist_x86.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qb!"" "

    appears to be the right way to go for x86.

    For x64 it remains unchanged.

    Anthony Wieser

    Wieser Software Ltd

  • Hi Anthony - Good catch!  I'll update this post with the new command line needed for the SP1 versions of these packages.

  • Thank you. Very useful info.

  • I am still having problems getting the vcredist_x86 to install silently.

    I am using Microsoft Visual Studio 2005 and the downloaded version of the VC++ redist. I am modifing the bootstraper Product.XML.

    When I look inside the self-extracting file vcredist_x86.exe I can see that it contains the VCREDI~3.EXE file.

    So in my C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86\product.xml

    I am using:

    vcredist_x86.exe /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qb!"" ".  

    This does not seem to work silently!

    ++++++++++++++++++++++++++++++++++++++++

    <?xml version="1.0" encoding="utf-8" ?>

    <Product

     xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"

     ProductCode="Microsoft.Visual.C++.8.0.x86"

    >

     <!-- Defines list of files to be copied on build -->

     <PackageFiles>

       <PackageFile Name="vcredist_x86.exe"/>

     </PackageFiles>

     <InstallChecks>

       <MsiProductCheck Property="VCRedistInstalled" Product="{A49F249F-0C91-497F-86DF-B2585E8E76B7}"/>

     </InstallChecks>

     <!-- Defines how to invoke the setup for the Visual C++ 8.0 redist -->

     <!-- TODO: Needs EstrimatedTempSpace, LogFile, and an update of EstimatedDiskSpace -->

     <Commands Reboot="Defer">

       <Command PackageFile="vcredist_x86.exe"

        Arguments=' /q:a /c:"VCREDI~3.EXE /q:a /c:""msiexec /i vcredist.msi /qb!"" "'>

         <!-- These checks determine whether the package is to be installed -->

         <InstallConditions>

           <BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="3"/>

           <!-- Block install if user does not have admin privileges -->

           <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired"/>

           <!-- Block install on Win95 -->

           <FailIf Property="Version9X" Compare="VersionLessThan" Value="4.10" String="InvalidPlatformWin9x"/>

           <!-- Block install on NT 4 or less -->

           <FailIf Property="VersionNT" Compare="VersionLessThan" Value="5.00" String="InvalidPlatformWinNT"/>

         </InstallConditions>

         <ExitCodes>

           <ExitCode Value="0" Result="Success"/>

           <ExitCode Value="3010" Result="SuccessReboot"/>

           <DefaultExitCode Result="Fail" FormatMessageFromSystem="true" String="GeneralFailure" />

         </ExitCodes>

       </Command>

     </Commands>

    </Product>

    Any help in getting this to perform a silent-no-UI install is greatly appreciated.

  • Hi Scott - I'm sorry for the confusion here.  The command lines I originally listed in this blog post are for an unattended install (one that shows a small progress dialog but does not require any user interaction).  You can achieve a fully silent install by changing the /qb! command line switch to /qn.  I've updated the wording of this blog post to reflect this to try to avoid confusion in the future.

    Hopefully this helps!

  • Thank you for your response.

    When i run the setup.exe that is created by the deployment project i am receiving a dialoge box that contains:

    The following components will be installed on your machine:

    Visual C++ Runtime Libraries (x86)

    Do you wish to install these components?

    If you choose Cancel, setup will exit.

    Install Cancel

    This pops up on install no matter what i have done to try to silence it.  

    I hoped using the command switches you identified would do it but the dialogue message still appears.

    Any hlep you can provide on this appreciated.

  • Hi Scott - Unfortunately, the bootstrapper setup.exe that is created by the Visual Studio setup/deployment projects does not support fully silent installs of packages that it chains.  The command lines I listed in this blog post are not helpful in that scenario, but they will work if you are running the VC redist package directly (and not via the VS setup/deployment bootstrapper).  I'm sorry for the hassles.

  • Very useful information, thanks.

    Does anyone have a list of possible return codes? I would like to install it as a prerequisite and I could need a return code if a reboot is required.

  • Hi HolgerG - The return codes for the VC redist packages follow a traditional setup return code pattern, as follows:

    0 = success, no reboot required

    3010 = success, reboot required

    any other value = failure

  • Thank-you! Newbie, perhaps silly question:

    What is the command to uninstall the package? I tried /x, that seemed to make it attempt to extract all files.

    How do most people handle the dilemma of deciding whether to uninstall VC redist or not? Prompting may confuse the user but silently removing it may break other programs.

  • Hi Raboyd - The silent uninstall would need to look something like this (as an example, I'm using the x86 package listed above in this blog post):

    vcredist_x86.exe /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /x vcredist.msi /qn"" "

    In general, your application should not attempt to uninstall the VC redistributable package as a part of your uninstall because it could be needed by other applications on the system.  This recommendation holds for other redistributable programs that you might install as a part of your setup as well (such as the .NET Framework).

    Also, as you say, prompting the user will likely be confusing to them, and there will be at least some of them that choose to uninstall the redistributable package and inadvertantly remove it out from under other applications on the system that need it.

  • Thanks for the prompt response!

    In playing around with my install, it seems that re-installing if the package is already installed does not cause a problem.

    Is the preferred behavior to first check to see if it is already installed? If so, how do I determine if the package is already installed? I assume it's in the registry somewhere?

    Also it seems at least on my computer that having two versions installed simultaneously does not cause a problem. For example I currently have the 2005 and 2008 redistribs installed. Is this OK?

    Thanks for your help. Sorry if I'm getting a little off topic here...

    Mona

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