Please note that I am attempting to create a data file as part of my installation script. Here is what I am using:
# Create config.dat based on user`s previous selection
nsExec::ExecToStack '"$SYSDIRcmd.exe" @echo ServerPort = 2003 > $INSTDIRconfig.dat'
Pop $0 # return value/error/timeout
Pop $1 # printed text, up to ${NSIS_MAX_STRLEN}
DetailPrint '$SYSDIRcmd.exe "@echo ServerPort = 2003 > $INSTDIRconfig.dat" printed: $1'
DetailPrint ""
DetailPrint " Return value: $0"
DetailPrint ""
When I run the script, the above returns a 0, so I think it should have worked but when I check the installation directory I see that no config.dat file has been created.
Also, I have tried this command,
nsExec::ExecToStack '@echo ServerPort = 2003 > $INSTDIRconfig.dat'
But when I use it the display prints:
Return value: error
Here are websites I have looked at but it is still not clear to me how to get nsExec working.
Does anyone have any suggestions? TIA.
question from:
https://stackoverflow.com/questions/65947000/nsexecexectostack-fails-when-running-nsis-script-tring-to-run-dos-command 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…