- NSIS Discussion
- Progress message dialog box 'unpacking data' doesnt show before setup loads
Archive: Progress message dialog box 'unpacking data' doesnt show before setup loads
evilvoice
19th November 2004 02:51 UTC
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?
bluenet
19th November 2004 06:45 UTC
Using ReserveFile
evilvoice
19th November 2004 10:11 UTC
Could u tell me how to go about it? I saw it in the manual but it kinda confused me.
evilvoice
19th November 2004 10:38 UTC
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?
kichik
19th November 2004 11:39 UTC
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.
evilvoice
19th November 2004 11:56 UTC
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.
kichik
19th November 2004 12:01 UTC
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
kichik
19th November 2004 12:47 UTC
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.
evilvoice
19th November 2004 13:25 UTC
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?
kichik
19th November 2004 13:30 UTC
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.
evilvoice
19th November 2004 14:04 UTC
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?
kichik
19th November 2004 14:31 UTC
Use the File command in the sections to have it unpack the files in the sections. For example:
Section
File test.exe
SectionEnd
evilvoice
19th November 2004 19:13 UTC
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.
evilvoice
19th November 2004 19:15 UTC
Would using Reservefile get it back or just speed up the loading process?
Afrow UK
19th November 2004 19:48 UTC
Just speeds up the loading process as it puts your files at the top of the 'files to extract' list.
-Stu
kichik
19th November 2004 20:03 UTC
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.
evilvoice
19th November 2004 20:16 UTC
Im sure I've not overridden the lzma compression later in the script.
or using MakeNSISw
What did u mean here?
kichik
19th November 2004 20:19 UTC
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.
evilvoice
19th November 2004 20:50 UTC
I typed makensis /hrdinfo in command prompt got some error.
Or am I doing something wrong here?
kichik
19th November 2004 20:53 UTC
It's /HDRINFO not /HRDINFO. You've mised up D and R.
evilvoice
19th November 2004 20:59 UTC
yes 'NSIS_BZIP2_COMPRESS_WHOLE' is there
kichik
19th November 2004 21:11 UTC
And what about MakeNSISw? What is set in Tools->Settings?
evilvoice
19th November 2004 21:24 UTC
"defined in script/compiler default"
kichik
19th November 2004 21:33 UTC
Did it show the dialog when you tried it with 2.0?
evilvoice
19th November 2004 21:33 UTC
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.
evilvoice
19th November 2004 21:34 UTC
Yes, but with a slightly different script
kichik
19th November 2004 21:39 UTC
Yes, send in the script. I'll the files too so I can compile it.
evilvoice
19th November 2004 21:42 UTC
Do u use msn? I'll send them to you over msn
kichik
19th November 2004 21:44 UTC
No. Send to kichik @ users dot sourceforge dot net.
evilvoice
19th November 2004 21:50 UTC
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.
evilvoice
19th November 2004 21:52 UTC
You could block and delete me right after we get through this.
kichik
19th November 2004 21:55 UTC
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).
evilvoice
19th November 2004 22:13 UTC
sent ya a PM
kichik
20th November 2004 15:21 UTC
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.
evilvoice
28th November 2004 01:25 UTC
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 :)
kichik
30th November 2004 18:58 UTC
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.