Installer cannot not load NSISdl.dll
An installer I built for a Java program downloads and installs the JRE if the user doesn't have it already. I'm using NSISdl::download in my installer script. The part I believe is relevant is quoted here:
!define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=52247"
StrCpy $0 "$TEMP\jre_installer.exe"
NSISdl::download /TIMEOUT=30000 ${JRE_URL} $0
Pop $R0 ; Get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Java download failed: $R0"
Quit
When this code executes in our installer built with NSIS 2.46, I get this message in the MessageBox:
"Java download failed: /TIMEOUT=30000"
However, the message appears immediately, not after 30 seconds. If I remove the timeout argument $R0 in the message is the URL instead. It appears that the call to NSISdl::download is failing and its first argument ends up on the stack.
When this happens, the message above the progress bar is:
"Could not load: C:\DOCUME~1\Joel\LOCALS~1\Temp\nsv3.tmp\NSISdl.dll"
That DLL is not missing---it's in the indicated directory at the time when the install fails.
This worked with installers we've built with older versions of NSIS (I'm unsure what the last working version was, but I intend to find out later today). Does anyone know the cause of this problem? Is it an NSIS bug?