卸载C#应用程序时删除文件 [英] Deleting files while Uninstalling C# application

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

问题描述



我有一个安装项目,可以很好地安装应用程序.我为"CREATE_SHORTCUT"复选框添加了一个对话框,如果选中该对话框,安装程序将在桌面上创建快捷方式.这一切都很好.

我的应用程序在运行时创建了一个文件夹和文件.

卸载应用程序时,不会删除这些文件和文件夹,因此不会从程序文件中删除应用程序文件夹.在自定义操作中,在卸载中,我添加了主要输出..",其中CustomActionData =/ALLUSERS = [ALLUSERS]/CREATE_SHORTCUT = [CREATE_SHORTCUT].这将删除桌面快捷方式(如果已创建).我的问题是,如何删除应用程序创建的文件夹,以便卸载程序也删除应用程序文件夹.

任何帮助都将受到高度赞赏.请尽早帮助我.我还考虑过创建一个bat文件进行卸载,但是那我该如何提供AllUsers和Create Shortcut操作呢?卸载时我的应用程序可以收到通知吗,那时我可以删除设备,然后继续卸载.以上所有内容中可能有什么??

Hi,

I have a setup project that installs the application nicely. I have added a dialog for a checkbox "CREATE_SHORTCUT" and if it is selected the installer creates shortcut on desktop. This all works fine.

My application creates a folder and files during runtime.

While Uninstallting the application, those files & folder are not deleted hence the application folder is not deleted fro mthe Program Files. In Custom Actions, in uninstall I have added "Primary output.." with CustomActionData = /ALLUSERS=[ALLUSERS] /CREATE_SHORTCUT=[CREATE_SHORTCUT]. This removes the desktop shortcut if created. My issue is, how to delete that folder created by app so the uninstaller deletes the application folder also.

Any help is highly appreciated. Please try to help me at the earliest. I also thought of creating a bat file for uninstall, but then how can I provide AllUsers & Create Shortcut actions ??? Can my application get notification while uninstall, I cna delete the fodler at that time and then the uninstall can proceed. What can be possible among all above ??

推荐答案

^ ]


这篇关于卸载C#应用程序时删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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