We have a library created as both .lib and .dll (it’s a big library which is written completely in C++ for the windows platform). The users can use the library in their programs or libraries or in whatever the they want to use it.
But I want to restrict some of the functions to some of the users.
For example lets say,
- Our library has 3 functions
foo(),bar()andhoo(). - User A pays for the functions
foo(),bar()andhoo(). - User B pays for the functions
bar()andhoo().
So, when we are giving B the library files (headers/libs/dlls, etc.),
- We can create a copy of our library and delete foo() function and its related stuff and send it to B
-
OR we can send him the whole library, with some-kind of a way to block him from using
foo().- 1st way is not good because it’s a huge work and have to be careful about dependencies. Even if we know for sure that
bar()andhoo()is not depending onfoo(), still it’s a headache to remove things, and give them a customized version of the lib which will also include more testing. And maintenance will be even more problematic. And the SVN will be chaotic too. - 2nd way is the best method i guess. But how to do it?
- 1st way is not good because it’s a huge work and have to be careful about dependencies. Even if we know for sure that
And what if B pays for foo() functions later? Then I would have to let him use it.
I guess that now you understand the problem. The two ways are just my opinions and maybe my conclusions on them could be wrong too. So, I am asking if anyone has any ideas/suggestions on this matter.
I would just create one version of the
.dllincluding headers and let the user download the import libs for what he has paid for. For everything else, a lawyer is the best tool.Someone buys an additional module? Let them download the additional import lib.
Any kind of protection/lock (whether it’s a simple check for the
has_paidboolean, a public key scheme, or a proxy library) that you build in can be circumvented. Some are more trivial to bypass, some are a bit harder.By not giving them the necessary import libraries for, say, module
foo, you give a gentle hint to the honest customer.Will some people still cheat you for your money? Of course they will (if your product is interesting enough), but these people would do that either way. They might as well pirate the complete package from the beginning. They’re the kind of people who wouldn’t pay for your product anyway. That’s where you use a lawyer.
Will the majority of people cheat you for your money? Unlikely. The people who are willing to pay for your product are unlikely to cheat you for half of the license fee, at least intentionally. It’s a small gain for a large risk. You could rather easily find out that someone is cheating you.
They’re people who have an identity, and they have something to lose. They would not want to be involved in a lawsuit costing a few hundred thousand (which means losing their assets), nor have the negative publicity involved.
It might only happen unintentionally, but since you’re not shipping the necessary import libs, that’s not possible.
You can see your users, in a very simplified manner, as one of three categories:
foolicense, thebarlicense would cost us another 500. You know that we’re using your library, since we boughtfoo. And we know that you know. A lawsuit would cost us approximately 50,000 — oh shit, let’s rather pay an extra 500.The first two have something to lose, the third one doesn’t. The first two will pay you and won’t (intentionally) cheat you. The last one you couldn’t care about less.