Archive: ExecWait failing 10% of the time


ExecWait failing 10% of the time
Hi,

I have an installer that's executed about 1000 times per day.

I bundle three sub installers within the main installer, kind of like this:

MainInstall.exe
--SubInstall1.exe
--SubInstall2.exe
--SubInstall3.exe

My script uses NSISdl to log data to my web server so that I know how many times the installer is run.

I send a log message from within MainInstall.exe right before I call ExecWait SubInstall1.exe.

Then when SubInstall1.exe runs it uses NSISdl to log to the web server that it started running.

The logs show that ~10% of the time MainInstall.exe launches SubInstall1.exe, but SubInstall1.exe doesn't log that it started up.

I'm curious if anyone knew of any reasons that this might be occurring.

Thanks in advance,

Daniel


Hi Daniel, it seems that my installers has similar problems with ExecWait instruction.


Are you sure it's not just some packet loss or firewall blocking the request? Can you really be sure SubInstall1.exe hasn't been executed?


not a firewall issue
Hi kichik,

I can rule out a firewall issue since we are logging so much data through the install. All of it is being logged correctly in other parts of the installer. So, this should rule out the firewall as an issue.

I suppose a packet loss might be a possible issue. However since it is being run across almost 1000 computers per day I would expect the packet loss to be a much smaller percentage.

Also, each SubInstaller contains other logging by third-party vendors which correspond with our data.

Here are the relevant lines of code from the Main Installer. Note that I changed the url.

#Install the Weather Partner - Begin
NSISdl::download "http://base.fakeurl.com/logImage.php?t=8&c=6&a=8&b=0&display=0&e=Main%20Install%20Weather%20Start" $INSTDIR\logging

ExecWait '"$INSTDIR\weather_install.exe"'

NSISdl::download "http://base.fakeurl.com/logImage.php?t=8&c=6&a=8&b=0&display=0&e=Main%20Install%20Weather%20Finish" $INSTDIR\logging
#Install the Weather Partner - End

This actually launches the weather.com installer that you helped me with a few weeks ago.

Thanks for any help!

Daniel


Are you sure all of the installers use the same download method? Maybe some methods have different proxy detections than others. What do the other installers use?


Hi kichik,

Yes they all use the same code. Here is the code from the weather_install.exe nsis installer:

Function .onInit

InitPluginsDir

NSISdl::download "http://base.fakeurl.com/logImage.php?t=8&c=6&a=8&b=0&display=0&e=Weather%20Install%20Initializing" $INSTDIR\logging


FunctionEnd


If it's constantly just SubInstall1.exe, I have no other suggestions but a bug in its .onInit.


My first thought here is what is $INSTDIR set to?
If the folder does not exist then NSISdl would fail in theory.

Stu


Hi Afrow UK,

I've done some more testing and can replicate it now in the lab. This has turned out to be an issue with the NSISdl rather than ExecWait. The SubInstall1.exe was running, but the logging within the onInit was not occurring 10% of the time.

This was actually due to a bug in my script. In some cases the $INSTDIR does not exist at the time the SubInstall1.exe initializes. Thus causing the initialize logging to not happen. Later on in the default section this folder is automatically created, which causes the logging to start working.

We'll deploy the installer and monitor it for a couple days. I'm anticipating that this fixes the issue though.

Thanks for the help!

Daniel