From c6076d0f3919e1f38fa53a4154ef21651b1aabfb Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 30 Nov 2021 19:53:27 +0000 Subject: [PATCH] --- Program.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Program.cs b/Program.cs index e1409e7..177db1d 100644 --- a/Program.cs +++ b/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);