Aaron Stebner's WebLog

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

Mailbag: How to perform a silent install of the Visual C++ 2008 redistributable packages

Mailbag: How to perform a silent install of the Visual C++ 2008 redistributable packages

Rate This
  • Comments 67

Question:

You previously posted a list of command line switches to perform silent and unattended installations of the Visual C++ 2005 runtime redistributable packages.  How can I perform silent and unattended installations of the Visual C++ 2008 runtime redistributable packages?

Answer:

The Visual C++ 2008 redistributable packages (vcredist_x86.exe, vcredist_x64.exe and vcredist_ia64.exe) support the following command line installation options.

The same command lines are valid for the VC++ 2008 redistributable packages and the VC++ 2008 SP1 redistributable packages.

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.

<full path>\vcredist_x86.exe /qb

For example, if you download vcredist_x86.exe to a folder named c:\vc2008redist, then the command line would look like this:

c:\vc2008redist\vcredist_x86.exe /qb

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.

<full path>\vcredist_x86.exe /qb!

For example, if you download vcredist_x86.exe to a folder named c:\vc2008redist, then the command line would look like this:

c:\vc2008redist\vcredist_x86.exe /qb!

Silent install

This option will suppress all UI during installation.

<full path>\vcredist_x86.exe /q

For example, if you download vcredist_x86.exe to a folder named c:\vc2008redist, then the command line would look like this:

c:\vc2008redist\vcredist_x86.exe /q

Related links:

