- NSIS Discussion
- 2 questions : first on nsExec with Xcopy, second on directory of the exe
Archive: 2 questions : first on nsExec with Xcopy, second on directory of the exe
benchetrit
6th March 2004 17:36 UTC
2 questions : first on nsExec with Xcopy, second on directory of the exe
First question :
I have try to use the nsExec dll like below with an xcopy action, but no copy is made.
nsExec:Exec '"xcopy" c:\from\*.* c:\to\*.*'
So unfortunately, I was obliged to use ExecWait.
Second question :
I explain. The user have copied the install.exe somewhere. Then he start it. I would like to know where is this exe, because I need to use it at the next logon of the user. Is it possible to know from which directory the intall.exe was started.
Many thanks to all of us and specially for people who have developped NSIS and let it free to use. A great product. I will have more questions, but answers to these first ones will help me to finish a first version of my product.
Regards
Thierry
kichik
6th March 2004 18:53 UTC
1) Dave, got time to look at this?
2) $EXEDIR.
Joost Verburg
6th March 2004 21:37 UTC
Using an external application like xcopy is not such a good idea anyway. Why not use CopyFiles?
benchetrit
7th March 2004 07:09 UTC
I use CopyFiles elsewhere. But Xcopy offer more parameters like /exclude:filetoexclude.lst or other switch. So Dave, if you have a solution do not hesitate to post it.
Many thanks for your answers.
eccles
7th March 2004 10:23 UTC
Did you give the full path to xcopy? (I.e. "$SYSDIR\xcopy.exe")
benchetrit
7th March 2004 14:35 UTC
I did not give the full path.
...
But now, I have done. And it does not solve the issue. No copy is made. If I execute the same command in a dos window or by ExecWait it works.
Any more ideas ?
kichik
11th March 2004 19:01 UTC
Please attach a little example to demonstrate the problem.
benchetrit
12th March 2004 08:47 UTC
An example.
; nsixcopy.nsi
; The name of the installer
Name "nsixcopy"
; The file to write
OutFile "nsixcopy.exe"
Section "" ;No components page, name is not important
;Just initiate the example
CreateDirectory "c:\from"
CopyFiles "$EXEDIR\nsixcopy.exe" "c:\from"
nsExec::ExecToStack 'cmd /c dir c:\from'
Pop $0
Pop $1
MessageBox MB_OK|MB_ICONINFORMATION "Dir c:\from $\nCode : $0$\nResult :$\n$1"
nsExec::ExecToStack '"$SYSDIR\xcopy.exe" "c:\from\*.*" "c:\to\*.*"'
Pop $0
Pop $1
MessageBox MB_OK|MB_ICONINFORMATION "$SYSDIR\xcopy.exe c:\from\*.* c:\to\*.*$\nCode : $0$\nResult :$\n$1"
nsExec::ExecToStack 'cmd /c dir c:\to'
Pop $0
Pop $1
MessageBox MB_OK|MB_ICONINFORMATION "Dir c:\to $\nCode : $0$\nResult :$\n$1"
SectionEnd
kichik
12th March 2004 10:36 UTC
Fixed in latest CVS version. nsExec didn't create a valid input handle which apparently bothered xcopy.
benchetrit
12th March 2004 11:50 UTC
Thanks. Could you tell me when the release will be available ?
Moreover, I have other questions concerning nsExec. It seems that if does not accept pipe or redirection of the output like :
nsExec::Exec 'echo toto > toto.txt'
or
nsExec::Exec 'echo toto | sed s/o/a/'
Is it normal ?
kichik
12th March 2004 11:53 UTC
To get it:
http://nsis.sourceforge.net/development
As for redirection, you need to use cmd or command. You can get the path reading CMDSPEC. Search the forum, there are some threads about this topic. Search for `mysql'.
benchetrit
12th March 2004 13:18 UTC
It seems that the .dll is older
(Sat Jan 31 19:54:45 2004 UTC (5 weeks, 5 days ago) by kichik) than your resolution at :
http://cvs.sourceforge.net/viewcvs.p...ins/nsExec.dll
Perhaps I search in the wrong place :-(
kichik
12th March 2004 13:26 UTC
Well, I guess SourceForge's annoymous CVS service is still lagging 5 hours behind, sometimes even longer. Use the snapshot, it's updated a couple of times a day.
For now use the attachment.
benchetrit
12th March 2004 13:39 UTC
Obviously it works. Great !!! Thank you !