简体   繁体   English

安装程序自定义操作

[英]Installer custom Actions

如何在Unistall的“应用程序启动路径”(程序文件)中删除应用程序创建的所有文件夹。

Be careful also with deleting folders. 删除文件夹时也要小心。 What if some user just installs your program into C:. 如果某些用户只是将您的程序安装到C:中,该怎么办。 Do you clean up his whole drive afterwards? 之后,您清理他的整个驱动器了吗?

You don't really need to, the uninstall will keep a log at install and do this for you. 您实际上并不需要,卸载将在安装时保留日志,并为您执行此操作。

However I guess you're pointing out that it won't delete things that it didn't install in the first place. 但是,我想您指出的是,它不会删除最初未安装的内容。 On that basis you should override the rollback / uninstall methods on your custom Installer class and write code that looks for and removes stuff that was created since the install (possibly by your application). 在此基础上,您应该在自定义Installer类上覆盖回滚 / 卸载方法,并编写代码来查找和删除自安装以来创建的内容(可能由您的应用程序创建)。

Be aware though that even with this approach, you might find it tough to make sure the folder (with the uninstall log) is removed totally. 请注意,即使使用这种方法,也可能很难确保完全删除文件夹(带有卸载日志)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM