kuku83
17th November 2011 08:04 UTC
psql problem
I am trying to execute this script:
'psql -U postgres -w -c "create database nuevantp"'
in a NSIS installer, i tried a lot of options ExecWait , ExecCmd
For example:
ExecCmd::exec /NOUNLOAD /ASYNC /TEST /TIMEOUT=10000 'psql -U postgres -w -c "create database nuevantp"'
or
ExecWait 'psql -U postgres -w -c "create database nuevantp"'
The problem is that random times the script is not executed and the database is not created.
Thanks in advance for your help!!!
Sergio
T.Slappy
18th November 2011 06:47 UTC
I assume this problem is related to psql, not to the NSIS.
Try to create .bat file with your command and execute it.
See results in cmd window for more info.
kuku83
18th November 2011 10:49 UTC
help
When I execute the bat file, it always return ok
I was 3 weeks with this problem and i am crazy now
Help pleaseeeeeeee
kuku83
18th November 2011 11:00 UTC
I have right now .bat 100 % operative , what is the best option to execute each bat file?
kuku83
19th November 2011 11:37 UTC
Help!!!
I tried a lot of ways to execute the .bat file in the NSIS installer and i cannot, the .bat file is called "create.bat" and it has the command "psql -U postgres -w -c "create database nuevantp"" If i execute it separatly it works fine, but NSIS doesn't execute it
Help!!!
Thanks in advance
T.Slappy
21st November 2011 06:06 UTC
Extract your bat file into $TEMP and execute it using ExecWait:
SetOutPath "$TEMP"
File "create.bat"
ExecWait '"$TEMP\create.bat"'
There are also many other options like: nsExec::ExecToLog and so on...