This commit is contained in:
32
Program.cs
32
Program.cs
@@ -48,22 +48,28 @@ catch (Exception ex)
|
|||||||
|
|
||||||
//================== LAUNCH POSTGRES SERVER ==================
|
//================== LAUNCH POSTGRES SERVER ==================
|
||||||
//https://notepad.onghu.com/2021/portable-postgresql-on-windows-without-installation/
|
//https://notepad.onghu.com/2021/portable-postgresql-on-windows-without-installation/
|
||||||
ProcessStartInfo PGStartInfo = new ProcessStartInfo(Path.Combine(AyaNovaProgramFolder, "local-postgres", "bin") + "\\pg_ctl.exe");
|
|
||||||
PGStartInfo.EnvironmentVariables["PGDATA"] = Path.Combine(DataPath, "database");
|
|
||||||
//PGStartInfo.EnvironmentVariables["PGDATABASE"] = "AyaNova";
|
|
||||||
PGStartInfo.EnvironmentVariables["PGUSER"] = "postgres";
|
|
||||||
PGStartInfo.EnvironmentVariables["PGPORT"] = "5432";
|
|
||||||
PGStartInfo.EnvironmentVariables["PGLOCALEDIR"] = Path.Combine(AyaNovaProgramFolder, "local-postgres", "share", "locale");
|
|
||||||
PGStartInfo.EnvironmentVariables["PGLOGS "] = Path.Combine(DataPath, "logs");
|
|
||||||
PGStartInfo.Arguments = "start";
|
|
||||||
//PGStartInfo.FileName = "pg_ctl.exe";
|
|
||||||
PGStartInfo.WorkingDirectory = Path.Combine(DataPath, "database");
|
|
||||||
//PGStartInfo.WorkingDirectory = Path.Combine(AyaNovaProgramFolder, "local-postgres", "bin");
|
|
||||||
|
|
||||||
PGStartInfo.UseShellExecute = false;
|
|
||||||
|
|
||||||
|
|
||||||
|
ProcessStartInfo PGStartInfo = new ProcessStartInfo();
|
||||||
|
//PGStartInfo.EnvironmentVariables["PGDATA"] = Path.Combine(DataPath, "database");
|
||||||
|
////PGStartInfo.EnvironmentVariables["PGDATABASE"] = "AyaNova";
|
||||||
|
//PGStartInfo.EnvironmentVariables["PGUSER"] = "postgres";
|
||||||
|
//PGStartInfo.EnvironmentVariables["PGPORT"] = "5432";
|
||||||
|
//PGStartInfo.EnvironmentVariables["PGLOCALEDIR"] = Path.Combine(AyaNovaProgramFolder, "local-postgres", "share", "locale");
|
||||||
|
//PGStartInfo.EnvironmentVariables["PGLOGS "] = Path.Combine(DataPath, "logs");
|
||||||
|
|
||||||
|
//ARGUMENTS DOC: https://www.postgresql.org/docs/11/app-postgres.html
|
||||||
|
PGStartInfo.Arguments = $"-D {Path.Combine(DataPath, "database")} -o \"-p 5432\" -l {Path.Combine(DataPath, "logs","postgres.log")} start";
|
||||||
|
PGStartInfo.FileName = "pg_ctl.exe";
|
||||||
|
//PGStartInfo.WorkingDirectory = Path.Combine(DataPath, "database");
|
||||||
|
PGStartInfo.WorkingDirectory = Path.Combine(AyaNovaProgramFolder, "local-postgres", "bin");
|
||||||
|
|
||||||
|
PGStartInfo.UseShellExecute = true;
|
||||||
var PGProcess = Process.Start(PGStartInfo);
|
var PGProcess = Process.Start(PGStartInfo);
|
||||||
|
|
||||||
/*
|
/*"-D C:\ProgramData\ayanova\database -p 5432 -l C:\ProgramData\ayanova\logs start"
|
||||||
old batch file settings required for postgres
|
old batch file settings required for postgres
|
||||||
SET PATH="%~dp0postgres\bin";%PATH%
|
SET PATH="%~dp0postgres\bin";%PATH%
|
||||||
SET PGDATA=%~dp0data\database
|
SET PGDATA=%~dp0data\database
|
||||||
|
|||||||
Reference in New Issue
Block a user