Visual C++ Redistributables without using VCRedist_x86.exe

后端 未结 4 410
我在风中等你
我在风中等你 2020-12-05 01:33

I\'m developing in an environment that is severely constrained, but the developers also have tight control over.

VCRedist_x86.exe - A 4Mb redistributable - is no f

相关标签:
4条回答
  • 2020-12-05 01:56

    Specify /MT (Multithreaded) for the "runtime library" setting in the compiler property page. This statically links against the runtime library so you don't have to install the redistributable.

    0 讨论(0)
  • 2020-12-05 01:58

    We use this: Howto: Deploy VC2008 apps without installing vcredist_x86.exe

    Essentially

    • Don't embed a manifest in your exe files.
    • Copy the C++ DLLs and their manifests to your app's directory.
    • Remove the "publicKeyToken" from all manifests (yours and Microsoft's).
    • If necessary, change the version info in your app's manifest files to match the Microsoft manifest files (or vice versa)
    0 讨论(0)
  • 2020-12-05 02:00

    Install them as private assemblies. See here:

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

    Note that if you don't need all of the DLLs provided you can modify the manifest files to only reference the ones you need.

    0 讨论(0)
  • 2020-12-05 02:01

    [I'm the current SxS maintainer at Microsoft]

    I would strongly suggest against removing the publicKeyToken attribute from manifests. Private deployment of the dlls will work just fine with this attribute left intact. However, removing it will prevent your app from benefiting from security updates should there be a newer version of the CRT installed centrally on the target machine, as the dependencies will no longer match up.

    So, to summarize: it's safe to embed your manifest, with the default. Copy the CRT manifest + DLL files directly into your executable's directory, with no edits. That's it. Compatible Win2k+.

    0 讨论(0)
提交回复
热议问题