views:

59

answers:

3

I have designed an application that requires no install and can be used by non-administrators. I would rather not lose this functionality but when I use the .exe on other computers than the one I programmed it on I get an error that a missing MSVCP100.dll is preventing the file from executing.

What am I doing wrong here? How do I include the file in my release build?

Thanks!

+2  A: 

http://msdn.microsoft.com/en-us/library/ms235299.aspx

Distributing apps that have been compiled with Visual C++ requires distributing the C++ runtime .dlls that your app uses. In your case, I assume you want to just distribute a folder, so follow the directions (appropriately modified for your app) here:

http://msdn.microsoft.com/en-us/library/dd293565.aspx

Or just copy msvcp100.dll into your application's directory alongside the .exe and you'll be good to go.

MSN
+4  A: 

Configure your project to statically link to the C/C++ runtime instead of linking to the runtime DLL:

  • Configuration Properties | C/C++ | Code Generation | Runtime Library

Select Multi-threaded (/MT) (or Multi-threaded Debug (/MTd) for your debug build).

As an alternative, you should be able to get xcopy deployment of the C/C++ runtime DLL using the technique documented on http://msdn.microsoft.com/en-us/library/ms235291.aspx under the heading "Deploying Visual C++ library DLLs as private assemblies". I haven't tried that technique, as it's generally simpler to just statically link if you need xcopy installation of a native C++ program.

Michael Burr
Ideally, though, you'd use a manifest and distribute via ClickOnce so that future patches to the .dlls you use would get update appropriately. But this also works :)
MSN
@MSN: though that kindof goes against the "requires no install" part ;)
Cogwheel - Matthew Orlando
Not to mention the "c++" part.
Hans Passant
+1  A: 

What am I doing wrong here

What you had was dll hell. You had unintentionally used a dynamic linkage with the previous compiler where it just happened on most target systems there was an appropriate C runtime. Windows often included VC 6 CRT, and with more recent SP even VC7 & 8 CRT.

When you changed to the latest VC compiler most systems will not have the new VC runtime pre installed for you.

As Michael Burr says, you can have your 'no install' back if you link statically.

Or you could include the CRT and manifest in the same folder, still doesn't require install.

Or include the vcredist.exe from VS2010 and have a 1 off install

Greg Domjan
Wouldn't this be called "no-idea-what-dll-hell?"
Hans Passant
Thats worth a point. :)
Greg Domjan