How to tell how when an executable was first run? (Imposing a 30-day demo period)

4 views (last 30 days)
I made an executable of some Matlab code using the Complier. I would like the executable to stop working after a 30-day demo period, so one simple approach is using clock to check how much time has elapsed since the date when the executable was first run. But that's the problem: Is there a way in Matlab to tell when the executable was first run? I could save a local binary file (demo_start_time.bin) containing the date on the first execution of the code, then each code execution would look for this file to avoid overwriting it and read it in to find out the original start time. But is there a better way? It's acceptable if the demo lockout could be tricked with a little ingenuity, such as changing the computer clock or deleting demo_start_time.bin.
  2 Comments
Walter Roberson
Walter Roberson on 22 Feb 2019
MATLAB Compiler creates an executable that self-extracts into a temporary directory. When the MATLAB level code runs, the default directory is the directory extracted into. You could check the creation date of that directory.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!