Small warning: I’m not a C++ dev
We use VC++ just for a very small part of our application, but this part needs the VC++ 2015 runtime “installed” on the client, but we don’t want the UAC install dialog. So - let’s take a look how we can solve this problem.
And if I write something stupid here - please let me know.
Ways to deploy VC++ 2015
There are three ways to deploy the runtime:
- Install it via the standalone VCRedist installer. This is probably the most known way, but requires elevated permissions because the file will be installed to System32.
- Install it via a merge module. If you already have an installer, you can include the needed .msm files in your own installer, but this will also require elevated permissions because the files will be also installed to System32.
- Deploy it with your app as app-local deployment. We will cover this in this blogpost, because we don’t want to touch anything that needs elevated permissions.
If you want to read more about the first two ways, the MSDN might be a good place to start.
App-Local deployment of the VC++ 2015 runtime
All what you need is already (if you are using Windows 10 & Visual Studio 2015) installed on your dev machine. Otherwise you will need to download the Windows 10 SDK and Visual Studio 2015.
Depending on your application, you will need to ship all dlls from the following folders with your application (= the dll/exe/whatever that needs the runtime) :
- C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x86
- C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT
- C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x64
- C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT
The “Universal CRT” consists of many dlls and all are required. You have to copy them to your application folder and it should just work.
As far as I know, if a user has installed the runtime via VCRedist or the merge modules the files inside System32 will be picked.
I found this solution here and it seems to work just fine - no UAC prompt. Yay.
Hope this helps.