简体   繁体   中英

Visual c++ redistributable redistribution

I'm coming from a Linux background, but I'd like to provide a version of my software on Windows. For users to run my program, they will need the Visual C++ redistributable. I would like to provide it for them as part of the package.

My worry is that there, in the future, will be an SP2 of the Visual Studio 2008 Redistributable. If I provide them SP1, or ask them to install it themselves, will it clobber later versions of the dll's that may be required by future tools?

Is there any instruction to give users to make sure they do not do this?

I'd certainly not want to screw up someone's machine or other applications by giving them incorrect instructions.

Aside from the redistributable exe, I was going to provide my tool as a zip file which they can extract into any directory they please, so I was not planning on providing an installer.

With VS 2008 the runtimes are manifested and will install side-by-side. So if your application is linked to SP1's runtime, it will run only with the SP1 runtime (unless a manifest explicitly indicates that the Sp1 version should be overridden).

So you're protected from that type of DLL hell, in exchange for another (the user must have the SP1 redistributable installed).

你为什么不静态链接并完全避免这个问题?

The VC++ redistributables are meant to be installed side-by-side and can coexist peacefully.

Here's a page from the MSDN docs about the VC++ redistributables . That whole Deployment section of MSDN should be instructive.

As people said, they're installed side-by-side. If you use Visual Studio's installer project type, there's an option for including the CRT redistributable, and it will set it up properly for you to be installed and uninstalled with your application.

In particular, they're installed to the \\Windows\\WinSxS directory.

To get an intuition for how side-by-side works, do

cd %systemroot%\winsxs
dir /S msvc*.dll

And you will see all the versions people have put on your machine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM