Inno Setup:如何处理[UninstallDelete]部分上的进度条? [英] Inno Setup: How to handle progress bar on [UninstallDelete] section?

查看:434
本文介绍了Inno Setup:如何处理[UninstallDelete]部分上的进度条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Inno Setup为我的应用制作安装程序.当用户卸载应用程序时,我想删除Program Data文件夹中的自定义文件夹,我的文件夹很大(大约15 GB),因此我使用[UninstallDelete]部分删除了该文件夹:

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"

但是,当Inno Setup进入[UninstallDelete]部分时,进度条将显示为20%,并在该位置停止很长时间,然后它会跳动"到100%.
那么,如何在卸载应用程序时使进度条稳定增加?
谢谢!

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!

推荐答案

我认为这真的不可能.

如果不大大延长操作时间,则无法预测删除将执行多长时间.您将必须提前计算文件的数量,然后将其一一删除,然后计算进度.但是对文件进行计数也可能会花费大量时间.因此,它对您没有太大帮助,实际上可能会使情况更糟.计算时,安装也将卡住(您无法完全预测会花费多长时间).

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).

尝试在Windows File Explorer中删除(而不是回收)文件夹.并检查操作处于计算" 阶段的时间.

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

在我的测试中,删除时间花费了1/3.

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

您可以显示不确定/选取框的进度条(即像上面的Explorer一样),而不是尝试显示真实的进度.也许显示一些已删除文件的数量,以使用户可以看到有进展.

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...


您的后续问题:
Inno设置-卸载时进度条不显示


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

这篇关于Inno Setup:如何处理[UninstallDelete]部分上的进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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