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

4 vues (au cours des 30 derniers jours)
KAE
KAE le 22 Fév 2019
Commenté : KAE le 22 Fév 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 commentaires
Walter Roberson
Walter Roberson le 22 Fév 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.
KAE
KAE le 22 Fév 2019
That's a good idea!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by