- NSIS Discussion
- InstallOptionsEx and Animation
Archive: InstallOptionsEx and Animation
0x539
23rd May 2005 11:16 UTC
InstallOptionsEx and Animation
Okay, I've created a test installer that should just show me one page with an avi. The idea behind this is I need something animated while I install the Java Runtime silently. I've created an avi (without sound) from gifs and it plays on a fresh install of windows 98 so the codec is right.
However, when I try to use it, it just doesn't seem to work. I use dumpstats to view the stack and I get the following:
Before Execution
0:
After execution
0: error finding config
1:
This is my NSI file:
Page custom JRE
OutFile "c:\test.exe"
Section "MainSection" SEC01
SectionEnd
Function JRE
Push $R0
File /oname=animation.ini animation.ini
File /oname=hmm.avi hmm.avi
Dumpstate::debug
InstallOptionsEx::dialog animation.ini
Dumpstate::debug
Pop $R0
FunctionEnd
And this is my animation.ini file:
[Settings]
NumFields=1
[Field 1]
Type=Animation
Height=321
Width=321
Left=2
Right=84
Top=20
Bottom=30
Text=hmm.avi
All three files (animation.ini, hmm.avi, test.nsi) are in the same directory when I attempt to compile it. Any help would be appreciated.
deguix
23rd May 2005 11:53 UTC
- "Height" and "Width" cannot be specified along with "Right" and "Bottom".
- "NumFields" is not used.
- You have to specify the path where "animation.ini" is in InstallOptionsEx call. It thinks it is an invalid path.
But thanks for the insight. I'll make it work as supposed next version.
0x539
23rd May 2005 12:44 UTC
Thanks for the quick reply. It's loading the page correctly now cause I'm using the $INSTDIR variable. Unfortunately, it's still not displaying the avi. All it displays is a blank page.
deguix
23rd May 2005 20:11 UTC
You also have to do the same with the avi path.
0x539
26th May 2005 09:23 UTC
Still struggling
I still can't seem to get it working. The following is my code.
[test.nsi]
Page custom JRE
OutFile "c:\test.exe"
Section "MainSection" SEC01
SectionEnd
Function JRE
Push $R0
File animation.ini
File hmm.avi
InstallOptionsEx::dialog $INSTDIR\animation.ini
Pop $R0
FunctionEnd
[animation.ini]
[Field 1]
Type=Animation
Text=$INSTDIR\hmm.avi
I've also tried just using 'hmm.avi' in the Text field and that doesn't seem to work either.
flizebogen
26th May 2005 12:20 UTC
As far as i know the installoptions plugin has no access to nsis interneal variables.
before you call the page you have to change the ini value with WriteIniStr
I used this in a couple of scripts and for me it worked best to extract everthing that i need for the IO Page in PluginsDir, change the pathes of controls within the ini file and than display the page.
After the installer finishs the pluginsdir is deleted automatically by nsis
0x539
27th May 2005 10:32 UTC
:/
Okay I've taken your advice and changed it thus:
Page custom JRE
OutFile "c:\test.exe"
Section "MainSection" SEC01
SectionEnd
Function JRE
StrCpy $INSTDIR "C:"
SetOutPath $INSTDIR
File hmm.avi
WriteINIStr "$INSTDIR\animation.ini" "Field 1" "Type" "Animation"
WriteINIStr "$INSTDIR\animation.ini" "Field 1" "Text" "$INSTDIR\hmm.avi"
InstallOptionsEx::dialog "$INSTDIR\animation.ini"
FunctionEnd
Still get the blank page :/. I think the only way I'm going to get this to work is if I can download an example of a working one. Alternatively, some nice person could look at the script I've uploaded and change it accordingly.
Thanks
Afrow UK
27th May 2005 12:03 UTC
Try:
InstallOptionsEx::dialog "$INSTDIR\animation.ini"
Pop $R0
MessageBox MB_OK $R0
What does it say?
-Stu
0x539
27th May 2005 13:31 UTC
I actually hadn't thought of checking what was on the stack :P. When I used Dumpstats to check the result, it has a string value of "success". I still get the blank screen though :/.
flizebogen
27th May 2005 13:35 UTC
i made several tests with your zip file (using the latest IOex) and wasn't able display the avi file. Maybe a codec issue?
0x539
27th May 2005 14:31 UTC
Mmm...I'm pretty sure the codec is alright because it displays on my PC. I'm using Img2Avi to take jpegs/bmps/* to avi and I've tried everyone of the following codecs that are available on my pc.
Codecs:
Uncompressed RGB24
Intel Indeo(R) Video R3.2
Microsoft Video 1
Indeo (R) video 5.10
I tested everyone of these codecs on a fresh install of windows 98se and each one seems to work fine. Virtual Dub 1.6.5 and Winamp 5.08e was also able to display them.
deguix
27th May 2005 21:14 UTC
I have several things to comment:
1) No fields will work if you don't specify the coordinates of the control. Also, delete the INI file after you use it.
2) Your AVI file is of a wrong type. The only supported video compression method is MS-RLE with 8 bits of video sample size. Quote from Platform SDK:
An animation control can display an AVI clip originating from either an uncompressed AVI file or from an AVI file that was compressed using run-length (BI_RLE8) encoding.
3) I made some tests with an AVI file with sound and it displayed correctly, but without reproducing the sound. This contradicts this quote from Platform SDK:
Animation controls can only display AVI clips that do not contain audio.
4) I also discovered some problems with IOEx. First, it doesn't mention anything about using "State" INI value name with
Animation controls, and this was required by the plugin to play the animation. Second, there are a couple of "break" instances missing in the code. These will be fixed on the next version. Until then, use "State=-1" for unlimited number of loops or "State=number of loops" to specify the number of loops you want.