Archive: psql problem


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


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.


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


I have right now .bat 100 % operative , what is the best option to execute each bat file?


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


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...