无法从 Program Files 文件夹启动 postgres 作为服务

Cannot start postgres as Service from Program Files folder

这是对 and question2 的更新。在意识到 postgres 可以与其已经初始化的数据库捆绑在一起,甚至内部有模型数据(是的)之后,我修改了我的 NSIS 安装程序,只需将 postgres 复制粘贴到我的应用程序的安装文件夹中,然后创建并启动它作为监听非标准端口的服务。

问题是,当应用程序安装在 Program Files 文件夹中时,服务已创建,但无法启动。从命令行或服务 Windows 对话框我收到以下错误:

The My App Postgre Server service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

如果 postgre 安装在系统文件夹之外,例如D:\My App\pgsql\ 一切正常 - 服务启动并且可以通过我的应用程序访问数据库。

这似乎是一个权限问题,但我无法解决。

至于目前我遇到的所有信息都表明 Postgres 无法从 Program Files 或任何其他系统文件夹启动。我已经看到其他类似的应用程序使用它并安装它 C:\postgres 以使其工作。