I want to create self deleting dart executable compiled with dart2native. I was able to do it in java but when trying to do it in dart compiled to native binary, the following error appears:
FileSystemException: Cannot delete file, path = 'C:\Users\user\Desktop\Dart\self_relocation\test.exe' (OS Error: The process cannot access the file because it is being used by another process.
I understand why it doesn't work but I know that it's possible to do it in java, c++, c or even c#. Is there any way to do it only in dart ? I want to avoid making external scripts.