开发者

c# msi setup - Custom Validation before installation

开发者 https://www.devze.com 2023-01-29 18:59 出处:网络
The custom UI calls a web service. If the Web Servic开发者_StackOverflow中文版e approves the installation continues, else some message is displayed to the user that the setup cannot continue.

The custom UI calls a web service. If the Web Servic开发者_StackOverflow中文版e 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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消