This commit is contained in:
12
Program.cs
12
Program.cs
@@ -9,6 +9,8 @@ Console.WriteLine($"AyaNova server launcher {AyaNovaVersion.VersionString}");
|
||||
//Locate the ayanova executable folder as the basis point for all other paths later
|
||||
var AyaNovaProgramFolder = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), ".."));
|
||||
|
||||
AyaNovaProgramFolder = @"c:\Program Files\ayanova\";
|
||||
|
||||
//read in the config.json file to get it's current values
|
||||
var ConfigFile = Path.Combine(AyaNovaProgramFolder, "config.json");
|
||||
if (!File.Exists(ConfigFile))
|
||||
@@ -46,16 +48,18 @@ catch (Exception ex)
|
||||
|
||||
//================== LAUNCH POSTGRES SERVER ==================
|
||||
//https://notepad.onghu.com/2021/portable-postgresql-on-windows-without-installation/
|
||||
ProcessStartInfo PGStartInfo = new ProcessStartInfo();
|
||||
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["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(AyaNovaProgramFolder, "local-postgres", "bin");
|
||||
//PGStartInfo.FileName = "pg_ctl.exe";
|
||||
PGStartInfo.WorkingDirectory = Path.Combine(DataPath, "database");
|
||||
//PGStartInfo.WorkingDirectory = Path.Combine(AyaNovaProgramFolder, "local-postgres", "bin");
|
||||
|
||||
PGStartInfo.UseShellExecute = false;
|
||||
var PGProcess = Process.Start(PGStartInfo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user