Archive: Slow display for InstallOptions


Slow display for InstallOptions
Hi,

I am brand new to NSIS.

But I have managed to write a little script in Modern UI format to deploy a few files and write a configuration file (my_app.ini file) accoding to values typed in a configuration window displayed by InstallOptions.

My problem is that there is a delay in displaying that window. When I click next I see the title changing but it takes a few seconds before the window fields display (I am still with the previous window): I must be doing something wrong.

Here are extracts of my code:
- in the Installer Pages
!insertmacro MUI_PAGE_DIRECTORY
Page custom MailOptions
!insertmacro MUI_PAGE_INSTFILES

- in the Main section
StrCpy $cfgINIfile "$INSTDIR\${DS_XFRTFILES_DIR}\${DS_CONFIG_FILE}"
WriteINIStr $cfgINIfile ${DS_CFG_MAIL_SECTION} ${DS_CFG_MAIL_EMAIL} $cfgEmail
... (same for all the fields)
FlushINI $cfgINIfile


- I am in multi-languages, so in .onInit change the labels
!insertmacro MUI_LANGDLL_DISPLAY
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "${DS_OPTION_FILE}"
!insertmacro MUI_INSTALLOPTIONS_WRITE "instOpt.ini" "Field 1" "Text" "$(MO_email)"
... (same for all the labels)

- MailOptions functions
Function MailOptions

!insertmacro MUI_HEADER_TEXT "$(MailOptionsTitle)" "$(MailOptionsSubTitle)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "${DS_OPTION_FILE}"
!insertmacro MUI_INSTALLOPTIONS_READ $cfgEmail "${DS_OPTION_FILE}" "Field 2" "State"
... (same for all the fields)
FunctionEnd



Hopefully somebody will point out what I am doing wrong.
Cheers,
L@u


InstallOption: multi-language + compression = slow
Hi all,

I still have a delay in the display of the extra panel defined by the InstallOption !
I have invistigated a bit further and made a few changes.

I have found that if I delete the lines to change the labels to the chosen language labels and I do not choose LZMA for the compression method, it is normal speed (quasi instantaneous).

I could live without LZMA (although ideally I would lile to keep it), but I need to change the labels to the apropriate language.

At the moment, I change the labels in the functions displaying the extra panel. It looks like this:

Function MailOptions

!insertmacro MUI_HEADER_TEXT "$(MailOptionsTitle)" "$(MailOptionsSubTitle)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "stp_opt.ini" "Field 1" "Text" "$(MO_email)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "stp_opt.ini" "Field 3" "Text" "$(MO_user)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "stp_opt.ini" "Field 6" "Text" "$(MO_pwd)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "stp_opt.ini" "Field 7" "Text" "$(MO_pop)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "stp_opt.ini" "Field 10" "Text" "$(MO_smtp)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "stp_opt.ini" "Field 11" "Text" "$(MO_port)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "stp_opt.ini" "Field 13" "Text" "$(MO_sendto)"
!insertmacro MUI_INSTALLOPTIONS_WRITE !insertmacro MUI_INSTALLOPTIONS_DISPLAY "stp_opt.ini"
!insertmacro MUI_INSTALLOPTIONS_READ $cfgEmail "stp_opt.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $cfgUser "stp_opt.ini" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $cfgPwd "stp_opt.ini" "Field 5" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $cfgPop "stp_opt.ini" "Field 8" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $cfgSmtp "stp_opt.ini" "Field 9" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $cfgPort "stp_opt.ini" "Field 12" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $cfgTo "stp_opt.ini" "Field 14" "State"
FunctionEnd
May be I should do it somewhere else to get a quicker display ?


Thanks in advance for any help,
L@u

You should ReserveFile the INI file on the top of the script and also the InstallOptions.dll plug-in, as instructed in the MUI readme.


Thanks for your answer.
I have now added the plugin which was missing for some reasons (I did have the ini file and language dialog) ... but that didn't change a thing: there's still a delay in displaying the option panel ! !

Any other ideas ? ! ?

Here is my Reserved file section:
Quote:


Cheers,

# Reserved Files
ReserveFile "stp_opt.ini" ; My INI file for the Mail Options panel
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in
!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
ReserveFile "${NSISDIR}\Plugins\AdvSplash.dll"

Where did you use ReserveFile? Is it on the very top of the script? It'd be simpler to tell what's wrong with the entire script.


Here are the files
Hi,

The files are reserved at the beginning of the script.

In the attached zip file, I have included the two files, used to create the setup.exe file:
- setup.nsi
- setup_option.ini
I have also added a dummy mail_files.vbs that will always display a "Config OK !" message, so you can run the install without any problems.
The real one checks the config, setup scheduler jobs, and mail files to support team.

Of course, you may use any file instead of setupFilesXfrt.exe


Thanks again for any help,


There's no attachment. Try again. Notice the attachment is gone when you click Preview.


Sorry
My mistake !

I didn't notice the Preview problem.
Here it is again.


I get the same relative slowness with or without the writing of the LangStrings. If it's slower for you with the LangStrings, you can write them in .onGUIInit. The language tables are initialized at that point and it's only called once. Define to MUI_CUSTOMFUNCTION_GUIINIT to tell the MUI to call your custom .onGUIInit function.


Houraa !

Thanks a bunch ! !

Yep, that did it !

BUT (they're always a but ;-) and I tend no to complain much about buts ;-) ! ), there's still a delay if I turn the LZMA compressions on (line 5 of the program) !
If I comment out this line (then using the "standard" decompression) there is no delay as soon as I use LZMA, there is a delay again !

Any ideas on that, anyone ?
Although, it might seem not that important, but with my actual files, it's 150kb difference and with satellite connection, that makes a huge difference.


Cheers,


I get the same delay with or without lzma. You are still talking about the custom page, right? The only compression related possible delay I can see is with .onInit and TheCompany.bmp which is not reserved.


Yes, I was talking about the custom page !

And Yes, that did it! Still, I don't understand why not "reserving" the splash screen file which is used at the very beginning of the program will delay the display of the InstallOption (aka custom) page ? ! ?

But thanks a lot !
I am now an happy bunny !
I suppose I should be grateful you came back from your 6 month "walkabout" just in time to fix my problems. ;-)

Thanks again,