- NSIS Discussion
- Problem with the banner !
Archive: Problem with the banner !
arfgh
18th January 2008 02:04 UTC
Problem with the banner !
Hi
i am still having visual problems using the banner plugin.
I have all the code into the .oninit
algo i use the getparameters function.
The problem is when i try tos how the banner, other nsis internal banner appears, and cause a so bad effect.
This internal banner tell something called "unpacking" or some like that.
The problem not appears if the main installer not size so much.
Please, can someone give a solution to make possible this nsis internall banner not appears ?
thx
kichik
18th January 2008 10:33 UTC
Make sure .onInit is defined on the top of the script.
arfgh
18th January 2008 14:05 UTC
yes, it is
this problem with the banner come from older nsis versions too. I detect it one year ago.
And the problem of this internal banner is to cause a so bad effect, especially if we use the banner plugin.
Also i forgot to tell i am using lzma /solid compression.
I am sure must exist some way to prevent this internal banner to appears, but how ?
kichik
18th January 2008 14:09 UTC
.onInit must be on the top of the script to get rid of the internal banner. The internal banner is displayed when decompression has to be done before the installer is shown. This can happen when you're using solid compression and .onInit has to decompress files that don't belong to it from the solid block before it reaches the plug-ins/images/other files it needs. For example, the following script will trigger this banner.
Section
File large_files\*
SectionEnd
Function .onInit
Banner::show test
FunctionEnd
To get around this, put .onInit before any other sections or instructions that may add content to the data block or use ReserveFile to make sure the files needed by .onInit are at the beginning of the data block.
arfgh
18th January 2008 14:15 UTC
ok. This is how i have the nsis script...
Name blabla
!addplugindir blabla
OutFile blabla
SetCompressor /SOLID lzma
SetDatablockOptimize on
Icon blabla
InstalldirRegKey blabla
Function .onInit
Banner::show /NOUNLOAD blabla
Banner::getWindow /NOUNLOAD
Pop $0
Call showme
newadvsplash::show /NOUNLOAD 2000 0 500 -1 /BANNER blabla
Quit
FunctionEnd
Section
SectionEnd
Function showme
blabla...
FunctionEnd
Function GetParameters
blabla..
FunctionEnd
the section if empty, because i not need it.
the function called showme is to reposition the banner over the image the newadvsplash show
kichik
18th January 2008 14:23 UTC
A stripped down script can't help here. The details which you've replaced with "blabla" are exactly the required details. Make sure everything you extract in anything that runs during .onInit is at the top of the data block with ResreveFile.
arfgh
18th January 2008 14:27 UTC
you mean, i must specify all the files to extract on the top of the script ?
kichik
18th January 2008 14:33 UTC
Only the files you need in .onInit and functions called by it. Remember this includes plug-ins.
arfgh
18th January 2008 14:35 UTC
and this is the only possible way to disable the internal nsis banner to appears ? How is possible ? I thought exist soem procedure to disable it...
kichik
18th January 2008 14:40 UTC
You can also use non-solid compression.
arfgh
18th January 2008 14:41 UTC
yes i see that. The solid is who cause the anomaly. Who knows why. But i insist, must exist a way to prevent that to appears...
kichik
18th January 2008 14:46 UTC
Solid compression triggers this for the reasons explained above. If you use file B that was compressed after file A in a code that runs before A was decompressed, both files must be decompressed before you can get to B.
arfgh
18th January 2008 14:48 UTC
you mean... if i use the files by order, the internal banner not will come ?
kichik
18th January 2008 14:50 UTC
Yes. That's what ReserveFile and putting .onInit on top are for.
arfgh
18th January 2008 15:29 UTC
i am trying the Reversefile and at time i not got success. The internal banner still comes.
Also i found other solution. Is insert all the code into he Section and leave the .oninit. Then with the command "hidewindow" we can hide the installer screen, but the problem is that cause a popup. I mean the installer is showed, and then is hide. Is other ugly effect.
arfgh
27th January 2008 14:42 UTC
Hey
i used the Reservefile command to reserve these files and prevent the installer show the ugly "upacking data" banner.
But i not got success.Somebody know a good way to prevent this banner to appears ? I need to use the /SOLID lzma compresion..
kichik
27th January 2008 17:51 UTC
This is the only way. If it doesn't work, attach the script that exhibits the issue.
arfgh
30th January 2008 13:16 UTC
ok, this is whole script
The internal makensis banner always appears on this part:
Delete $INSTdir\blabla.gif
Banner::show /NOUNLOAD 'BlaBla'
Banner::getWindow /NOUNLOAD
Pop $0
Call showme
newadvsplash::show /NOUNLOAD 2000 0 500 -1 /BANNER
The whole script
Name 'blabla'
!addplugindir 'C:\blabla\blabla'
OutFile 'C:\blabla.exe'
SetCompressor /SOLID lzma
SetDatablockOptimize on
Icon 'C:\blabla.ico'
InstalldirRegKey HKLM \
'Software\Microsoft\blabla\blabla\blabla' \
'blabla'
Function .onInit
Call GetParameters
StrCmp $2 'blabla' 0 +6
SetOutPath '$INSTdir\blabla\blabla'
File '/oname=blabla.bmp' 'C:\blabla.bmp'
File /oname=blabla.txt 'C:\blabla.txt'
Quit
Delete '$INSTdir\blabla\blabla.*'
SetOutPath '$INSTdir\blabla'
File /nonfatal 'C:\blabla.bmp'
ifsilent +9 0
File /oname=$INSTdir\blabla.gif 'C:\blabla.gif'
newadvsplash::show /NOUNLOAD 500 500 500 -2 $INSTdir\blabla.gif
Delete $INSTdir\blabla.gif
Banner::show /NOUNLOAD 'BlaBla'
Banner::getWindow /NOUNLOAD
Pop $0
Call showme
newadvsplash::show /NOUNLOAD 2000 0 500 -1 /BANNER '$INSTdir\blabla\blabla.bmp'
RmDir /r '$INSTDIR\blabla'
SetOutPath '$INSTdir\blabla\blabla'
File /r 'C:\blabla\*.*'
RmDir /r '$INSTDIR\blabla\blabla'
SetOutPath '$INSTdir\blabla\blabla'
File 'C:\blabla\*.*'
IfSilent +7 0
GetDlgItem $2 $0 1030
SendMessage $2 12 0 'STR:Work finished !'
Call showme
Banner::destroy
newadvsplash::wait
Quit
FunctionEnd
Section
SectionEnd
Function showme
IntOp $2 1 | 2
IntOp $2 $2 | 64
System::Call 'user32::SetWindowPos(i r0, i -1, i, i, i, i, i r2)'
Sleep 1000
FunctionEnd
Function GetParameters
Push $R0
Push $R1
Push $R2
Push $R3
StrCpy $R2 1
StrLen $R3 $CMDLINE
StrCpy $R0 $CMDLINE $R2
StrCmp $R0 '"' 0 +3
StrCpy $R1 '"'
Goto +2
StrCpy $R1 ' '
IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 $R1 +3
StrCmp $R2 $R3 +2
Goto -4
IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 ' ' -2
StrCpy $R0 $CMDLINE '' $R2
Pop $R3
Pop $R2
Pop $R1
Exch $R0
Pop $2
StrCpy $1 '"'
Push $2
StrCpy $2 $2 '' 1
FunctionEnd
kichik
30th January 2008 19:14 UTC
Use:
ReserveFile "${NSISDIR}\Plguins\System.dll"
arfgh
30th January 2008 19:43 UTC
what part to inser this reservefile ?
i tried here
Name 'blabla'
!addplugindir 'C:\blabla'
OutFile 'C:\blabla.exe'
SetCompressor /SOLID lzma
SetDatablockOptimize on
Icon 'C:\blabla.ico'
InstalldirRegKey HKLM \
'Software\blabla\blabla\blabla\blabla' \
'blabla'
ReserveFile '${NSISDIR}\Plugins\System.dll'
not fixed the problem, because the unpacking data banner appears always a bit before to my first banner
kichik
30th January 2008 19:59 UTC
Are you sure it appears there and not when you call "File /r"? Put a message box before "File /r" to make sure.
arfgh
30th January 2008 20:02 UTC
yes, the unpackind data internal banner it appears a bit before my first banner.
kichik
30th January 2008 20:06 UTC
A bit is not an exact location. But I can probably tell the problem is with the extraction of a massive amount of files with File /r in .onInit. There's nothing you can do to get rid of the internal banner in that case but to move the extraction to a more appropriate location such as a section.
arfgh
30th January 2008 22:09 UTC
yes
if i insert the code to extract on the section, the unpacking date not come. But if i do that, i got other problem, because i not need the installer window.
Then to prevent that i use the command "hidewindow"
but this command have other bug, because it pop up so fast and then is hide. Thsi popup so fast is another so ugly anomaly.
have you some idea to prevent this other issue ?
Afrow UK
30th January 2008 23:28 UTC
If you don't want an installer window, use SilentInstall silent.
You can still use sections and banners.
Stu
arfgh
31st January 2008 12:24 UTC
Yes but actually i am using the silent installer to performa a "silent installing witjout the banners and the plugins"
but i need also the normal installation and i dont need thedefault makensis installer. By the way the "hidewindow" produce an ugly fast pop up and i think must exist a solution to prevent that.