Class NGINXInstaller
- Namespace
- FishMMO.Installer
- Assembly
- FishMMO-Installer.dll
Handles NGINX installation and detection. Supports Windows (zip download + Windows service) and Linux (pacman, apt-get, dnf, yum + systemd).
public static class NGINXInstaller
- Inheritance
-
NGINXInstaller
- Inherited Members
Methods
DeployNginxConfigAsync()
Deploys the canonical FishMMO nginx.conf from
FishMMOSetupPath to the system NGINX config
location and reloads the service. Existing files are backed up once with
.pre-fishmmo.bak. Runs nginx -t before reload to validate syntax.
public static Task DeployNginxConfigAsync()
Returns
EnsureNssmInstalledAsync()
Ensures NSSM is available locally for reliable Windows service management.
public static Task<string> EnsureNssmInstalledAsync()
Returns
GetExpectedWindowsNginxHomePath()
Computes the expected NGINX home directory from configured zip filename.
public static string GetExpectedWindowsNginxHomePath()
Returns
- string
Absolute NGINX home directory path.
InstallNGINX()
Installs NGINX based on the operating system.
public static Task InstallNGINX()
Returns
IsNGINXInstalledAsync()
Checks if NGINX is installed by running 'nginx -v'.
public static Task<bool> IsNGINXInstalledAsync()
Returns
IsRunningAsAdministrator()
Checks whether the current process is running with Administrator privileges. Returns true on non-Windows (Linux uses sudo for individual commands).
public static bool IsRunningAsAdministrator()
Returns
NssmInstallAsync(string, string, string, string, string)
NSSM install with AppDirectory and Start set automatically.
public static Task<bool> NssmInstallAsync(string nssmExe, string serviceName, string exePath, string appDirectory, string appParameters)
Parameters
Returns
NssmServiceExistsAsync(string, string)
Stops an NSSM-managed service.
public static Task<bool> NssmServiceExistsAsync(string nssmExe, string serviceName)
Parameters
Returns
NssmSetEnvironmentAsync(string, string, IReadOnlyList<string>)
Sets NSSM AppEnvironmentExtra entries for a service. Each string should be in KEY=VALUE format.
public static Task NssmSetEnvironmentAsync(string nssmExe, string serviceName, IReadOnlyList<string> environmentVariables)
Parameters
nssmExestringserviceNamestringenvironmentVariablesIReadOnlyList<string>
Returns
NssmStartServiceAsync(string, string)
Starts an NSSM-managed service.
public static Task<bool> NssmStartServiceAsync(string nssmExe, string serviceName)
Parameters
Returns
NssmStopServiceAsync(string, string)
public static Task<bool> NssmStopServiceAsync(string nssmExe, string serviceName)
Parameters
Returns
SetNssmParamAsync(string, string, string, string)
Sets an NSSM parameter for a service (best-effort).
public static Task SetNssmParamAsync(string nssmExe, string serviceName, string parameter, string value)