0

I try to install PostgreSQL within myapp in unattended mode, so created two folders for install postgresql under defualt Dir of myapp as (pgdata - pginstall),

***I try the solution with postgresql_9.6_x86 and 10.5_x86 and 10.5_x64 and 10.6_x86_x64 and 10.6_86. ***Defualt Dir is: C:\Program Files (X86)\myapp

I set command for unattended mode as below: I Used Parameters in Pascal code to allow PostgreSQL run with predefined options as below:

PostgresParams := ExpandConstant('--serverport 5555 --servicename PostgreSQL --superpassword xxxxxxxxxx --unattendedmodeui minimal --debuglevel 2 --mode unattended --prefix {app}\pginstall --datadir {app}\pgdata); 

When run myapp.exe, and in step of progress which install prerequisites , PostgreSQL gets error within installation of app as below:

There has been error. Expected option but got "Files". Option start with a leading "--" prefix Use --help to get a list of valid options

when I changed installation Dir to C:\ or D:\ or Any Dir instead of (C:\Program Files (x86)\myapp) the unattended installation of PostgreSQL start and working perfectly.

2
  • Add quotes around the paths? Commented Dec 5, 2018 at 6:06
  • @SamiKuhmonen I did, but got an error when run inno compiler to get myapp installer, error was : Syntax error. so i removed quotes Commented Dec 5, 2018 at 6:14

1 Answer 1

1

The installation path typically contains spaces (Program Files), so you always need to wrap it to double-quotes:

PostgresParams := ExpandConstant('... --prefix "{app}\pginstall" ... --datadir "{app}\pgdata"'); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.