Inno Setup: How to handle progress bar on [UninstallDelete] section?

南笙酒味 提交于 2019-12-08 02:49:46

问题


I use Inno Setup to make installer for my app. When user uninstall the app I want to delete my custom folder in Program Data folder, my folder is large (about 15 GB) so I use [UninstallDelete] section to delete this folder:

[UninstallDelete]
Type: filesandordirs; Name: "{commonappdata}\testFolder"

But when the Inno Setup gets to the [UninstallDelete] section, the progress bar is show at 20% and stop in this position for a long time, then it "jumpy" to 100%.
So how to make progress bar increase steadily when uninstall the app?
Thanks!


回答1:


I do not think it's really possible.

There's no way to predict how long the deleting will work without prolonging the operation considerably. You would have to count the number of the files in advance and then delete them one by one, calculating the progress. But counting the files will likely take considerable time too. So it won't help you much, it might actually make it even worse. And the installation will get stuck too, while calculating (you cannot predict at all how long will that take).


Try to delete (not recycle) the folder in Windows File Explorer. And check how long the operation is in the "Calculating" phase.

In my test, it took 1/3 of the deleting time.


Instead of trying to show a real progress, you can display an indefinite/marquee progress bar (i.e. like Explorer does above). And maybe display a count of deleted files to allow the user see, that something is progressing.


I actually do not think, you need to make the uninstallation user experience that good. What about only showing message saying:

This may take few minutes...


Your follow up question:
Inno setup - Progress bar doesn't show when uninstall



来源:https://stackoverflow.com/questions/56662246/inno-setup-how-to-handle-progress-bar-on-uninstalldelete-section

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!