Redistributable
(1)
Senario
(1)
Window
(1)
Libs
(1)
MFC
(1)
CRT
(1)

How to C++ exe without installing C++ Redistributable Package

Asked By Leo
28-May-10 02:01 PM
When I tried to deploy the EXE developed using MFC in VS 2008 on to
the client machine, I got the following error: This application has
failed to start because the application configuration is incorrect.
Reinstalling the application may fix the problem. I did some research
and noticed that this is a common problem if I install EXE onto
machine without C++ installed. It seems Microsoft requires to install C
++ Redistributable Package on client machine.

However in my senario, the client machine has strong requirement that
I cannot install anything physical onto the machine and my EXE can only
be run in a USB drive. Is there anything I can do to make my
application run on the client machine without installing anything?
Recompile my work in VS 6?

Thanks in advance...

You actually have two pretty good choices.

David Ching replied to Leo
28-May-10 02:51 PM
You actually have two pretty good choices.  You can either static link the
CRT/MFC libs into your .exe so that that is all you need to distribute.
Edit your project properties by right clicking on the project in the
Solution Explorer window and select Properties.  In the General tab, choose
to statically link MFC.

The other option is to use an "app-local" deployment of the CRT and MFC
DLL's which you put into either the same folder, or a sub-folder of, your
.exe.  The DLL's you need to redistribute are in the e.g. c:\program
files\microsoft visual studio 2008\vc\redist folder.  You need the proper
platform (e.g. x86, etc.) and the CRT and MFC (if it is an MFC app.)

-- David
Post Question To EggHeadCafe