Archive: installer crashes on launch


installer crashes on launch
Hello,

I am a first-time user of NSIS and I have a problem running an installer that I have created. When I execute the installer, I recieve an error message stating that the installer has caused a problem and needs to close. The installer was written and opened on Windows XP Service Pack 2. I am not sure what caused the error or if I have the script file or the configuration files written correctly.

The attached text file includes the contents of the script and configuration files. Additionaly, I had used the InstallOptionsEx plugin as well as the EBanner Plugin in the installer.

Any help in correcting the error message or the script file is greatly appreciated. Thank you for your support.

jtweather


Don't call both InstallOptionsEx::Dialog and InstallOptionsEx::Show, only InstallOptionsEx::Dialog.

-Stu


I now took out the InstallOptionsEx::Show calls, however, I am still getting the error message when I launch the installer.

jtweather


Remove the Call pre02 and Call pre03 instructions.
Not sure what you are trying to do there, but you can't show an InstallOptions dialog in the Leave function of a page.

-Stu


I removed the call pre02 and call pre03 functions. I also removed the leave01 and leave02 callback functions. Unfortunately, I am still getting the error message.

jtweather


I'd suggest try to get an experience on standard InstallOptions 'playing' with bundled examples and then make your modifications and add your personal futures one by one. :-)


I guess it must be the ebanner plugin causing the crash then, although the other things I mentioned would probably have crashed your installer as well.

Do the files 'media\audio.wav' 'media\banner.bmp' exist? What I mean by this is do they exist on run time. There's no code there to extract the files from your installer...?

-Stu


The files "audio.wav" and "banner.bmp" do exist on my system. They are located in "media/", which is a subdirectory of the directory that the installer was created in. Can the installer read the files from the subfolder, or do I have to compile the files in the installer?

jtweather


They must be extracted at run time with the File instruction.
You must also specify the full path to the files and not the relative path.

The best place to put these files is in the $PLUGINSDIR folder. Make sure you use InitPluginsDir before using the constant.

-Stu


I added the necessary File instructions and changed all $EXEDIR varibles to $PLUGINSDIR. I recompiled the installer, ran it, and still got the error.

Also, I took notice that, even though I had disabled the Next and Back buttons for the custom pages in the configuration files, the buttons showed up on the page. The attached text file has the modified code that is up to date. Do I still have errors in the modified code, also, are the buttons causing the error?

jtweather


It doesn't help using forward strokes (/) in the file paths for the ebanner plugin calls.
If that doesn't fix it then try commenting the ebanner calls.

-Stu


I changed the forward strokes to backward strokes, and I still get the error. I then thought about commenting the ebanner calls, but I am unsure if that means that I have to add comments to the ebannner calls. Do I have to add comments?

jtweather


It seems the problem is that the ebanner plugin does not like being unloaded while it is displaying the banner or playing the audio file.

Add the /UNLOAD switch to each of the ebanner plugin calls and the crashes stop.

e.g. instead of

ebanner::play '$PLUGINSDIR/audio.wav'
ebanner::show '$PLUGINSDIR/banner.bmp'

use

ebanner::play /NOUNLOAD '$PLUGINSDIR/audio.wav'
ebanner::show /NOUNLOAD '$PLUGINSDIR/banner.bmp'

This behaviour is quite common with plugins, check the readme.txt file that accompanies the ebanner plugin.

Duncan


Amendment to above, don't forget to call ebanner::stop without the /UNLOAD switch when you are done with the banner, so that NSIS can delete the $PLUGINSDIR when your installer exits.

BTW: The smilies are supposed to be "p"s, I think something in the parsing changed them on me!

Duncan


Originally posted by Mr Inches
BTW: The smilies are supposed to be "p"s, I think something in the parsing changed them on me!
Well, you could choose to Edit your post and check the "Disable Smilies in This Post" option :)

Fixed his post. :)

-Stu


I added the /NOUNLOAD switch to the Ebanner calls. I also changed $EXEDIR to $PLUGINSDIR in the InstallOptionsEx calls. The installer now opens without an error, however, the audio file ('audio.wav') won't play and 'banner.bmp' will not display. How do I get the audio to play and 'banner.bmp' to display now that I have the /NOUNLOAD switch in the code?

Attached is a copy of the code with the changes I made.

jtweather


The call to InstallOptionsEx will pause the execution process. No instructions will be executed after the plugin call until you click the Next button.

