License File - open file
The license file must be copied to the USB-Stick. There is no modification in the source code necessary to use the USB-Stick protection.
In the PrepareAndCheck command you specify the path and license file name.
A good idea is to ask during installation, if the application should use a USB-Stick and then open a file dialog to browse for the drive. The installer could then copy the file to this folder. Save the path in the registry or configuration file.
If you deliver the USB-Stick, then the file would already be on the USB-Stick. The installer just needs to browse for the drive and does not copy the file.
If the complete application runs on the stick, the path would be the same path where the application starts.
To prevent, that the USB-stick is removed after the program start, make regular license tests, e.g. every 15 minutes.