Archive: Progress message dialog box 'unpacking data' doesnt show before setup loads


Progress message dialog box 'unpacking data' doesnt show before setup loads
Hi there,

I have made an installer which is 50 MB compressed and upon execution it show the message box "please wait while setup is loading... Initilizing setup 15 % "

but the main thing is it doesnt show the other progress message box "please wait while setup is loading... unpacking data 20 % "

My installer takes around 20 secs to unpack and doesnt show this mesaage while unpacking. I know it shows this msg as it showed it in my previous versions but not the latest.

20 secs without anything on the screen by the installer makes people think their system has hanged as mouse moves slowly too due to high CPU usage while unpacking.

For some reason I cant get the Splash screen to work too.

heres my .oninit code :



"Function .onInit
Call CheckSP2

SetOutPath $TEMP
File /oname=splash.bmp "files\data\splash.bmp"

advsplash::show 5000 600 400 -1 "$TEMP\splash.bmp"
Pop $0 ; $0 has '1' if the user closed the splash screen early, '0' if everything closed normal, and '-1' if some error occured.

Push $0

!insertmacro MUI_LANGDLL_DISPLAY

SetOutPath $PLUGINSDIR

WriteINIStr "$PLUGINSDIR\ioFile2.ini" "Settings" "NumFields" "1"

WriteINIStr "$PLUGINSDIR\ioFile2.ini" "Field 1" "Type" "Droplist"
WriteINIStr "$PLUGINSDIR\ioFile2.ini" "Field 1" "Flags" "NOTIFY"
WriteINIStr "$PLUGINSDIR\ioFile2.ini" "Field 1" "Left" "10"
WriteINIStr "$PLUGINSDIR\ioFile2.ini" "Field 1" "Right" "-122"
WriteINIStr "$PLUGINSDIR\ioFile2.ini" "Field 1" "Top" "84"
WriteINIStr "$PLUGINSDIR\ioFile2.ini" "Field 1" "ListItems" "$9"
WriteINIStr "$PLUGINSDIR\ioFile2.ini" "Field 1" "State" "$filename"

File "bassmod.dll"
File /nonfatal "music\*.xm"
File /nonfatal "music\*.mod"

Push "*.xm"
Call ListFiles
Push "*.mod"
Call ListFiles

Call CreateMODPage

Call BASSMOD_Init
Call BASSMOD_MusicLoad
Call BASSMOD_MusicGetName
Call BASSMOD_MusicPlay
FunctionEnd

Function CheckSP2
ReadRegStr $R3 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CSDVersion
StrCmp "$R3" "Service Pack 2" 0 +2
Return
MessageBox MB_OK "You do not have Windows XP Service Pack 2 installed.$\n$\n Make sure to choose the 'Extract Files Only' install type on the components page."
FunctionEnd"


Could someone tell me what to do here?


Using ReserveFile


Could u tell me how to go about it? I saw it in the manual but it kinda confused me.


The splash screen deosnt really matter to me, I just want the inbuilt Progress message box "please wait while setup is loading... UNPACKING DATA 20 %" to come back.

why has that gone away?

Is it because of the new version of Nsis 2.02?


It should show. I don't know why it doesn't show anymore, I'll check it out.

In any case, you really should use ReserveFile so your setup will load faster.


The only part effecting the unpacking data msg box would be in the .oninit function right?

Do you have Nsis 2.0 ? I would like to compile with that.


Yes, .onInit should be the only function that affects the showing of that dialog. NSIS 2.0 can be downloaded from the project page:

http://sf.net/projects/nsis


OK, I have looked at it and found out that everything works as should. When using solid compression, the dialog will show. Solid compression is enabled by default for bzip2 and lzma.

The problem with your script is that you extract very large files in .onInit. That's a bad idea. If you're doing that, you should at least use the Banner plug-in to show a message to the user.


The banner plug in replaces this dialog, but I think as this dialog isnt being shown, it wont show the banner too.

I would still like to have the orignal dialog over the banner as it shows the progress.

Is there a way I can get the dialog back?

and you said having the files unpack at .oninit is a bad idea. Is there a way to change that? like can I have it unpack the selected components only at the install page?


It will show the banner, if you use it.

You can use solid compression (SetCompressor bzip2 or SetCompressor lzma) to get back the dialog.

To unpack the files only in the install page, unpack them in a section. Each visible section is a component in the components page, and only the selected components will execute the code in their sections.


This part of code is already there in my script :

SetCompressor lzma ;7-Zip
SetCompress force
SetDatablockOptimize on
SetCompressorDictSize 64

I do have quite a few sections and Subsections. How do I make it unpack in sections if selected?


Use the File command in the sections to have it unpack the files in the sections. For example:

Section
File test.exe
SectionEnd

Thanx.. will look into implementing that.

But how do I get the splash screen to show up?

What is the reason for that dialog not showing up? If for some reason I cant use the 'file' command with the other command (upgradefile) im already using.


Would using Reservefile get it back or just speed up the loading process?


Just speeds up the loading process as it puts your files at the top of the 'files to extract' list.

-Stu


To get the progress dialog back, you need to use solid compression. You must have overriden the lzma setting later in the script or using MakeNSISw.


Im sure I've not overridden the lzma compression later in the script.

or using MakeNSISw
What did u mean here?

MakeNSISw has an option to override the compression. It is also possible you've downloaded the special build with solid compression disabled. To make sure you haven't, run makensis with the /HDRINFO switch and look for NSIS_BZIP2_COMPRESS_WHOLE. If it's there, you don't have the special build.


I typed makensis /hrdinfo in command prompt got some error.

Or am I doing something wrong here?


It's /HDRINFO not /HRDINFO. You've mised up D and R.


yes 'NSIS_BZIP2_COMPRESS_WHOLE' is there


And what about MakeNSISw? What is set in Tools->Settings?


"defined in script/compiler default"


Did it show the dialog when you tried it with 2.0?


Should I send you my script so you can have a look why the dialog doesnt show? Its quite small, wouldnt take you a minute to go through it.


Yes, but with a slightly different script


Yes, send in the script. I'll the files too so I can compile it.


Do u use msn? I'll send them to you over msn


No. Send to kichik @ users dot sourceforge dot net.


The files are pretty big, and theres more to this before compiling. If we cud do this over and messenger u use, it wud be better.


You could block and delete me right after we get through this.


I don't use it. If it's too big, upload it somewhere or find someway to reproduce it using standard files (include some big DLLs from Windows, for example).


sent ya a PM


It turns out the "unpacking" progress dialog didn't show because of the usage of BGGradient. This happens because the unpacking dialog won't show if the NSIS dialog was already created. The gradient background window pretends to be the dialog for so it can be used as the parent of splash screens. Since it is created before .onInit, anything extract in .onInit won't have the "unpacking" dialog.

I have made the gradient background window stop pretending to be the dialog window. The background window is hidden while processing .onInit anyway so the script can make the installer silent without the window flashing.


kichik, in my installer script I have used the setreboot flag, but even then at the finish page it doesnt show the option to reboot now or later. Could you have a look at it :)


I have already deleted the script, so I can't test it on it. Try creating a minimal example reproducing the example. If you won't find the problem while creating the script, attach it and someone will surely be able to help.