1

I try to install PostgreSQL within myapp.exe (which used advanced installer to build) in unattended mode,

I set parameters as below:

--mode unattended --superpassword xxxxxxx --prefix c:\programs files (x86)\myapp\pg_install --datadir c:\programs files (x86)\myapp\pg_data --servicename PostgresSQL --serverport 5000 

Then 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:\ I got another error as below:

A data directory is registered in ****unknown variable postgresqlini**** but is neither empty, or a recognisable data directory.

The first error is the main one, because it's my app default installation dir is c:\program files (x86)\myapp

I searched a lot but didn't find any solution to fix it.

  • Unrelated, but: Postgres 9.3 is no longer supported you shouldn't use that for new installations. – a_horse_with_no_name Dec 4 '18 at 9:09
  • the same behavior with v10.5 and v10.6 @a_horse_with_no_name – user166276 Dec 4 '18 at 9:41
  • You should use "program files" for example in composed file names. – Luciano Andress Martini Dec 4 '18 at 12:32
  • @LucianoAndressMartini would you please explain it, i didn't understand how it works – user166276 Dec 4 '18 at 14:24
  • Updated I solved the error of Data directory | the error was in "..\data'**'", removing last "\" solved the error. But the main error not solved yet. Then PostgreSQL gets error within installation of app as below when install myapp in ..\program files (x86)\ > 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:\ it installed successfully not found any solution to fix it. – user166276 Dec 4 '18 at 14:26
0

The issue related to syntax, Added double-quotes to path solved it.

New path is: --prefix "path" --datadir "path"

Helped by @Martin

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy