- NSIS Discussion
- Help on splash screen and file initialization
Archive: Help on splash screen and file initialization
crystalcoder
14th February 2012 12:42 UTC
Help on splash screen and file initialization
Hi, I'm a new user to NSIS since reviously I'm using INNO. I have no background on C or C++ programming. So a sample code would be helpful.
I have a custom page which will load RTF file and show information about the application that I'm installing. This I'm using the 'LoadRTF.nsh' plugin. Now my problem is, how can I embed and extract the RTF file to temporary directory before all the page load using a splash screen initializing progress display like Winamp installer?
Afrow UK
14th February 2012 15:25 UTC
You can use the Banner plug-in.
Stu
crystalcoder
15th February 2012 12:38 UTC
Thanks for the advice. I have tested the following banner plug-ins.
- EBanner
- NewAdvSplash
- SpiderBanner
The closest to what I wanted is SpiderBanner. I'll have to run install page for single section then only go to welcome screen. That I'll try to figure up. Thanks for the idea.
If possible I want to do something like the attachment image.
crystalcoder
15th February 2012 13:16 UTC
I think I found something using "WinMessages.nsh" on examples folder for "Banner.dll". The banner.dll plugin can use to show that loading page. Now next problem is how to embed RTF file and read the embeded RTF using 'LoadRTF.nsh'?
MSG
15th February 2012 13:53 UTC
Embedding RTF has been asked about many times before. IIRC you can use a license page for that. But search the forums, you'll find it.
crystalcoder
15th February 2012 14:44 UTC
Using license page already tried. The problem is the display text box for RTF file is too small. Therefore I use my own custom page that consist only single text box to 100% width and height to show the RTF information.
Zizzzzy
15th February 2012 18:51 UTC
Setup your Temporary folder by using:
SetOutPath "$TEMP\DirectoryOfYourChoice"
You can include your file to be packaged by adding
File "Path\To\Your\File.rtf"
In my scripts, I have those two lines in my Function .onInit, the files are extracted and available in my temp directory while the program initializes and are ready immediately for use on my pages (or even splash screen)
I also add:
Function .onGUIEnd
RMDir /r /REBOOTOK "$TEMP\DirectoryOfYourChoice"
FunctionEnd
This will delete the temp files when your installer exits.
Afrow UK
15th February 2012 19:07 UTC
Originally posted by crystalcoder
Thanks for the advice. I have tested the following banner plug-ins.
- EBanner
- NewAdvSplash
- SpiderBanner
I specifically said
the Banner plug-in, because it comes with NSIS.
Stu
crystalcoder
15th February 2012 21:13 UTC
To: Zizzzzy
Thanks! It works! Didn't know the 'File' command can be use within function. Thought that is only usable in section
To: Afrow UK
Thanks a lot for the reminder. I actually realized after my #3 post and replied at #4. But that didn't solve the embedding and extacting the RTF file that I wanted.
crystalcoder
15th February 2012 22:22 UTC
Sorry to ask another question, since I'm totally beginner in C or C++.
How to specify or define a boolean? After that how to change the value or even comparing it using ${if}?
Specifying it will be using or passing parameter
Var MyBoolean
Now how do I set or change this boolean and then compare?
Afrow UK
15th February 2012 22:31 UTC
There are no data types as such in NSIS (all variables are strings) so the Boolean value is up to you. It can be "1" or "true" or "yes" (or whatever).
Edit: To set, use StrCpy.
Stu
crystalcoder
15th February 2012 22:42 UTC
Thanks a lot! I know about StrCpy and StrCmp. So strings value is fine for me as I'm using it by default. Just wondering it only.