How to tell how when an executable was first run? (Imposing a 30-day demo period)
조회 수: 1 (최근 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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!