I have created a installer with innosetup and i wanna use it to create a postgresql database using psql.exe . I call the psql.exe with this line of code :
Filename: "{app}\PostgreSQL\bin\psql.exe"; Parameters: "-W postgres";
The problem is that psql ask for user password and there is no option to pass it in one call .
Is it possible to simulate the "Enter" key and add the password just after ? If there is another solution let me know please.
Thanks .
There is the
PGPASSWORD
environment variable:As mentioned, there is also the password file but the environment variable would probably be fine for an installer. In either case you'd drop the
-W
switch.You could also build a special purpose tool to talk to PostgreSQL directly rather than go through
psql.exe
.