Table of Contents

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

Task

EnsureNssmInstalledAsync()

Ensures NSSM is available locally for reliable Windows service management.

public static Task<string> EnsureNssmInstalledAsync()

Returns

Task<string>

Absolute path to nssm.exe when available; otherwise an empty string.

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

Task

IsNGINXInstalledAsync()

Checks if NGINX is installed by running 'nginx -v'.

public static Task<bool> IsNGINXInstalledAsync()

Returns

Task<bool>

True if NGINX is installed, otherwise false.

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

bool

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

nssmExe string
serviceName string
exePath string
appDirectory string
appParameters string

Returns

Task<bool>

NssmServiceExistsAsync(string, string)

Stops an NSSM-managed service.

public static Task<bool> NssmServiceExistsAsync(string nssmExe, string serviceName)

Parameters

nssmExe string
serviceName string

Returns

Task<bool>

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

nssmExe string
serviceName string
environmentVariables IReadOnlyList<string>

Returns

Task

NssmStartServiceAsync(string, string)

Starts an NSSM-managed service.

public static Task<bool> NssmStartServiceAsync(string nssmExe, string serviceName)

Parameters

nssmExe string
serviceName string

Returns

Task<bool>

NssmStopServiceAsync(string, string)

public static Task<bool> NssmStopServiceAsync(string nssmExe, string serviceName)

Parameters

nssmExe string
serviceName string

Returns

Task<bool>

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)

Parameters

nssmExe string
serviceName string
parameter string
value string

Returns

Task