|
|
#1 |
|
Junior Member
Join Date: Oct 2003
Posts: 7
|
Exec and command line redirects?
OK, I've been fighting this one all afternoon.
I need to execute the command line mkpasswd -l >> passwd mkpasswd lives in $INSTDIR\bin, and I really want the file to land in $INSTDIR\etc, but I can't even get that far. mkpasswd just prints to stdout and I need to get that into a file. No matter what combination of quoting (and I've tried a lot) I use, I always get either silent failure or "mkpasswd: a domain is only accepted when -d is given" In other words, the '>>' is being interpreted as a parameter to mkpasswd, not as a redirect. I've read a dozen threads on similar and I can't figure this one out. I really want to say nsExec::ExecToLog '$INSTDIR\bin\mkpasswd -l >> $INSTDIR\etc\passwd' with whatever additional quoting/escaping/chanting/cursing is necessary to make it work. Any guidance would be appreciated. Thanks, Zandr |
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
You must use the command line interpreter to use redirection. Use petersa's method in this thread:
http://forums.winamp.com/showthread....ighlight=mysql Don't forget to use short file names for the command line interpreter. Use GetFullPathName /SHORT if the path is dynamic (includes $INSTDIR like in your case, for example). NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2003
Posts: 7
|
Thanks kichik!
I ended up working around this last night by invoking .bat files, but this is easier to maintain. Thanks again, Z |
|
|
|
|
|
#4 |
|
Guest
Posts: n/a
|
Could someone post a WORKING solution for exactly that?
I can't figure out, how the command mkpasswd -l >> passwd should work from NSIS and write the 'passwd' to the standard-etc-directory. |
|
|
|
#5 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
code: 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 | |
|
|