Developing Windows Applications by Mykola Dudar

Helping Developers Build Applications for Windows using Visual Studio.

Workaround for using VS2005 SP1 version of VCRedist.EXE within a boostrapper (setup.exe)

Workaround for using VS2005 SP1 version of VCRedist.EXE within a boostrapper (setup.exe)

  • Comments 10

A reader of the previous post on my blog has posted two questions about using SP1 version of VCRedist.EXE as a boostrapper package. I felt that the topic is important enough to discuss it in a dedicated post rather than comments on another post. Here are quotes of original comments:

 

I'm trying to redistribute vc_redist.exe, but the version that I can download from the web and my version install with visual studio seem to be different:

The version of vc_redist.exe downloaded from the microsoft website seems to be:  8.0.50727.42

While the version of the libraries used by VC seem to be 8.0.50727.762

Is there anywhere on the microsoft website that has the newer version?

 

SP1 version of VCRedist is installed by VS2005 SP1 update on the hard drive and it is also available as a download. The SP1 version of  VCRedist.EXE is installed into the same place where RTM version was, %VSINSTALLDIR%\SDK\v2.0\BootStrapper\Packages\vcredist_*\

One may use it to redistribute SP1 versions of VC++ Libraries. 

 

VS2005 SP1 version of VCRedist.EXE is a major upgrade to RTM version of VCRedist.EXE. Before installing of SP1 version of libraries, it is going uninstall RTM version or any other earlier than SP1 version of VCRedist.EXE. Only then it is going to install new versions of VC++ libraries.

 

When it is used as part of  bootstrapper (setup.exe), RTM version of VCRedist.EXE may be downloaded instead of SP1 version because of incorrect product code specified in product.xml. Here is another quote from the comment I have received:

 

As the click once deployment seems to only check for the installation on the local machine thus:

 <InstallChecks>

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

 </InstallChecks>

I noticed this post on Aaron Stebner's blog:

http://blogs.msdn.com/astebner/archive/2007/01/24/updated-vc-8-0-runtime-redistributable-packages-are-included-in-visual-studio-2005-sp1.aspx

It includes the statement:

<quote>

One additional note - the data files included with the Visual Studio deployment bootstrapper tool were not updated with the new SP1 detection mechanism.  This means that if you build a setup project in VS 2005 SP1 and include the VC redist package as a prerequisite, your setup will end up downloading and installing the VC redist package on systems that already have the original VS 2005 version of this redist package installed.  Because of the major upgrade functionality, this will not harm users' systems at all, but it will result in a slight time delay due to an unnecessary download and install.

</quote>

It appears that the product code has been changed to: {7299052b-02a4-4627-81f2-1818da5d550d} but the prerequisites definitions haven't for the bootstrapper.  As a result, the bootstrapper code will still fail as I described above.  

 

Aaron is right that product.xml is not updated with the new product code. It contains old MSI Product code that corresponds to RTM version of VCRedist.EXE. product.xml is used in building boostrappers (setup.exe) and Clickonce deployment for detection of this version of bootstrapper package already installed on the computer. If product code is not updated, each time a bootstrapper launches install, it is going to attempt to re-install VCRedist.EXE again. To work around the issue, it is possible to change that line of product.xml with a new MSI Product code, which is {7299052b-02a4-4627-81f2-1818da5d550d} for the x86 package, {071c9b48-7c32-4621-a0ac-3f809523288f} for the x64 package or {0f8fb34e-675e-42ed-850b-29d98c2ece08} for the ia64 package. Developer support team may also help out with this issue if contacted using ways described on http://support.microsoft.com. I apologize for not catching this before SP1 was released. We are investigating why it slipped through our testing of SP1. Meanwhile for VS2005 SP1 and VS2005 hotfixes you may use the workaround or request new product.xml from the support team.

  • Thanks for clearing this up.

    Anthony Wieser

    Wieser Software Ltd

  • Here is something I am still confused about:

    If I build a native C++ app with VS2005 SP1 ( not an express version ), does my app then require that the users have the SP1 version of the VCRedist.EXE installed?  Or if they have the pre SP1 version, will my app still run?

    It seems like that could not be a requirement since Express developers have no way to hand out the new runtime libraries.

  • > If I build a native C++ app with VS2005 SP1 ( not an express version ), does my app then require that

    > the users have the SP1 version of the VCRedist.EXE installed?

    As far as I can tell, the answer is yes, unless you redistribute the individual DLLs (CRT, MFC, etc.) with manifests somehow hacked to work.

    Why did you say "( not an express version )"?  If you use VS2005 SP1 Express, I think the burden on users is still the same, only they can't get vcredist.exe from you and they can't get it from Microsoft.

  • Sorry for the anger, but is Visual Studio really supposed to be used by professionals with clients ? This kind of issues should come with big warning BEFORE the Service Pack install. I mean, giving a client an application that doesn't work on their computers is kind of... damaging.

  • Iv said:

    > giving a client an application that doesn't work on their computers is kind of... damaging

    Not if your name is Microsoft.  The rest of us have to experiment and learn what not to do.

  • Dusty,

    Yes, if you build C++ application with VS2005 SP1, you have to redistribute SP1 version of VC++ libraries to end-user computers. There are three ways to achieve this as described in docs. See http://msdn2.microsoft.com/en-us/library/aa983349(VS.80).aspx

    Your application is not going to run if the correct version of VC++ libraries is not installed on the system.

    Also VCRedist.EXE is already available online (http://blogs.msdn.com/nikolad/archive/2007/04/23/vs2005-sp1-version-of-visual-c-redistributable-package-is-available-for-download.aspx) and even without it VC++ Express customer can redistribute VC++ libraries using redistributable MSMs installed on their system (http://blogs.msdn.com/nikolad/archive/2005/09/02/running-c-application-built-by-vc-express-on-another-computer.aspx).

    In Orcas we are also enable application local redistribution in VC++ Express.

    Iv and Norman,

    What issue are you talking specifically? Do you mean old product code in product.xml?  Yes, I agree with you that this this bug should be detected before the release. We are improving test coverage of this area for Orcas release and hope to catch similar issues.  

  • I think Iv's complaint was that, after Iv graded to SP1 but Iv's clients didn't, Iv's VS2005 produced applications which wouldn't execute on Iv's clients' machines.  The Microsoft pages that provide SP1 to VS2005 customers didn't warn about this result.

    Blog readers do appreciate that information is available in blogs since the information isn't available elsewhere.  But this doesn't exactly mean it's right for the information to be unavailable elsewhere.

    As for my generic comment, a few examples are VS2005 + SP1 + Update for Vista still crashing several times a week, VS2005 + SP1 on XP still crashing maybe twice a week, Windows XP still BSODing occasionally though fortunately far less frequently than in years 2002 to 2006, Internet Explorer 6 still crashing several times a week (rolled back from Internet Explorer 7 because that crashed several times a day), etc.  Giving a client an application that doesn't work on their computers isn't damaging if your name is Microsoft.

  • Glad the runtime is finally available for download - thanks.

    If someone at Microsoft can do a post mortem on this vcredist/SP1 mess and make some "it won't happen again" noises it would be reassuring for prospective Orcas users.

  • You are seriously a life saver!!!  If it counts, +1 vote to fix this one soon from me, and +20 from all of my beta testers :)

    Here's a brief experience of what happened...

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1757272&SiteID=1&mode=1

  • Even after updating the product.xml with product code {7299052b-02a4-4627-81f2-1818da5d550d}, It still wants to re-install vcredist every time I build.  

    Any idea what is going on?  -thanks

Page 1 of 1 (10 items)