How to tell how when an executable was first run? (Imposing a 30-day demo period)
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2019-2-22
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.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!