使用 VS 的安装项目时如何在安装文件之前执行自定义操作? [英] How to execute custom action before installing files when using VS's Setup Project?

查看:56
本文介绍了使用 VS 的安装项目时如何在安装文件之前执行自定义操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的 VS 安装项目.在第一个屏幕上,用户输入数据库名称和凭据以访问它.然后用户单击下一步"按钮并复制文件.我想添加一项检查,应该在用户键入数据库名称和凭据之后,但在复制文件之前执行.此检查应命中数据库并验证一些信息.并且根据此检查的结果,安装将继续或中断.

I have a simple VS setup project. On the first screen user inputs database name and credentials to access it. Then user clicks 'Next' button and files are copied. I would like to add one check which should be executed after user typed database name and credentials, but before copying files. This check should hit the database and verify some info. And depending on the result of this check installation will be continued or interrupted.

我该怎么做?是否可以使用 VS 安装项目来完成?

How could i do it? Is it possible to do it using VS setup project?

谢谢

推荐答案

我发现在使用 VS 的安装项目安装文件之前无法执行自定义操作.这是因为 VS 的安装项目首先复制文件,然后执行自定义操作.这是设计使然.这就是为什么我决定创建一个带有设置界面和所需行为的小型 winforms 应用程序.

I've figured out that it is impossible to execute custom action before installing files using VS's setup project. This is because VS's setup project copies files at first and after that executes custom actions. This is by design. That's why I decided to create a small winforms application with setup's interface and required behavior.

这篇关于使用 VS 的安装项目时如何在安装文件之前执行自定义操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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