I want to start these articles with a small disclaimer: This project is only meant for teaching purposes, this is not the most secure way to handle licenses in your installer. Ideally this must be handled from the application itself, not the MSI. Use at your own risk, I will not be held responsible for any “breaches” in your installers.
From my point of view, the best way to validate your product is to implement a check directly into the application and add the registration to be online. That way, you are sure that all the licenses you provide are secure on a database and breaches are less likely to occur.
In the first part of the series, we had a look over the license generator, in the second part we had a look on how a decrypt DLL for the MSI can be created, now let’s have a look on how you can actually use them in your MSI.
I opened up the license generator and generated a single key for the example:
With this, I created a new project and added new Property in the MSI called LICENSEKEY. This will get the value that our generator created.