Move the ebanner plugin calls above the InstallOptionsEx plugin calls.

-Stu


I moved the Ebanner calls, however, 'audio.wav' still won't play and 'banner.bmp' still won't show.

jtweather


Hmm I can't think of anything more.
Please attach your newest script.

-Stu


My newest script is attached.

jtweather


As I understand, the EBanner plugin only works in the Installation page (within a section) and not in an InstallOptions page. (at least that's how I'm reading it. And the included example seems to show this as well.)

You may want to ask the author (Takhir) or post a message to this thread for clarification.

Also:
If you use eBanner, make sure you end it with an eBanner::stop call. This will unload the plugin from memory and prevent a windows error from occuring when the installation is finished (or if you abort your installation prematurely).


The EBanner plugin was working ('audio.wav' was playing) with the InstallOptionsEx pages, until I moved the EBanner calls. I heard 'audio.wav' play prior to recieving the error message.

jtweather


Also, I added the Ebanner::stop calls to the script. The audio still doesn't play, although I can hear 10 milliseconds of the audio file when the installer launches. Is there a problem with the configuration files for InstallOptionsEx? If so, is that why the audio won't play?

Attached is a copy of my configuration files for InstallOptionsEx. The attachment is up-to-date.

jtweather


I'm not sure how you were getting ebanner to either play a sound or display the image in the installoptions page.

To test, I used your script as a starting point and created my own InstallOptions.INI files. (Basically just INI files with just a group box and an image).

I never got a sound or image in any of the installoptions pages. But, when I inserted the ebanner calls the section, I got both the sound an image.


And, I got the same results using the regular InstallOptions as I did using InstallOptionsEX.

Based on this, I believe that eBanner only works in sections, not pages. Whether this is by-design or not remains to be answered. But, I think this proves that the problem has nothign to do with InstallOptionsEX.

My samples (minus the pictures and wav file) are attached if you want to play with them.


I used the provided example script to modify my script, but the audio still will not play.

Also, I had the EBanner calls after the InstallOptionsEx call, and I had to wait for the TimeOut feature of InstallOptionsEx to change the first page (Custom Page 1) to the second page (Custom Page 2) before I could hear the audio. The call 'Ebanner::Play $PLUGINSDIR\audio.wav' was located inside the Callback Function 'pre01' which was associated with the first page (Custom Page 1). My initial problem was that the audio was playing on the wrong page and that I had to click Next to make the audio play.

Is there any way I could correct that initial problem so that the audio plays on the right page without clicking Next? Or is there a way that, along with the provided script, I can correct my script that I currently have so that my installer works?

jtweather


Audio is not playing on the first page because you don't have a call to the ebanner::play function in the page's pre01 function.

The reason you need the timeouts to move from page to page is that you have set 'NextEnabled' in each of the first two page INI files to 0, disabling these buttons (Continue in your case).

Set 'NextEnabled' to 1 in each file and you can actually use the Next (Continue) buttons!!

The banner appears to only display on INSTPAGE.

Looking at the Ebanner code for the show function, it probably has to do with how Takhir locates the window to draw it on - I think the code is specifically to locate the Details Log window which doesn't exist until the INSTPAGE is displayed.

However, looking at the InstallOptionsEx documentation, you can embed an Image field directly onto your custom page. Maybe this will do what you want (except move the image).

Duncan


I have my installer running without problems, although the file 'video.avi' is not playing inside the window. I do have the file defined in the InstallOptionsEx configuration file '01-01-01b.ini' as an image. My goal was to have the video play as an an animation on the page. Is that possible with InstallOptionsEx. If not, can I run a gif file as an animation using InstallOptionEx? Or does InstallOptionsEx define an animation as an animated cursor?

jtweather


Just a guess:
Is is possible that perhaps your AVI file is not saved in the proper format? (try looking at the avi file's properties in Windows.)

According to the docs, an AVI file must be:

an Audio Video Interleave file without sound with no or with run-length of 8 bits (BI_RLE8) encoding compression

The AVI file I was using was in the right format. I used the Microsoft RLE Codec to create the 8-bit compressed AVI file. Am I using the right codec to compress the AVI file?

jtweather


hmm...
In testing it here, I'm having similiar issues. Looks like it may be something to do with InstallOptionsEx. You'll probably need to contact the author of the plugin.