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

4 Ansichten (letzte 30 Tage)
KAE
KAE am 22 Feb. 2019
Kommentiert: KAE am 22 Feb. 2019
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 Kommentare
Walter Roberson
Walter Roberson am 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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by