![]() |
#1 |
Senior Member
|
![]()
I am trying to use nsExec but It doesn't work.
PHP Code:
I think that the problem is with grep.exe because when I run it from a batch it doesn't close the window and remains open (usually a batch closes the window). The log should reflect this: Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more information. but it doesn't I found this thread with similar problems. I don't know if it's the same, since this grep.exe just makes a list, and they talk about getting live output or nsExec not getting the output until the program has finished. In my case, nsExec never grabs the output. I forgot to say that the return value is 1 (no errors, timeout, or whatever). note: why can't I write backslashes? |
![]() |
![]() |
![]() |
#2 |
Senior Member
|
First of all the link says that the server is too busy, here is an alternate link. i will test grep.exe now...
http://sunsite.utk.edu/ftp/usr-218-2...nu/grep24b.zip |
![]() |
![]() |
![]() |
#3 |
Senior Member
|
hm, right, isn't working for me either, thats strange....i don't think it has something to do with live output...
|
![]() |
![]() |
![]() |
#4 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Will check out.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#5 |
Senior Member
|
thanks kichik
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
|
At this point, here another thing i noticed is that nsexec makes these boxes in front of the output of lame (mp3 encoder). in the dos box they aren't there...
![]() |
![]() |
![]() |
![]() |
#7 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Those are tabs DOCa Cola. I'll see what I can do about it too.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#8 |
Senior Member
|
ah i see, thx
|
![]() |
![]() |
![]() |
#9 |
Senior Member
|
I found another grep.exe that works with NSIS. But now I have another problem
![]() ![]() I tried my best to redirect with "> t.txt" but I am quite unlucky in this thread and couldn't make it work, either. I tried many variations of this: ExecWait `"$INSTDIR\grep.exe" -h -i "$4" "$INSTDIR\$1" > "$INSTDIR\t.txt"` and none works ![]() |
![]() |
![]() |
![]() |
#10 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
To use redirection you have to use command.com/cmd.exe. Search the forum using the term "COMSPEC" for usage examples.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#11 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You can't log output using ExecWait let alone without using MS-DOS.
Use the WriteToFile function and create a batch file with the above (you're) command-line. Then execute the batch using nsExec::Exec The logging feature is an MS-DOS feature. -Stu |
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Or do this (like Kichik said)
code: -Stu |
![]() |
![]() |
![]() |
#13 |
Senior Member
|
Great! many ideas to try now.
Thanks ![]() |
![]() |
![]() |
![]() |
#14 | |
Senior Member
|
Quote:
DOCa Cola |
|
![]() |
![]() |
![]() |
#15 |
Senior Member
|
You can always find out what character is and use strcpy to strip it. It's bit of work, but works
![]() |
![]() |
![]() |
![]() |
#16 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Sorry, missed your message the first time. If it's really urgent drop by the IRC channel and I'll compile a version of nsExec for you that will temporarily solve this.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#17 |
Senior Member
|
Thx for taking on the Tab issue, but there is a small bug remaining
![]() The first character of the executed program seems to be untouched by that (after "decoding shellstr.mp3..." the nsexec command with lame starts) DOCa Cola Last edited by DOCa Cola; 22nd July 2003 at 08:19. |
![]() |
![]() |
![]() |
#18 |
NSIS Dev
Join Date: Apr 2003
Location: Portugal
Posts: 110
|
DOCa Cola, I will check this, but can you examine what char is it? TAB char left or another one? Can you please post the link to the tool you are using and an example of the parameters used so I can check it more quickly? thanks
cya later, Ramon |
![]() |
![]() |
![]() |
#19 |
Senior Member
|
hm, when i tried to paste this here it was translated as a new line
--- Decoding shellstr.mp3... input: --- parameters in the previous screen ![]() Note: as you can see, all boxes have been fixed but not the one at the beginning http://lame.sourceforge.net Download: http://mitiok.cjb.net/ Last edited by DOCa Cola; 22nd July 2003 at 09:23. |
![]() |
![]() |
![]() |
#20 |
Major Dude
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
|
It's probably a carriage return to move the cursor to the start of the line, \r.
|
![]() |
![]() |
![]() |
#21 |
Senior Member
|
so..and how can i get rid of this?
DOCa Cola |
![]() |
![]() |
![]() |
#22 |
Senior Member
|
Ok, here a ready to test simple installer using lame (all required files included)
http://www.borgcore.de/outerspace/nsis/lameinst.zip hope it is easier now to determine the bug DOCa Cola |
![]() |
![]() |
![]() |
#23 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
In latest CVS version I have fixed:
- Empty lines were not printed - CR or LF alone were not handled - Tab conversion removed the next char Thanks for the example, it was handy. nsExec.dll from latest CVS attached so you won't have to wait for the CVS delays. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#24 |
Senior Member
|
thx!
|
![]() |
![]() |
![]() |
#25 |
Senior Member
|
- Empty lines were not printed
oh, is there a way to surpress this feature optionally? i have another program i execute with nsexec::exectolog now just prints out to many empty lines into my log DOCa Cola |
![]() |
![]() |
![]() |
#26 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
There is no option to turn it off. Why would you want to do it? Does it print more empty lines than seen when executing the program without nsExec?
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#27 |
Senior Member
|
no the line size is correct in nsis, but the lines just exist to fill out the standard dos screen size, so there are a few empty lines not needed in nsis, it worked well without the printed empty lines. is it to complicated to make that optional? than i maybe could find another solution for that, but i thought such a feature might be helpful not to overload the nsis log with unnecessary empty lines.
DOCa Cola |
![]() |
![]() |
![]() |
#28 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
It's not that complicated, but I am trying to finish something else right now. You can use Afrow's/Brainsucker's scripts for removing lines in log for now. You can also use some of the methods described here:
http://www.experts-exchange.com/Prog..._20640729.html Although mainly for *nix, there are ports of the applications discussed there to Windows. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#29 |
Senior Member
|
yea, but i don't want to remove empty lines from a generated log file but from the output with showinstdetails. i can't see a solution how to solve this with such a program...ok, but anyway, i don't want to bother you, i will wait until you have time to add an option for that
DOCa Cola |
![]() |
![]() |
![]() |
#30 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
The solution is in there. Get grep and use this:
myprog.exe bla bla | grep.exe -v "^$" NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#31 |
Senior Member
|
owww, i am too blind, sorry, the commands just overtook me and i thought he wants to remove empty lines from a file, thx for the help! great support here! thx!
![]() DOCa Cola |
![]() |
![]() |
![]() |
#32 |
Senior Member
|
ok..i have come to one problem that my program now sees grep as a command parameter and stopped working....
|
![]() |
![]() |
![]() |
#33 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Right, forgot to mention you need the command line processor for this. You must use %COMSPEC% to make this work. Search for COMSPEC in the forum, there are lots of examples.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#34 |
Senior Member
|
owww, i see, but this is getting way to complicated, the thing is that i not only have one line of nsexec::exectolog and i don't want to change 20 commands around 2 times, so until then i will use the older nsexec where the bug was existend
![]() thx! DOCa Cola |
![]() |
![]() |
![]() |
#35 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
It's just another line, it's not that complicated. You can also make a macro out of it to make it even simpler.
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 | |
|
|