initdb.exe failed suddenly (Windows)

1.1k Views Asked by At

My application bundles PostgreSQL 9.5.0 and runs initdb.exe manually. It works fine in the most clients. This A client also installed my application successfully before, but after rebooting their Windows (2008), they got below error. They intentionally just ran "initdb.exe' without any options.

c:\Users\Administrator> "C:\Program Files (x86)\myapp\pgsql\bin\initdb.exe"
The program "postgres" is needed by initdb but was not found in the same directory as "C:\Program Files (x86)\myapp\pgsql\bin\initdb.exe".
Check your installation.

My installer (inno setup) runs below one as well to grant privileges. (%1 points installation directory). icacls %1 /grant Everyone:(OI)(CI)F

Someone says that I should try with a non-privileged user as following but I have to reproduce this issue in my local env, and I don't have any issue with Admin or other non-privileged user.

runas /user:username "initdb -D ..." 

Can you guide me how I can resolve this issue?

0

There are 0 best solutions below