简体   繁体   English

Visual Studio部署项目:安装目录中的依赖项

[英]Visual Studio Deployment Project: Dependencies in the installation directory

I would like to install an add-on to an application. 我想将附加组件安装到应用程序。 The application does not create a registry key that I can use to locate it. 该应用程序未创建可用于定位它的注册表项。 Therefore the user should specify the directory of the program, the installer should check whether the programs files are in that directory and only if the main program is installed to that directory, install the add-on to that directory. 因此,用户应指定程序的目录,安装程序应检查程序文件是否在该目录中,并且仅当主程序安装到该目录时,才将附件安装到该目录。

Can this be done with Visual Studio's Deployment Project? 可以使用Visual Studio的部署项目来完成吗?

As far as I can see, the VS Deployment Project checks for dependencies only when starting the installer, not after the installation directory has been specified. 据我所知,VS部署项目仅在启动安装程序时检查依赖关系,而不在指定安装目录后检查。 Id like to get a second opinion before starting to use more advanced deployment tools. 在开始使用更高级的部署工具之前,我希望获得其他意见。

No, this is not supported by Visual Studio. 不,Visual Studio不支持此功能。

What you need can be done by using a custom action on the "Next" button of the folder path dialog: http://msdn.microsoft.com/en-us/library/aa368322(VS.85).aspx 您可以通过在文件夹路径对话框的“下一步”按钮上使用自定义操作来完成所需的操作: http : //msdn.microsoft.com/zh-cn/library/aa368322(VS.85).aspx

This custom action can check if the required files exist and set the result in an installer property. 此自定义操作可以检查所需文件是否存在,并在安装程序属性中设置结果。 This property can then be used to condition the "NewDialog" control event which shows the next dialog. 然后,可以使用此属性来调节显示下一个对话框的“ NewDialog”控件事件。 It can also be used to condition another custom action which shows a custom error message. 它也可以用于限制另一个显示自定义错误消息的自定义操作。

If you want a free solution you can try WiX. 如果您想要免费的解决方案,可以尝试WiX。 You should be able to define the custom action and DoAction published control event. 您应该能够定义自定义操作和DoAction发布的控件事件。

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

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