Hopefully a simple question. If I Install PostgreSQL x64 Version 15 like this
Process process = new()
{
StartInfo = new ProcessStartInfo
{
FileName = exePath,
Arguments = $"--datadir \"{dataInstallPath}\" --servicename PostgreSQL.{version}.Service --serverport {port} --prefix \"{versionPath}\" --mode unattended",
UseShellExecute = false,
CreateNoWindow = true,
}
};
It installs it on the path, I provided (Example D:\PostgreSQL)
If I want to install a second instance of it with the same Command but another path (C:\PostgreSQL), it tries to install it on the old path (D:\PostgreSQL) because it gets the old path from the Registry HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL
Is there any way to prevent this so i can install multiple PostgreSQL instances?
The background is as follows. We need the database on a customer server and it may be that a customer database already exists in which we do not want to work.