Skip to content
⌘ NSIS Forum Archive

NSIS dlls crash at first run

5 posts

PARTISAN#

NSIS dlls crash at first run

Hi all!

I'm just finished working on my first NSIS installer and I have one annoying issue: sometimes installer crashed while it's performing install. This is looks like it just disappear without any message boxes or any other notification. It's happening only while testing on Windows XP once per 20-50 installs. Using NSIS Special Builds I can see execution log and last log entry is copying nsExec.dll to temp directory.
nsExec::Exec: taskkill /S localhost /IM SomeProgramName.exe
Call: 1890
File: overwriteflag=1, allowskipfilesflag=2, name="C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nsf77.tmp\nsExec.dll"
File: wrote 6656 to "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nsf77.tmp\nsExec.dll"
*EOF*
Here is code snippet that executed at this log position
Function ExecToInstallLog 
Pop $0
${LogText} "nsExec::Exec: $0"
nsExec::ExecToStack /TIMEOUT=120000 $0
Pop $1
Pop $2
${If} $1 == 0
${LogText} "nsExec::Exec (success): $0"
${Else}
${LogText} "nsExec::Exec (failed): $0"
${LogText} "nsExec::Exec (error $1): $2"
${EndIf}
FunctionEnd

...

Push "taskkill /S localhost /IM SomeProgramName.exe"
Call ExecToInstallLog
This is first use of this library in installer, so I guess that crash happened in nsExec.dll. Few times I got the same with nsJSON.dll.
Provided info is exceedingly vague to make some conclusion, but I don't know any other way to get debug info. You can ask me test something.
P.S. Concrete program names was replaced due to customer's NDA
P.S.S. English isn't my native, so sorry if my post isn't clear enough.
PARTISAN#
Originally Posted by Anders View Post
Are you compiling with "Unicode True"?
No, should I check it?

Originally Posted by Anders View Post
Does NSIS v2.46 have the same problem?
Yes, I also got this crash with NSIS v2.46, but it's not the same: it's happens on third nsExec.dll use. Here is the log:
Call: 580
nsExec::Exec: taskkill /S localhost /IM SomeProgramName.exe
Call: 1893
File: overwriteflag=1, allowskipfilesflag=2, name="C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nswB2.tmp\nsExec.dll"
File: skipped: "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nswB2.tmp\nsExec.dll" (overwriteflag=1)
nsExec::Exec (failed): taskkill /S localhost /IM SomeProgramName.exe
nsExec::Exec (error 128): ERROR: The process "SomeProgramName.exe" not found.

Call: 580
nsExec::Exec: sc stop SomeServiceName
Call: 1893
File: overwriteflag=1, allowskipfilesflag=2, name="C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nswB2.tmp\nsExec.dll"
File: skipped: "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nswB2.tmp\nsExec.dll" (overwriteflag=1)
nsExec::Exec (success): sc stop SomeServiceName

Jump: 596
Call: 580
nsExec::Exec: sc delete SomeServiceName
Call: 1893
File: overwriteflag=1, allowskipfilesflag=2, name="C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nswB2.tmp\nsExec.dll"
File: skipped: "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nswB2.tmp\nsExec.dll" (overwriteflag=1)
*EOF*
and code for this log
Push "taskkill /S localhost /IM SomeProgramName.exe"
Call ExecToInstallLog
Push "sc stop SomeServiceName"
Call ExecToInstallLog
Push "sc delete SomeServiceName"
Call ExecToInstallLog
T.Slappy#
Is installer running as administrator?

There is probably some issue with the service (performing operation times-out) and nsExec cannot handle it correctly.

I am sure NSIS is working fine 🙂