1

I would like to build my Visual-C++ projects (native/unmanaged C++ projects) with /MD (Multi-threaded DLL) option and ship them along with C-Runtime DLLs to reduce the overall size of my product.

I don't want to run vcredist*.exe from my installer, because my application will stop working if the user uninstalls the vc-redistributables.

I don't want to keep copies of C-runtime DLLs in all my application folders either, because that will again increase the overall size.

I want to keep only one copy of the C-runtime DLLs in one of my applications' common folders. All my application images (*.exe, *.dll) from different folders should be able to load the C-runtime DLLs from this common folder.

For example: C:\Program Files\MyApplication\Common, will contain all C-runtime Dlls

C:\Program Files\MyApplication\bin<br>
C:\Program Files\MyApplication\modules<br>
C:\Program Files\MyApplication\plugins<br>

Images from all the above folders should be able to load C-runtime DLLs from C:\Program Files\MyApplication\Common folder.

Is there a way to force my application to load all C-runtime DLLs from my private location? Will it be possible to get Microsoft updates for my private copy of C-runtime files? What is the best option to ship a private copy of C-runtime and update it during windows update?

Thanks

Ghasem Ramezani
  • 2,683
  • 1
  • 13
  • 32
V Paul
  • 21
  • 2
  • Have the user run the `vcredist*.exe` that your executable needs before they install your executable. – Eljay Sep 11 '21 at 16:50
  • You can get the vcredists packages [here](https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0). Bundle them as part of your setup. Your setup launches vcredist*.exe as appropriate. – selbie Sep 11 '21 at 16:52
  • 1
    See [Side-by-Side Assemblies](https://learn.microsoft.com/en-us/windows/win32/sbscs/about-side-by-side-assemblies-) _"...A Windows side-by-side assembly is described by manifests. A side-by-side assembly contains a collection of resources—a group of DLLs, Windows classes,..."_ – Richard Critten Sep 11 '21 at 16:54
  • Disk space really isn't something to be worried about these days, download size is still somewhat but the VC libraries are small enough that even that shouldn't be much of a concern. Worry much more about your product working. – SoronelHaetir Sep 11 '21 at 16:54
  • have you looked at this? [DLL search on windows](https://stackoverflow.com/questions/2463243/dll-search-on-windows) – yurand Sep 11 '21 at 16:56
  • Installing vcredict globally has the added benefit of automatic security patching and is the recommended way. A private copy of VC DLLs can become insecure over time. – rustyx Sep 11 '21 at 18:36

0 Answers0