<update date="7/7/2009"> Added information to indicate that you must provide the full path to the file vcredist_x86.exe when running the silent install command lines or they will display UI. </update>

 

  • hi Aaron

    i tried this vcredist_x86.exe /q option its installing silently but the msiexec.exe created is not finishing properly. help me in this

    thanks

  • Hi Funjay - Do you have any log files from the failing install on your computer?  The logs should be named %temp%\dd_vcredist*.  If you can gather those files, zip them, post them to a file server (such as http://skydrive.live.com) and then reply here with a link, I can download them and take a look to see if I can figure out what is causing the installation failure on your computer.

  • Hi Aaron!

    if i use vcredist_x64 through aplication to install it. how is the full command line to extract and install this package ???

  • Hi Thanatos83 - I tried using the same command lines as the ones listed above, except I substituted vcredist_x64.exe instead of vcredist_x86.exe and it behaved as expected for both silent and unattended install.  Can you give that a try and see if it works for you as well?

    Unattended install:

    vcredist_x64.exe /qb

    Silent install:

    vcredist_x64.exe /qn

  • Hi astebner!

    yep, if you extract the package MANUALLY for example with winrar and then install the MSI file through these comand lines, work perfect.

    but if you use, for example the comand line as in visual c++ 2005 sp1 to extract the package in %temp% folder or c:\ and then install it, then when i execute the installer the program run wizard and not install automatically.

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

    what is the full comand line to extract the package automatically and then install it with for example: /qb ???

    I forget mention that i use an installer like (NSIS) and need to install this package through NSIS installer.

    Another question is:

    The return codes of visual c++ 2005 sp1, these are the same codes as visual c++ 2008 ???

    if a boot is required, in visual c++ 2005 sp1:

    return codes: 3010,8192,1641,1046

    thanks...

  • Hi Thanatos83 - I'm afraid I don't understand your question.  When I tried this scenario out on my computer this afternoon, I used the exact command line vcredist_x64.exe /qn to automatically extract + install the VC++ 2008 Redistributable (x64) in silent mode.  Are you seeing different behavior than this on your systems?

    There is no need to use the complicated command line switches that were used in the VC++ 2005 Redistributable because the 2008 versions use a different technology for the self-extracting functionality.

    The return codes will be the same for the 2005 and 2008 versions because both are packaged as MSI files inside the self-extracting packages.

  • Ah ,ok. Finally work to me with these comand line :)

    So there's no problem and only i use /qn go silent and /qb for unattended.

    I use in my installation other MSI package installation like (G4WL and PhysX), the command lines for these are practically the same.

    1) So, windows intaller MSI use the same

    method?.

    2) Some aplications need to install visual c++ 2005 or 2008 redistributable and then include with their product this redis. And only include (vcredist_x86) package.

    In x64 systems, it is necessary install the package (vcredist_x86, as visual c++ 2005 or 2008) ???. Sometimes, an aplications is required to me to install this package and always i use the x64 system and then install (vcredist_x86 package).

    So there's no problem???

    thanks Aaron.

  • Hi Thanatos83 - For your first question, yes, the command line syntax happens to be the same for the VC++ 2008 Redistributable EXEs as they are for standard MSIs.  The chainer that installs the VC++ 2008 Redistributable (install.exe) passes the /qn and /qb settings through to msiexec.exe when it installs the MSIs.

    For your second question, the vcredist_x64 package only contains 64-bit versions of the Visual C++ runtime files.  If you plan to run a 32-bit application on a 64-bit version of Windows, then you'll also need to install vcredist_x86 onto your 64-bit version of Windows.

    This packaging is different than the .NET Framework.  The 64-bit version of the .NET Framework includes both 32-bit and 64-bit payload, so you only have to install the 64-bit version of the .NET Framework on a 64-bit OS (and in fact, the 32-bit version of the .NET Framework will block if you try to install it on a 64-bit OS).

  • I am calling "vcredist.exe /q". All is working corectly, but there are some unpacked files in the C:\ root folder - is this correct can I avoid this(other directory or something else)?

  • Hi Timjenssen - What exact files do you see in the root of the C drive?  Those files should be cleaned up when the setup process exits.  If you need to avoid having the files go to the root of the drive during installation, you will have to run 2 steps - one to manually unpack to a directory of your choice, and the other to install.  For example, if you want to unpack to a directory named c:\vcredist, you would run these commands:

    vcredist_x86.exe /x:c:\vcredist /q

    c:\vcredist\install.exe /q

  • I found an article about the bug: http://support.microsoft.com/kb/950683

    But I am using vcredist from here:

    http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en

    Is there a newer version without this bug?

  • c:\vcredist\install.exe /q

    ^^ this step is producing the files in C:\

  • Hi Timjenssen - Interesting, I wasn't aware of that bug.  It looks like there's not a way for you to avoid having this installer create these files at the root of your drive like that.  The installer for the VC++ 2008 SP1 Redistributable has a fix for this issue, so you may be able to install that instead unless your application depends on the versions of the VC++ runtime files that are delivered in the original VC++ 2008 redistributable package.

  • Hi Aaron - why does running "vcredist_x86.exe /q" always require a reboot, even if the same version is already installed? Each time it is run, we see 3 or 4 PendingFileRenameOperations, such as "c:\Config.Msi\658bd.rbf". Is there a way to prevent this? It is causing an unnecessary reboot in our installer. We could add a check to our installer to see if the expected version is already installed first, but this would be major headache since we have many different release branches we would have to maintain.

  • Hi Gmiller - I haven't seen the VC++ 2008 Redistributable request a reboot in the scenarios where I've tried to install it in the past.  Reboots happen because files are in use that the installer needs to update.  I'm not sure that the RBF files are the cause of the reboot though - it is more reliable to look in the verbose MSI log file to determine the cause.  For the VC++ 2008 Redistributable, the verbose logs will be named %temp%\dd_vcredist*.

    The way to avoid files in use is to make sure that running processes that are using any of the files being installed by the package are shut down before installing.  In your case, you could also check to see if the VC++ 2008 Redistributable is already installed and skip running it if so to prevent at least some of the cases where a reboot might be requested.

Page 1 of 5 (67 items) 12345
Leave a Comment
  • Please add 4 and 8 and type the answer here:
  • Post