自毁应用程序 [英] Self-destructing application

查看:160
本文介绍了自毁应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

沿着的路线这个磁带将在五秒内自毁。祝你好运,Jim ...

它会不会一旦达到预设的使用时间或其他条件,应用程序是否可以删除自身(或它的可执行包装形式)?

Would it be possible for an application to delete itself (or it's executable wrapper form) once a preset time of use or other condition has been reached?

或者,还有什么其他方法可以用于使应用程序无用吗?

Alternatively, what other approaches could be used to make the application useless?

这里的目标是让测试版到期,邀请用户获得更新的版本。

The aim here is to have a beta expire, inviting users to get a more up-to-date version.

推荐答案

这是可能的。为了解决JAR文件的锁定问题,您的应用程序可能需要生成后台进程,该进程在删除内容之前一直等待JVM退出。

It is possible. To get around the lock on the JAR file, your application may need to spawn a background process that waits until the JVM has exited before deleting stuff.

但是,这不是'防弹。有人可以安装应用程序,然后将安装的文件和目录设置为只读,这样您的应用程序就无法自行删除。通过操作系统访问控制系统的用户(或他们的管理员)对创建和删除的文件有最终决定权。

However, this isn't bomb-proof. Someone could install the application and then make the installed files and directories read-only so that your application can't delete itself. The user (or their administrator) via the OS'es access control system has the final say on what files are created and deleted.

这篇关于自毁应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