Archive: nsExec on Win2003?


nsExec on Win2003?
  Has anyone tried using nsExec on Windows 2003? Last few times I tried it it didn't work at all. It seems to work fine on XP though.


Looks like this guy had problems as well. The same questions go to you as well. Have you verified it's a problem with nsExec and not of the program you're trying to run? Have you tried running any other programs? Can add more details about what exactly you're running?


Um, that guy was me :)

I figured it was a problem with nsExec because when I tried the nsExec example installed with NSIS it failed too. I didn't write that :)

I'm running ExecDos now instead and that seems to work okay.


DosExec has no support for 16-bit console applications. That might be the problem with nsExec. It was added because of this thread.

I've attached three versions of nsExec with three different changes to that piece of code. Let me know if any of those work for you.


I need to call cscript and I have been struggling to find a consistent way to do it under Windows 2003.

Somehow nsExec does not always find cscript, even if I use the full path. At least it is not consistent across two different Windows Server 2003 installations.

Right now I have this running on one server:
nsExec::ExecToStack '"$SYSDIR\cscript.exe" //nologo "$INSTDIR\admin\utility.vbs" doSomething'
While on the other server I had this running:
nsExec::ExecToStack '"$COMPSEC" /C "cscript" //nologo "$INSTDIR\admin\utility.vbs" doSomething'

On both server cscript is at the same place and in the path.

(I tried the three different recent versions of NsExec without luck).

Suggestions?
Thanks,
Thierry


I have tested the nsExec example multiple times on Windows Server 2003 Enterprise SP1 and it always worked. Can you spare some more details? Do you have an anti-virus? Did you try turning it off?


To kichik: ExecDos works correct with grep.exe if it was called from batch file:


ExecDos::exec "$EXEDIR\nsi.bat" "" "$EXEDIR\${APP_NAME}.log"
Pop $0 ; bat exit code

Batch file content

off

grep
.exe ExecDos Readme.txt
cls
>
DOS window not appears, log file receives output. Texted on XP, but I hope batch execution to be the same on other systems.

Of course, I meant automatic support. nsExec creates a 32-bit console wrapper automatically.


I solved the problem by using ExecDos. I then tried replacing ExecDos with nsExec some months later in order to log the output properly (on a different machine). It worked fine the second time but not at all the first time. I'm not sure why, but it was something to do with calling cscript.exe.