views:

148

answers:

2

I am trying to deploy a Visual C++ application (developed with Microsoft Visual Studio 2008) using a Setup and Deployment Project. After installation, users on some target computers get the following error message after launching the application executable: “This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem.” Another user after installation could run the application properly. I cannot find the root cause of this problem, despite spending several hours on the Visual Studio help files and online forums (most postings date back to 2006). Does anyone at Stack Overflow have a suggestion? Thanks in advance. Additional details appear below.

The application uses FLTK 1.1.9 for a GUI library, as well as some Boost 1.39 libraries (regex, lexical_cast, date_time, math).

I made sure I am trying to deploy the release version (not the debug version) of the application. The Runtime library in the Code Generation settings is Multi-threaded DLL (/MD).

The dependency walker of myapp.exe lists the following DLLs: wsock32.dll, comctl32.dll, kernel32.dll, user32.dll, gdi32.dll, shell32.dll, ole32.dll, mvcp90.dll, msvcr90.dll.

In the Setup and Deployment Project, I add the following DLLs to the File System on Target Machine: fltkdlld.dll, and a folder named Microsoft.VC90.CRT with msvcm90.dll, msvcp90.dll, mcvcr90.dll and Microsoft.VC90.CRT.manifest.

The installation process on the target computers getting the error message requires having the .Net Framework 3.5 installed first.

Any suggestion? Thanks in advance!

+1  A: 

Add the Visual C++ Redistributable to your Deployment project and be sure to run Setup.exe instead of the MSI when installing. This will invoke the VCRedist bootstrapper to ensure your PC has those pieces before installing your app.

Dependency Walker only shows static (link time) dependencies - it cannot possibly know about dynamic dependencies such as COM objects.

JBRWilkinson
Hi - Thanks for your reply. In my post above, I detail how I already have a folder (in the Setup and Deployment Project, in the File System on Target Machine) named Microsoft.VC90.CRT with msvcm90.dll, msvcp90.dll, mcvcr90.dll and Microsoft.VC90.CRT.manifest. Is that not the Visual C++ redistributable that you mention in your answer?
Julien
It's not the same, no. My concern is that these MSVCRT DLL's may not be the right version for all of your dependencies... To check, on a working machine, use Process Explorer to determine the complete list of DLLs that are in use and compare to the versions you're shipping. On a working machine, there may be some (obscure) thing installed which shipped another version of the DLLs.
JBRWilkinson
Ok. I added the file vcredist_x86.exe to the Setup and Deployment Project. Is that what you mean by "Add the Visual C++ Redistributable to your Deployment project"? I then asked the user on a target machine to run the new setup.exe (with the new *.msi) and the error message still appears. Any insight?
Julien
Well I'm still stuck. I went into the Properties of the Setup and Deployment Project and in the Prerequisites I checked the Visual C++ Runtime libraries (x86). They do get installed on some target computers (when they are missing), but the error message is still there.
Julien
A: 

I had a similar problem after the ATL security updates last year. My app needed a later version of the C++ runtime libraries than the deployment project included.

Try running Windows Update on the target machines after installation, or download and install the latest (28 July 2009) C++ redistributable package directly.

http://support.microsoft.com/?kbid=973551

That solved the problem for me. I haven't fixed the deployment project yet though.

PhilMY