I am creating a setup project for a windows application where I have added customer information form with license key to enter, now I would like to make api call for this license and validate it against the database value and if it was validate I need to continue installation. Is there any possibility to do this I have gone through the custom actions but didn't get how to proceed
1 Answers
Custom Action: You need to use a custom action to do custom logic like that, but those are complicated and you expose a license validation method that is easy to crack I suppose.
Application Launch: Please have a read of: Reasons to put license validation in the application and not the setup
. There are many reasons to eliminate complexity in the form of custom actions from setups for reliability-reasons. Please skim this propaganda against custom actions (at least the first summary section).
Overall: Application code is easy to debug, custom actions are VERY exotic to learn to do right - due to complex sequencing-
, conditioning-
and impersonation
issues and overall poor debugability. In the application you are in a familiar debugging context. VERY important
.
Getting started with Visual Studio Installer Projects: Here is a good, but age-old article with a section on custom actions: https://www.red-gate.com/simple-talk/dotnet/visual-studio/getting-started-with-setup-projects/ - and here is one more from CodeProject and a third one.
Alternatives: Why you should not rely on Visual Studio Installer Projects for serious setups (IMHO): Visual Studio Publish Project Into One Simple Installer (Painter's nice condensed-list).

- 39,960
- 25
- 91
- 164