Old 28th October 2004, 20:32   #1
ookami
Junior Member
 
Join Date: Oct 2004
Posts: 4
Send a message via AIM to ookami
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)?
ookami is offline   Reply With Quote
Old 28th October 2004, 22:42   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Quote:
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?


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 29th October 2004, 13:39   #3
ookami
Junior Member
 
Join Date: Oct 2004
Posts: 4
Send a message via AIM to ookami
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.
ookami is offline   Reply With Quote
Old 29th October 2004, 14:15   #4
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
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...


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 29th October 2004, 15:29   #5
ookami
Junior Member
 
Join Date: Oct 2004
Posts: 4
Send a message via AIM to ookami
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.
ookami is offline   Reply With Quote
Old 29th October 2004, 17:18   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 29th October 2004, 18:48   #7
ookami
Junior Member
 
Join Date: Oct 2004
Posts: 4
Send a message via AIM to ookami
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.
ookami is offline   Reply With Quote
Old 29th October 2004, 21:53   #8
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
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.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump