c# msi setup - 安装前自定义验证

发布于 2024-10-06 20:45:49 字数 131 浏览 0 评论 0原文

自定义 UI 调用 Web 服务。如果 Web 服务批准安装继续,否则将向用户显示安装无法继续的消息。

使用 Visual Studio 安装和部署项目。尝试添加自定义操作,但它始终在安装过程后执行。

我该怎么办呢。

The custom UI calls a web service. If the Web Service approves the installation continues, else some message is displayed to the user that the setup cannot continue.

Using Visual Studio setup and deployment projects. Tried adding a custom action but it always executes after the install process.

How should I go about this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心的憧憬 2024-10-13 20:45:49

我猜测网络服务会验证安装过程中输入的许可证密钥。程序第一次运行时可以进行密钥验证吗?它可能会帮你省去一些麻烦。

如果失败,请查看 Installer 类的 BeforeInstall 事件。此操作在收集所有信息之后、实际安装开始之前执行;放置复制文件之前必须执行的代码的完美位置。如果您需要执行这些文件或其他设置才能调用 Web 服务,请尝试使用 BeforeCommit(如果验证失败,它仍然允许您回滚安装)。

I'm guessing the web service validates the license key entered during install. Could you perform the key validation when the program is first run? It might save you some headaches.

Failing that, look at the BeforeInstall event of the Installer class. This executes after all information is gathered, but before the actual installation starts; the perfect place to put code that must execute before copying files. If you need those files, or other setup, to be performed in order to call the webservice, try using BeforeCommit (which still allows you to roll back the installation if validation fails).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文