Visual Studio 2017 Installer Project - include VC++ 2015 Redistributable
Asked Answered
E

2

4

I am creating the installer for my application using a "Visual Studio Installer" project type in Visual Studio 2017.

I want my installer to install visual c++ redistributable 2015 with my application. I've downloaded the vc_redist.x86.exe file, included it in my project, and I'm trying to do the install as a custom action on "install". I am launching with the arguments /install /passive /norestart.

When I execute my installer, when it does the custom action, I get this error:

There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.

I can run vc_redist.x86.exe /install /passive /norestart at the command prompt with no problem or errors.

Any suggestions or alternative ways to include Visual C++ redistributable as part of my install?

Educational answered 31/8, 2018 at 16:2 Comment(0)
P
5

You can't run that redistributable as a custom action because it's an MSI-based install, and you cannot run recursive MSI installs (yours calling the VC redist one).

In Visual Studio setup projects you're supposed to use the Prerequisites feature. Right-click the setup project in Solution Explorer, choose Properties, then Prerequisites. This will build a setup.exe to install prerequisites followed by your MSI file. As far as I can tell, the Microsoft Visual C++ 14 is the Visual Studio 2015 runtimes.

Pomiculture answered 4/9, 2018 at 16:36 Comment(0)
K
0

Recommendation: Migrate to WiX Burn (bootstrapper / downloader / sequencer) to allow more future flexibility and control (WiX links below).

Alternatively try the prerequisites section below first (select the "Visual Studio 14" entries for install) or try the merge modules available (section below). Please pay attention to the disclaimers for the merge modules.


Logging & Mutex: What does the log file say? From a technical point of view the usual problem is that you can not install another MSI package from within your own running MSI setup due to technical runtime restrictions. A mutex is set to prevent several MSI installation transactions to happen at once. Check the logs. This redistributable is MSI-based I believe - so you will see this problem when running the EXE from a custom action like you do.

Deployment Tools: Visual Studio Installer Projects are very limited, and it seems most people migrate away from them to another deployment tool over time. Maybe have a look here - and here is a list of tools. WiX's Burn feature (bootstrapper / downloader / sequencer) can achieve what you need. Also read PhilDW's answer here.

Prerequisites: Visual Studio Installer Projects do have a prerequisites view (click the Prerequisites... button) where a limited number of prerequisites can be defined for installation via the setup.exe bootstrapper (not kicked off from within your MSI itself, but from its bootstrapper setup.exe - this means you don't kick off the install from within your own MSI, but before it starts to install - and it can hence work correctly). I am not sure if the entries for "Visual Studio 14" are for the runtime version you need. You could give it a try I suppose.

Merge Modules: There are merge modules to install the Visual Studio Runtime (see here, section "Visual C++ Runtime" - quite a bit down the page), but they seem inadequate these days for reasons explained here (very important). Essentially the Visual Studio Runtime is more complicated from 2015 onwards - and the EXE installer is preferred. Must read link - please. In order to locate relevant merge modules, please search for *.msm files underneath %ProgramFiles(x86)% - if you have Visual Studio (and / or the Windows SDK) installed. Merge modules can be installed embedded in your own package without the need for a setup.exe launcher. In Visual Studio, right click your installer project, Add, then Merge Module...

Kono answered 31/8, 2018 at 20:3 Comment(2)
This is not answering anyting, its suggesting something else.Centrifugate
To me VS installer projects are too limited: Here is why (short version). Sometimes you want to warn people that the approach they use lead them into bear traps. See the "Prerequisites" section above - you can install the VC++ runtime for your VS version using this feature, but it is very limited. WiX / Burn can install anything you want. Pillage github.com for samples.Westbrooke

© 2022 - 2024 — McMap. All rights reserved.