简体   繁体   English

向安装项目Win32应用程序Visual Studio添加依赖项

[英]Adding dependencies to a setup project Win32 application Visual Studio

Hi I am looking to create a setup project for my Win32 application developed using Visual Studio 2013. I have created the setup.exe using InstallShield However now i also need to add dependencies which should be installed along with the required application when setup.exe is run. 嗨,我正在为使用Visual Studio 2013开发的Win32应用程序创建安装项目。我已经使用InstallShield创建了setup.exe。但是现在我还需要添加依赖项,当setup.exe是跑。

The dependencies are simply Visual C++ Redistributable for Visual Studio 2015 . 依赖关系只是Visual Studio 2015的Visual C ++可再发行组件

I went through this article for creating the setup.exe for my application. 我浏览了这篇文章,为我的应用程序创建setup.exe。 But I did not find any documentation which directs me how to add dependencies to this installer. 但是我找不到任何指导我如何向此安装程序添加依赖项的文档。

I found this document which describes a walkthrough for adding dependencies but that is no more possible in Visual Studio 2013 as much as I am aware. 我发现文档描述了添加依赖项的演练,但据我所知,在Visual Studio 2013中这是不可能的。 Now we 'NEED' to use Install Shield. 现在,我们需要使用Install Shield。 Correct me if I am wrong. 如果我错了,请纠正我。

Please direct me to some documentation which will guide me to add dependencies to my setup project. 请指导我一些文档,这些文档将指导我将依存关系添加到我的安装项目中。

UPDATE UPDATE

I found in the InstallShield Project Assistant an option to check for installation requirements. 我在InstallShield Project Assistant中找到了一个检查安装要求的选项。 But it requires you to specify the directory to search the particular file. 但这需要您指定目录以搜索特定文件。 As far as I know the Visual C++ Redistributable package is not installed in any particular location but the only way to detect its presence is to check if the registry key is set to 1. 据我所知,Visual C ++可再发行组件包未安装在任何特定位置,但是检测其存在的唯一方法是检查注册表项是否设置为1。

So instead of checking I'd rather always have the setup file to install the Visual C++ Redistributable package no matter it is present or no. 因此,我宁愿始终拥有安装文件来安装Visual C ++可再发行组件包,而不管它是否存在。

But even for that how do I go about it? 但是即使如此,我该怎么做呢?

There might be other reasons you need to use InstallShield that I'm not aware of, but in the simple case of a C++ app that needs the runtime as a prerequisite, I'd use Visual Studio 2015 (Community Edition will do) and add the Installer project extension. 可能还有其他我不知道需要使用InstallShield的原因,但是在简单的C ++应用程序需要运行时为前提的情况下,我将使用Visual Studio 2015(Community Edition将这样做)并添加Installer项目扩展。 The project properties lets you build a prerequisite installer (a setup.exe) and among the choices are the VC++ runtimes. 项目属性使您可以构建必备的安装程序(setup.exe),并且其中包括VC ++运行时。 That's just an exe that does its checks and installs if required. 那只是一个exe,可以根据需要进行检查和安装。

I'm not sure how you got a VC 2015 C++ requirement while developing with VS 2013. Again, VS 2013 also has a community edition and an installer project extension that will install the VS 2013 C++ prerequisites. 我不确定在使用VS 2013进行开发时如何满足VC 2015 C ++的要求。同样,VS 2013还具有社区版和安装程序项目扩展,可以安装VS 2013 C ++必备组件。

The redistributable installers have their own checks to see if they need installing. 可重新分发的安装程序有自己的检查以查看是否需要安装。 I wouldn't expect InstallShield to require you to know the detection rules of a C++ runtime. 我不希望InstallShield要求您知道C ++运行时的检测规则。 that's a bit odd. 有点奇怪。 There may be another setting where you just say C++ runtime required. 可能还有另一种设置,您只是说需要C ++运行时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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