Archive: Dialog


Dialog
I'm translating some old WISE installers to NSIS. I want to show a dialog from within an install section, e.g. asking a user if they want to allow the setup to manipulate certain files that are outside of the installed application's main directory, and then return to the installation progress display. In WISE, this works as expected just by popping up the dialog.

I've got the display part working just fine in NSIS with InstallOptions calls, but the next\back\cancel buttons (and even the Windows minimize\maximize\close buttons) are all disabled. Consequently the installer simply freezes when I display the dialog, and I have to kill it through the task manager.

Is what I'm trying to do even possible with NSIS, or is it something that is in the works (if it isn't already, it should be)?


asking a user if they want to allow the setup to manipulate certain files that are outside of the installed application's main directory, and then return to the installation progress display
Are these questions have a YES or NO (or similar) as awnsers?

If so, did you try MessageBox instruction from NSIS?

I tried message boxes. Unfortunately, the text is too large, making the pop-up come out too wide and ugly, and the user input capabilities and limited to yes\no type button clicking. Thanks for the suggestion, but I'll pass.

What I want to do is display simple ini-based dialogs that allow you to capture user input in multiple ways. I've worked around it for now by changing the flow of my setups so the dialogs pop up before the instfiles pages start, and I just save the user's selections for the appropriate sections. But this changes makes the scripts difficult to read. I was just looking for a way to simplify things.

I also tried using GetDlgItem and EnableWindow to turn the "Next" button back on. It worked, but when I clicked "Next", the entire setup application just crashed and closed with no error and without actually going to the next page.


InstallOptions to create customized dialogs. Read the docs about them.

They are easy...
What are you using modern or classic UI?
You can use pre, show or leave to add your dialog...


Again my friend I've already tried it. Reading the docs was the easy part (I work in the software industry, and we have customers that don't read the docs before asking questions, so I know how frustrating it is). The problem is with actually using InstallOptions from within a page that is already being displayed. It doesn't change/maintain state properly.

When I display a dialog using InstallOptions from within a section DURING the instfiles page (ie, display a dialog using InstallOptions::display between a "Section" and it's matching "SectionEnd") I have multiple problems. The back\next\cancel buttons are disabled, as well as the Windows (maximize\minimize\close) buttons in the top right, thus the setup freezes and can no longer move forward and must be killed through TaskManager. But if I use GetDlgItem and EnableWindow to force the "next" button to be operational, clicking it causes the setup application to crash with no warning.

It just makes sense to pop up complicated dialogs at certain times to give the user a robust interface with which to decide what to do. For example, if an install section is supposed to copy files into a directory for another application and it can't find that application's root directory (missing registry keys, etc) and you want to show a directory browsing dialog. You can argue that it makes more sense to show these dialogs before the instfiles page starts up, but in some cases (hopefully a large percentage of the time in the previous example) you'll skip the page, which means you'll skip the page (again, hopefully a large percentage of the time in the previous example) that shows the "Next" button as "Install". Putting the dialogs after the install sections just means that your progress bar no longer accurately reflects what you're doing because you'll be copying and installing files after the progress bar says you're done.

I'll admit that I could be severely abusing the concepts of NSIS, but I still think it should be possible to display a dialog, not just a messagebox, from within an install section. I would like to see the issue addressed since other people can benefit from a more robust installer. But like I said, for now I have a work around however illogical the page order may seem to me.


InstallOptions is designed to work with the Page command, not inside sections. The idea is that you collect all required information before the installation begins and don't stop to ask questions once the installation begins. This also makes it much easier to support silent installation.

But, if you really want to show an InstallOptions page in a section, a modification of InstallOptions that allows it is available. I'm pretty sure someone wrote one once and posted it on the forum, but I can't find it right now. I'll let you know if I find it.


Like I said, I may be abusing the concepts of NSIS.

It does make it easier to support silent installers, but some developers may not be looking for that. The main reasion behind the project I'm working on (translating WISE to NSIS) is to make our installers prettier (take that as a compliment). But silent doesn't really help that, does it? ;)

I say more support for more functionality, but I also know that in the end it's all left up to the whim of what you've got time for. I think I'll just stick with what I've got for now, and maybe if revisit the issue if I ever to need to modify the installers again.

Thanks for your help, and keep up the good work.


You can use InstallOptionsEx (link on my signature). It has a control called "ProgressBar" which you can use until I or kichik can verify it. It's on beta, so I'll be not responsible for problems.