Visual Studio 2017安装程序项目-包括VC ++ 2015可再发行组件 [英] Visual Studio 2017 Installer Project - include VC++ 2015 Redistributable

查看:308
本文介绍了Visual Studio 2017安装程序项目-包括VC ++ 2015可再发行组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2017中的"Visual Studio Installer"项目类型为我的应用程序创建安装程序.

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

我希望我的安装程序通过我的应用程序安装Visual C ++ Redistributable 2015.我已经下载了vc_redist.x86.exe文件,并将其包含在我的项目中,并且我试图作为安装"上的自定义操作来进行安装.我以参数/install /passive /norestart启动.

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:

此Windows Installer软件包有问题.作为安装程序一部分运行的程序未按预期完成.请与您的支持人员或包装供应商联系.

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.

我可以在命令提示符下运行vc_redist.x86.exe /install /passive /norestart,而不会出现问题或错误.

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

在安装过程中是否包含将Visual C ++可再分发的任何建议或替代方法?

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

推荐答案

由于它是基于MSI的安装,因此不能将其作为可自定义操作运行,并且不能运行MSI递归安装(您将VC redist称为递归安装) ).

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).

在Visual Studio安装项目中,您应该使用先决条件功能.在解决方案资源管理器中右键单击安装项目,选择属性",然后选择先决条件".这将生成setup.exe以安装必备组件,然后安装MSI文件.据我所知,Microsoft Visual C ++ 14是Visual Studio 2015运行时.

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.

这篇关于Visual Studio 2017安装程序项目-包括VC ++ 2015可再发行组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