|
|
#1 |
|
Junior Member
Join Date: Nov 2004
Posts: 3
|
Difference between Exec and nsExec
Hello,
I'm trying to run an executable using nsExec. The run always ends in an error that indicates an executable-related error. nsExec::ExecToLog '"myapp.exe"' I can run the same executable using Exec without a problem. Exec '"myapp.exe"' Thinking that the environment may be the issue, I've tried: nsExec::ExecToLog '<path_to_cmd.exe> /C "myapp.exe"' to no avail. This problem seems to point to differences in how nsExec and Exec work but I don't know what they are. Any ideas? Thanks, Mike |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jan 2002
Location: Berlin
Posts: 172
|
nsexec was written for command line apps. With nsexec::ExecToLog you can capture the outpu of the app and display it in the result window.
As far as i know it doesn't support live output as used by programs like rar. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2004
Posts: 3
|
myapp.exe is a command line app:
c:\>myapp.exe Writes to cmd.exe window and terminates. |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Something like this should work:
code: That would be another method of capturing the output. Note that nsExec::Exec will run your application and hide it completely from the user (so the user will not see a command-prompt window.) -Stu |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Nov 2004
Posts: 3
|
Thanks for the script but this doesn't really answer my question. I'm not looking for more error output from the nsExec run. The 'nsExec::ExecToLog' does write the errors to the result window. My question is: why would *any* command line program run to completion using:
Exec '"myapp.exe"' but fail using: nsExec::ExecToLog '"myapp.exe"' I'll be more specific now: the app I'm trying to run is Microsoft's Baseline Security Analyzer utility: mbsacli.exe. The error I get seem to be network-related - 'no computer were found'. |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Well, as nsExec doesn't execute your program through COMSPEC then perhaps that's why it is failing. Maybe you have to run it through COMSPEC for it to work?
-Stu |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Windows MS DOS (console) window is a bit more complex then a process with stdin and stdout only. Simple console applications work fine with nsExec, but some apps require more - terminal emulation or something else (like telnet does). This may be a reason, Exec creates full MS DOS console window, but nsExec simply redirects IO to pipes. You can also try ExecWait with SW_HIDE.
|
|
|
|
|
|
#8 | ||
|
Major Dude
|
Quote:
from the nsis docs: Quote:
does nsExec::Exec do this, or is it possible to use SW_HIDE with ExecWait? hand by comm@nder21 ---------- WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility |
||
|
|
|
|
|
#9 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Yes, you are right, I probably had in mind ExecShell. IMHO one of DOS-exec plug-ins is a good decision in your situation.
|
|
|
|
|
|
#10 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
It always complains about being unable to create a scan object for me. Can you attach a complete example for which you get the error you're talking about?
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|