Visual Studio 2017 安装程序项目 - 包括 VC++ 2015 Redistributable [英] Visual Studio 2017 Installer Project - include VC++ 2015 Redistributable
问题描述
我正在使用 Visual Studio 2017 中的Visual Studio 安装程序"项目类型为我的应用程序创建安装程序.
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 安装程序包有问题.作为安装程序的一部分运行的程序未按预期完成.请联系您的支持人员或软件包供应商.
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 Redistributable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!