Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29284 Discussions

How to create a trial version of an executable?

Roberto_Soares
Beginner
1,489 Views
Hi,
I have been working on a code thatwillpotentially become a comercial software. I have some key people that need to try the software before the final version is released. How do I protect myself from "giving out" the executable? I am trying to collect information on how to create a trial executable that I could release at first.
Does anybody know how to do that? Any other suggestions are also appreciated.
Roberto
I use VS 2008, Intel Fortran Compiler 11 and Windows XP.
0 Kudos
5 Replies
TimP
Honored Contributor III
1,489 Views
A simple method, if you trust your customers and don't need much security, is to set an expiration date. Use DATE_AND_TIME to check the date. With e.g. a month to go, put up a message saying "trial version, expiration date:... contact ....." and after expiration put up the message but refuse to run.
0 Kudos
Les_Neilson
Valued Contributor II
1,489 Views
Another technique to consider is to offer reduced functionality.
For example if you define a configuration called say TRIAL and within that define a Preprocessor Directive TRIAL then in your code you could restrict the size of certain data arrays, provide reduced functionality etc.:

MaxDataSize = 1000 ! Used to allocate certain arrays
!DEC$ IF DEFINED (TRIAL)
MaxDataSize = 10 !Restrict the sizeof allocatedarrays
!DEC$ ENDIF

Or remove/hide certain functionality; for example the ability to save data

!DEC$ IF DEFINED (TRIAL)
!Show a message saying this function/option not available
!DEC$ ELSE
! normal functionality available
... code ...
call SaveTheData
!DEC$ ENDIF

Building the solution with the TRIAL configuration would then give you a trial exe.

Of course these techniques are notvery secure and can be bypassed by a determined hacker but they are a starting point.

Les
0 Kudos
GVautier
New Contributor III
1,489 Views
Hello

An alternative way is to use an encrypted key in the registry to limit to a certain numbers of days after the first launch for example. You will also in this case be able to renew the trial expiration with an appropriate tool.

It is more flexible but a little bit less safe.
0 Kudos
Roberto_Soares
Beginner
1,489 Views
Thank you for the responses. They all sound like a good plan.Les's idea is a good wy to provide a quick functional software.

Besides, I have been playing with TimP's comments using DATE_AND_TIME, however I noticed that this is the CPU clock, so if I change it, it will reset my trial version. Is there any way to get the system clock or one that can't be changed?

I a little confused with the terms:wall clock, CPU clock, user CPU clock and system CPU clock.
Regarding the last comment on the registry, I believe it is also a promissing additional one, but at this point I have little idea on how to implement it.
Any further comments are appreciated,

Roberto
0 Kudos
TimP
Honored Contributor III
1,489 Views
No, software like Intel licensing which checks to see whether the user has reset the date leads to annoying bugs. For example, under Windows, a mobile computer isn't useable without at least setting time zone when travelling. Probably, going out on the web to check a series of reliable date sources raises other possible bugs, as well as still being vulnerable to hacking.
Commercial licensing schemes where you pay someone else to deal with the issues would be overkill if you are simply trying to help your friendly trial customers.
DATE_AND_TIME accesses the same Windows resources as you will see on your Windows time screen. These are traditionally referred to as "wall clock," as if you started up a clock face applet to represent the electric clock on your office wall (yes, there were such things back when the term originated).
On most Windows computers, there are also a 1024Hz time counter and GetTickCount facilities which aren't useful for getting date or time of day, but can be counted on to proceed at a reasonably constant rate.
There are also accessible timers linked to the memory buss clock, which are useful for timing programs but not for accessing date. The CPU clock on recent platforms is linked to those.
Fortran SYSTEM_CLOCK should give you the best available timer among those, again not useful for getting date or time of day.
0 Kudos
Reply