Old 17th November 2011, 07:04   #1
kuku83
Junior Member
 
Join Date: Nov 2011
Posts: 4
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
kuku83 is offline   Reply With Quote
Old 18th November 2011, 05:47   #2
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 562
Send a message via ICQ to T.Slappy
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.

Cool looking installers with custom design: www.graphical-installer.com
Create Setup Pages easily: www.install-designer.com
Build installers in Visual Studio 2005-2022: www.visual-installer.com
or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 18th November 2011, 09:49   #3
kuku83
Junior Member
 
Join Date: Nov 2011
Posts: 4
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 is offline   Reply With Quote
Old 18th November 2011, 10:00   #4
kuku83
Junior Member
 
Join Date: Nov 2011
Posts: 4
I have right now .bat 100 % operative , what is the best option to execute each bat file?
kuku83 is offline   Reply With Quote
Old 19th November 2011, 10:37   #5
kuku83
Junior Member
 
Join Date: Nov 2011
Posts: 4
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
kuku83 is offline   Reply With Quote
Old 21st November 2011, 05:06   #6
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 562
Send a message via ICQ to T.Slappy
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...

Cool looking installers with custom design: www.graphical-installer.com
Create Setup Pages easily: www.install-designer.com
Build installers in Visual Studio 2005-2022: www.visual-installer.com
or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump