Application, First Launch: Many deployment guys tend to recommend putting licensing in the application itself - on first launch. There are many reasons, and here is an attempted explanation: Installer with Online Registration for Windows Application.
Custom Actions: Custom actions are used to do unusual or proprietary stuff in an MSI setups. Custom actions are legendary for being very difficult to get right and reliable due to the overall complexity of MSI and the complexity of deployment overall (section "The Complexity of Deployment"
). Essentially custom actions are complex with sequencing-
, conditioning-
and impersonation issues
and overall poor debugability
.
Bottom Line: When you implement logic in your application launch code you are in familiar territory with no impersonation or debugging difficulties to deal with. Much easier to develop. Much easier to debug and maintain.
Per-User Licensing: The challenge is that your application must write to HKCU or the user profile - unless it runs elevated with admin rights. I prefer licensing to be done per-user, potentially allowing the license to roam with the user. Or to use an online licensing approach with licensing set up once over the wire. For example by a login approach to the application. You log into an online service and all licensing is part of that.
P.S: It is possible to apply ACL changes to HKLM allowing a non-elevated application to write a license key to HKLM. Possible, not a recommendation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…