I'm doing my first NSIS script but i found a bump in the road. In fact i think is hard to explain only in the title, (maybe someone can help with that to) so let me explain fully:
I'm creating a installer that uses a few custom pages because i want the user select some options first (it uses nsDialogs), and depending of that do some tweaks in the with installation path (mostly autodetect it because it could depend to other things). All of this is working fine.
In some cases of that options, between checking if some files exists, it hash a file to look if the file is the one it expects (because it's going to patch it with a delta later). I used Crypto plugin or MD5 plugin, both are fine and both do what i want, but they hang the installer for a while (a second or so), i suppose because the file is a little big (it's about more than 100MB) and near that is the issue.
Normally in these cases, you select the option, goes to the next (custom) page, and in the creator function of the custom page autodetects the folder, and it directly do the file checks and when is checking the file hash, it hangs for a second and continues, but all this time hanged it only shows a blank page, because it didn't reach yet in the creator function the nsDialogs::Show instruction to show the window content. In that page you can change the folder, and if it's the case, once is changed it runs the checks again (it's a dedicated function that was called in both cases) and hangs again for a bit, but then the window shows everything and i can set a text to say something (in fact, it is what i did first), but with that automatic first time i can't do this.
That's the point: how to show something to the user to aware them about the installer is doing the hash calculations, instead showing only a blank window.
What I have tried or thought to do:
- With nsDialogs, because it did the calculations first and didn't reach the nsDialogs::Show until later, i can't display anything in the window at that point (or, at least, is what i read in all the documentation i found about that). And, like the documentation says and it was tested, everything you put after the nsDialogs::Show instruction is executed when you push the next or back button.
- Seeing that with nsDialogs at first not seems the way to go, i was searching if it's possible to show a window above the installation window (something like a MessageBox) and close it automatically, before and after the hash calculation respectively, showing only a text with a "Please wait" or kind of. But i didn't find a way to do it.
- Maybe with a timer and do the checks a few miliseconds after could be done, but it seems to me a very cheap way to do it with some issues waiting to happen, mostly because depends of the machine speed, something i could do only in a last resort if it makes to show first the window with nsDialogs::Show, and later execute the check files with a timer. But, i want to do the checks as the folder is set because that function enables the "Next" button and i want that as soon as is possible, and adding timers to this doesn't look right.
- Or is other more stylish way to do this but i didn't figure it out yet.
if it is not well understood the topic, i could add a little example tomorrow created from scratch to show this, because my main test is so big that is not point to paste all of that here.
Thanks!
Aucun commentaire:
Enregistrer un commentaire