Visual C++ Developer Center > Visual C++ Forums > Visual C++ General > How to run vcredist_x86 (of MSVC 2005 SP1) from a deployment project in MSVC 2008
Ask a questionAsk a question
 

AnswerHow to run vcredist_x86 (of MSVC 2005 SP1) from a deployment project in MSVC 2008

  • Wednesday, November 04, 2009 11:46 AMitamarat Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I have an application which is developed in MSVC 2008 SP1. The project uses some DLLs that was developed on MSVC 2005 SP1, and therefore need the vcredist_x86.exe of MSVC 2005 SP1 to be installed. I also have a deployment project in MSVC 2008 that creates a simple and nice installer for the application. To make the application work on a target PC, I need to install the application itself, and the MSBC 2005 SP1 redist package.

    I have tried several ways to bind the installation of the MSVC 2005 SP1 redist package with the application installation, and none of them succeeded:
    1. Defining "Visual Studio Runtime Libraries (x86)" as a prerequist in the deployment project - The deployment project chose the MSVC 2008 SP1 as the redist package, instead of MSVC 2005 SP1.
    2. Run vcredist_x86.exe (of MSVC 2005 SP1) as a "Custom Action" during "Install" or "Commit" phases - When installing the application, the installer program (Windows nstaller 3.1) could not run the vcredist_x86.exe file because it is a Windows Installer 3.1 file too, and it can't run a Windows Installer instance from antoher Windows Installer.
    3. I did managed though to add the MSVC 2005 SP1 redist package to the preprequities list, but, this solution limits a future development of the project on another machine because to add the MSVC 2005 SP1 to the list needed to be done localy (add some files to a directory on C:\Program Files\....\BootStarapper\Packages\...).
    I'm trying not to bother the user to much, and to ask him only to run setup.exe to install my application. I need to find a way to install the MSVC 2005 SP1 redist package by the deployment project. I hope some one could assist me with that :)


    Thanks in advance for your answers :)

    Itamar

Answers

All Replies

  • Wednesday, November 04, 2009 3:15 PM«_Superman_»MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Here is a simple approach.
    Create an EXE or BAT file to run the vcredist_x86.exe and setup.exe one after another.

    The real solution must be not to run vcredist_x86.exe from the setup.
    Rather the dependent files must be included as part of setup.exe and must be installed.

    I don't know whether this can be done using a setup project but I have used install shield and it has a feature of automatically scanning dependencies and adding them to the installation.
    I believe you can do the same with a setup project also, but you may have to add them manually.

    «_Superman_»
    Microsoft MVP (Visual C++)
  • Wednesday, November 04, 2009 4:17 PMitamarat Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    Thanks for the reply :)

    The setup project can look for dependencies, but doesn't find them...

    I guess I have no other way beside creating a little batch file.


    Thanks again,

    Itamar
  • Wednesday, November 04, 2009 7:20 PM«_Superman_»MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    If you can get hold of InstallShield, you can do a static as well as runtime scan for dependencies and add them automatically.
    It is a great tool for creating setup.exe or MSIs.

    «_Superman_»
    Microsoft MVP (Visual C++)
  • Friday, November 06, 2009 7:05 AMNancy ShaoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Hi Itamar,

    You can use this code to perform a silent install:

    vcredist_x86.exe /q:a
    
    
    


    For more information, please refer to Aaron Stebner's blog with following link:

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

    Best Regards,
    Nancy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.