- NSIS Discussion
- Exec vs. ExecShell - bug?
Archive: Exec vs. ExecShell - bug?
jaroslav_adamec
23rd October 2001 17:07 UTC
Exec vs. ExecShell - bug?
It looks to me that Exec and ExecWait aren't working.
This two lines doesn't works:
Exec "C:\winnt\notepad.exe"
ExecWait "C:\winnt\notepad.exe"
bouth sets Error flag
but this one works:
ExecShell "" "C:\winnt\notepad.exe"
So what's wrong?
Jarda
JEDGpro - SteV
23rd October 2001 18:51 UTC
:confused:
What are you talkin bout??
I don't understand
SteV
go.to/jedgpro
jaroslav_adamec
23rd October 2001 23:05 UTC
My program use third party software when I recognize that this softvare isn't installed on this computer I need to run their installation. So I want to run their instalation software and I used ExecWait instruction but it did nothing, so I tryed ExecShell and it works but with ExecShell I'm not able to recognize when and how this external program finished.
The example listed in my message was simplified as much as possible, ofcourse I don't need to run notepad.
Jarda
Schultz
24th October 2001 02:47 UTC
this taken from the docs..
"If no output variable is specified ExecWait sets the error flag if the program executed returns a nonzero error code, or if there is an error. "
So you might wish to add a varible to the ExecWait and see what the return code is when it is normally closed.
justin
24th October 2001 05:45 UTC
When using Exec, be sure that both:
-Justin
jaroslav_adamec
24th October 2001 09:28 UTC
Thanks,
the problem was that $OUTDIR wasn't set.
I have to say that in my documentation is nothing like Schultz wrote "If no output variable is specified ... "
There is only "$OUTDIR is used for the working directory".
Jarda
Schultz
24th October 2001 09:37 UTC
It is the sentance right before about using the $OUTPUT dir.
ExecWait full_path_of_command_to_execute [$(0-9)]
Execute the specfied program and wait for the executed process to quit. See Exec for more information. If no output variable is specified ExecWait sets the error flag if the program executed returns a nonzero error code, or if there is an error. If an output variable is specified, ExecWait sets the variable with the exit code (and only sets the error flag if an error occurs; if an error occurs the contents of the user variable are undefined).
Both the docs that come with Nsis 1.6 and the Online docs.
jaroslav_adamec
24th October 2001 10:23 UTC
Ok,
I'm very sorry, I started to work with NSIS a few days ago and I couldn't imagine how fast the develop of NSIS is.
I didn't now that if I have somethig what's two weeks old I have somethig realy very old.
So sorry Schultz.
Jarda
Schultz
24th October 2001 10:31 UTC
no need to be sorry for it. Cause it is also might be my fault for thinking that it could be in the docs that are a few weeks old. But lots of changes are good.. I have noticed that Justin always does a trend.. he will do alot of changes in a few months and then it will be a while before a version is released.. like version 1.44 was the top version for 4 months and then after that change after change which of course is not a bad thing at all.