reduced version of full program Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

reduced version of full program

Post by mael15 »

hi,
my program has a lot of features, i.e. it can read and write a certain filetype (only one example of many features). my boss now wants me to create a "reader only" version and prepare the codebase for likely future subsets of the full version.
can anyone point me into the right direction on how to handle this? any best practices or guideline maybe?
i already have some parts in more or less stand alone dlls and think about making those 100% stand alone.
thank you for your ideas/links!
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Re: reduced version of full program

Post by mael15 »

two options:
a) i could have two different compilations, one with a preprocessor definition (i.e. VIEWER) and use #ifdef VIEWER [...] #endif in my code, just like in the wxWidgets source code.
b) two different compilations with partly the same source files but the differences isolated in special source files that are only included in one of the compilations. more like an object oriented approach.
is one of these better than the other? if so, why?
or maybe a third option?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: reduced version of full program

Post by doublemax »

The second solution sounds very impractical.

In general you have two options, do the distinction at run-time or at compile-time. At compile-time it's much easier and safer, the only downside is that you have to generate two executables every time you want to release a new version. As long as you only have two version, that is easy to handle. I once had a case where i had to handle four different versions of my application. Together with separate update-installers for each version, i had to produce a total of eight new installers each time i released a new version. What a nightmare. Since then i prefer a runtime-based solution.

Doing it at run-time is more effort. You could have an external encrypted (licence) file that contains information which features are available. The nice thing about this is that the user can unlock new features without installing a new program, e.g. by entering a licence code.

Alternatively you could have all additional functionality in external DLLs and the main program checks for the presence of these DLLs automatically.

Both methods can be problematic if we're talking about a commercial application, because they can be circumvented easily without a strong code protection.

I assume your read-only version is freeware and the version with write support costs money?
Use the source, Luke!
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Re: reduced version of full program

Post by mael15 »

thank you for your detailed answer!
it is less about freeware and paid-for version in my case, more that my company uses a very specialized program with many features that are confusing to a certain group of clients. some clients only want to review some results of our work (reader version) and do not need the ability to create these results themselves. so i guess there will never be the need to change the amount of functionality after the installation.
i just want to keep the amount of work for me as small as possible, avoid having multiple separate code copies and create these versions in a up-to-date way.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: reduced version of full program

Post by doublemax »

In that case i would definitely do it at run-time. You will have only one executable that contains the complete code and then just hide the parts of the GUI that this user group should not see.

The actual decision can be made based on an .INI file that is installed with the executable and that contains information, which version it should be. Another option is to use different names for the executable itself and check that.
Use the source, Luke!
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Re: reduced version of full program

Post by mael15 »

ok, thank you! i will do it like you proposed. i was thinking about reduceing the file size and not including certain dlls in the stripped back version, but i guess nowadays neither file size nor internet speed (download) are an issue anymore.
i will look for options for implementing a licence functionality and derive from it the program capabilities that will be activated.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: reduced version of full program

Post by ONEEYEMAN »

Hi,
The other alternative is to make a SQLite DB and check if the customer wants read-only version or a full one.
Something like big DB server.

Thank you.
User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 425
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: reduced version of full program

Post by cutecode »

I use "external encrypted (licence) file"
You should write a second program to edit those licences
wx 3.1.6 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Re: reduced version of full program

Post by mael15 »

thank you for your ideas!
i was thinking about something that cannot be copied easily to another computer. most of the time, my software is used with a very unique and expensive hardware that i can read the serial number from. i thought about using this as a dongle and automatically start the full software version if the hardware is found. or maybe only allow using it without hardware only ten times or so until the hardware has to be connected again.
i also am in a unique situation that my company will probably sell 10 devices per year and this includes a laptop to use it. so i could somehow do more complicated things to install a licence than an installer could because i have admin access to the laptop before it is sold.
what do you think?
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: reduced version of full program

Post by eranon »

mael15 wrote:thank you for your ideas!
i was thinking about something that cannot be copied easily to another computer. most of the time, my software is used with a very unique and expensive hardware that i can read the serial number from. i thought about using this as a dongle and automatically start the full software version if the hardware is found. or maybe only allow using it without hardware only ten times or so until the hardware has to be connected again.
i also am in a unique situation that my company will probably sell 10 devices per year and this includes a laptop to use it. so i could somehow do more complicated things to install a licence than an installer could because i have admin access to the laptop before it is sold.
what do you think?
My opinion is that a license locked to a specific hardware is abusive (unless if we talk about firmware, of course), but we can play with the words: "locked activation" is not "locked license". Here is what I do in my apps: the user receives a license informations he can use to install the software everywhere, but after activation (ie. when the input has been checked and validated by the internal logic; locally and/or remotely), the generated files about this license will only work in this unique context (I means even if a cracker succeeds to identify and collect the concerned encrypted, scattered, correlated and dynamic files, he will be unable to reuse them in another context). So, the user can install everywhere, but every installed copies is not transferable. If tomorrow, he changes something in the considered context (you are free to include what you want in this "context", it's up to you), he will have to reactivate from the license informations you gave him initially.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Post Reply